我正在尝试使用netbeans生成一个webservices wsdl,但它无法搜索AnnotationProcessorFactory,它在java8中不存在(因为我已经阅读了谷歌搜索)我从头开始尝试了一个新的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)
我错过了什么?