1

我正在运行一个应用程序,该应用程序使用通过 wsimport 从 WSDL 生成的类。当我遇到 NoClassDefFoundError 时,我已将适当的 jar 文件添加到 Eclipse 构建中。

但是,我现在因缺少界面而受阻:

Exception in thread "main" java.lang.NoClassDefFoundError: org/netsnmp/NetSNMPAction
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2404)
at java.lang.Class.getConstructor0(Class.java:2714)
at java.lang.Class.getDeclaredConstructor(Class.java:2002)
at com.sun.xml.bind.v2.model.nav.ReflectionNavigator.hasDefaultConstructor(ReflectionNavigator.java:464)
at com.sun.xml.bind.v2.model.nav.ReflectionNavigator.hasDefaultConstructor(ReflectionNavigator.java:58)
at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.<init>(ClassInfoImpl.java:193)
at com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImpl.<init>(RuntimeClassInfoImpl.java:95)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createClassInfo(RuntimeModelBuilder.java:110)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createClassInfo(RuntimeModelBuilder.java:81)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:239)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:100)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:81)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:209)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:95)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:81)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:315)
at com.sun.xml.bind.v2.model.impl.TypeRefImpl.calcRef(TypeRefImpl.java:92)
at com.sun.xml.bind.v2.model.impl.TypeRefImpl.getTarget(TypeRefImpl.java:69)
at com.sun.xml.bind.v2.model.impl.RuntimeTypeRefImpl.getTarget(RuntimeTypeRefImpl.java:58)
at com.sun.xml.bind.v2.model.impl.RuntimeTypeRefImpl.getTarget(RuntimeTypeRefImpl.java:51)
at com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl$1.get(ElementPropertyInfoImpl.java:74)
at com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl$1.get(ElementPropertyInfoImpl.java:77)
at java.util.AbstractList$Itr.next(AbstractList.java:358)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:255)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:100)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:81)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:209)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:95)
at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:81)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:315)
at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:330)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:442)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:297)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:248)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:235)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:432)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:637)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:584)
at org.apache.axis2.jaxws.message.databinding.JAXBUtils$4.run(JAXBUtils.java:832)
at org.apache.axis2.java.security.AccessController.doPrivileged(AccessController.java:130)
at org.apache.axis2.jaxws.message.databinding.JAXBUtils.JAXBContext_newInstance(JAXBUtils.java:829)
at org.apache.axis2.jaxws.message.databinding.JAXBUtils.createJAXBContextValue(JAXBUtils.java:306)
at org.apache.axis2.jaxws.message.databinding.JAXBUtils.getJAXBContext(JAXBUtils.java:144)
at org.apache.axis2.jaxws.marshaller.factory.MethodMarshallerFactory.isContextPathConstruction(MethodMarshallerFactory.java:210)
at org.apache.axis2.jaxws.marshaller.factory.MethodMarshallerFactory.isDocLitWrappedPlus(MethodMarshallerFactory.java:170)
at org.apache.axis2.jaxws.marshaller.factory.MethodMarshallerFactory.createDocLitMethodMarshaller(MethodMarshallerFactory.java:123)
at org.apache.axis2.jaxws.marshaller.factory.MethodMarshallerFactory.getMarshaller(MethodMarshallerFactory.java:97)
at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.createRequest(JAXWSProxyHandler.java:328)
at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:159)
at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:141)
at $Proxy11.getComments(Unknown Source)
at com.parasoft.scc.taskimport.pstsec.TestGetComments.main(TestGetComments.java:18)

虽然我正在寻找实现此接口的 Jar 文件。我对生成的代码似乎需要的缺失类的数量和类型感到更加困扰。缺少的一个类是 Java Python 解释器(我通过添加 .所以我想就如何避免走下地狱之路寻求一些建议。

更新:我已经从使用 wsdlimport 工件更改为使用 wsdl2java 并且它是生成的代码。它正在工作,但我仍然想对未来提出一些建议。

4

0 回答 0