我正在尝试使用netbeans生成一个webservices wsdl,但是它搜索Java 8中不存在的AnnotationProcessorFactory失败(因为我读过谷歌搜索)
我从头开始尝试了一个新的Web项目,使用Netbeans向导添加了Web服务。
这会使用hello方法创建一个新类
@WebService(serviceName = "NewWebService")
public class NewWebService
{
/**
* This is a sample web service operation
*/
@WebMethod(operationName = "hello")
public String hello(@WebParam(name = "name") String txt)
{
return "Hello " + txt + " !";
}
}
我午餐了wsdl生成后(右键单击Web服务名称并选择“生成WSDL并复制”,它开始在wsgen上编译并失败
command line: wsgen -classpath /usr/lib64/java/lib/tools.jar:/home/rcazzola/NetBeansProjects/sugar/WebApplication1/build/web/WEB-INF/classes:/opt/glassfish-4.1.1/glassfish/modules/webservices-osgi.jar:/opt/glassfish-4.1.1/glassfish/modules/endorsed/webservices-api-osgi.jar:/opt/glassfish-4.1.1/glassfish/modules/jaxb-osgi.jar:/opt/glassfish-4.1.1/glassfish/modules/endorsed/jaxb-api.jar -d /home/rcazzola/NetBeansProjects/sugar/WebApplication1/build/generated-sources/jax-ws -Xendorsed -keep -wsdl -r /home/rcazzola/NetBeansProjects/sugar/WebApplication1/build/generated-sources/jax-ws/resources -s /home/rcazzola/NetBeansProjects/sugar/WebApplication1/build/generated-sources/jax-ws -verbose ws.NewWebService
/home/xxxx/NetBeansProjects/sugar/WebApplication1/nbproject/jaxws-build.xml:26:
java.lang.NoClassDefFoundError: com/sun/mirror/apt/AnnotationProcessorFactory
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.lang.ClassLoader.defineClass(ClassLoader.java:642)
at com.sun.istack.tools.ParallelWorldClassLoader.findClass(ParallelWorldClassLoader.java:90)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.sun.tools.ws.ant.WsGen2.execute(WsGen2.java:524)
at com.sun.istack.tools.ProtectedTask.execute(ProtectedTask.java:55)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor93.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
at org.apache.tools.ant.Task.perform(Task.java:350)
at org.apache.tools.ant.Target.execute(Target.java:449)
at org.apache.tools.ant.Target.performTasks(Target.java:470)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)
at org.apache.tools.ant.Project.executeTarget(Project.java:1361)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:261)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:574)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:128)
Caused by: java.lang.ClassNotFoundException: com.sun.mirror.apt.AnnotationProcessorFactory
at com.sun.istack.tools.ParallelWorldClassLoader.findClass(ParallelWorldClassLoader.java:71)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 23 more
BUILD FAILED (total time: 0 seconds)
我错过了什么?