我使用Eclipse创建了一个Webservice(Axis2)并部署到Glassfish服务器。
Axis2-web运行良好,但当我请求我的服务的WSDL时,我只是得到了一个expcetion:
Caused by: java.lang.NoClassDefFoundError: javax/lang/model/element/Element
at com.sun.tools.ws.processor.modeler.annotation.WebServiceWrapperGenerator.<init>(WebServiceWrapperGenerator.java:130)
at com.sun.tools.ws.processor.modeler.annotation.WebServiceAp.process(WebServiceAp.java:181)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:793)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:722)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1700(JavacProcessingEnvironment.java:97)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1029)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1163)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1108)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:824)
at com.sun.tools.javac.main.Main.compile(Main.java:439)
... 42 more
Caused by: java.lang.ClassNotFoundException: javax.lang.model.element.Element not found by com.sun.xml.bind [150]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1460)
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:72)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1843)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 52 more
通常NoClassDefFoundError
表示缺少依赖关系,但是&#39; javax.lang.model.element.Element&#39;来自JRE(&#39; rt.jar&#39;)所以我不知道这里有什么问题。
更多细节: Eclipse Juno,Glassfish 3.1.2,Axis2-1.6.2,动态Web项目