This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 228323 - com.sun.tools.ws.processor.modeler.annotation.WebServiceAp can not be used (replacement for apt)
Summary: com.sun.tools.ws.processor.modeler.annotation.WebServiceAp can not be used (r...
Status: NEW
Alias: None
Product: webservices
Classification: Unclassified
Component: JAX-WS (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal with 1 vote (vote)
Assignee: Milan Kuchtiak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-06 02:20 UTC by chase
Modified: 2013-08-21 14:13 UTC (History)
0 users

See Also:
Issue Type: TASK
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description chase 2013-04-06 02:20:11 UTC
wsgen and apt are already deprecated and will not be included in the next version of Java. The replacement is to use the annotation processing features of javac. The replacement of apt is com.sun.tools.ws.processor.modeler.annotation.WebServiceAp which is included in jaxws-tools.jar (JAX-WS 2.2.6 - included with NetBeans).

You should be able to modify the project's properties, Build->Compiling and add com.sun.tools.ws.processor.modeler.annotation.WebServiceAp as an annotation processor. You should also be able to modify your build.xml to get the same result like so:

<target name="-pre-compile">
    <taskdef name="annotationProcessing"
             classname="com.sun.tools.ws.ant.AnnotationProcessingTask">
        <classpath path="${javac.classpath}"/>
    </taskdef>
    <mkdir dir="${build.generated.sources.dir}" />
    <annotationProcessing
        verbose="true"
        destdir="${build.classes.dir}"
        sourceDestDir="${build.generated.sources.dir}"
        srcdir="${src.dir}"
        includes="**/*.java"
        sourcepath="${src.dir}"
        includeantruntime="false">
        <classpath path="${javac.classpath}"/>
    </annotationProcessing>
</target>

Both result in an attempt to output files to the NetBeans install dir. ("example" is the containing package name)

An annotation processor threw an uncaught exception.
Consult the following stack trace for details.
com.sun.tools.ws.processor.generator.GeneratorException: can't create directory: C:\Program Files (x86)\NetBeans 7.3\.\example\jaxws
	at com.sun.tools.ws.processor.util.DirectoryUtil.ensureDirectory(DirectoryUtil.java:120)
	at com.sun.tools.ws.processor.util.DirectoryUtil.getOutputDirectoryFor(DirectoryUtil.java:76)
	at com.sun.tools.ws.processor.modeler.annotation.WebServiceWrapperGenerator.generateWrappers(WebServiceWrapperGenerator.java:258)
	at com.sun.tools.ws.processor.modeler.annotation.WebServiceWrapperGenerator.processMethod(WebServiceWrapperGenerator.java:200)
	at com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.visitExecutable(WebServiceVisitor.java:456)
	at com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.visitExecutable(WebServiceVisitor.java:81)
	at com.sun.tools.javac.code.Symbol$MethodSymbol.accept(Symbol.java:1332)
	at com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.processMethods(WebServiceVisitor.java:393)
	at com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.postProcessWebService(WebServiceVisitor.java:348)
	at com.sun.tools.ws.processor.modeler.annotation.WebServiceWrapperGenerator.postProcessWebService(WebServiceWrapperGenerator.java:176)
	at com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.visitType(WebServiceVisitor.java:155)
	at com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.visitType(WebServiceVisitor.java:81)
	at com.sun.tools.javac.code.Symbol$ClassSymbol.accept(Symbol.java:892)
	at com.sun.tools.ws.processor.modeler.annotation.WebServiceAp.process(WebServiceAp.java:199)
	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)
	at com.sun.tools.javac.main.Main.compile(Main.java:353)
	at com.sun.tools.javac.main.Main.compile(Main.java:342)
	at com.sun.tools.javac.main.Main.compile(Main.java:333)
	at com.sun.tools.javac.Main.compile(Main.java:76)
	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 org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:56)
	at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1153)
	at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:930)
	at com.sun.tools.ws.ant.AnnotationProcessingTask.execute(AnnotationProcessingTask.java:154)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
	at sun.reflect.GeneratedMethodAccessor189.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:392)
	at org.apache.tools.ant.Target.performTasks(Target.java:413)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
	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:283)
	at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:541)
	at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)

Something seems to be missing in the NetBeans environment that prevents this annotation processor from working.

For more information see http://jax-ws.java.net/2.2.7/docs/release-documentation.html#tools-annotation-processing
Comment 1 Milan Kuchtiak 2013-08-21 14:12:59 UTC
Thanks, good point.

For wsgen, Netbeans uses bundled version of JAX-WS library (JAX-WS 2.2.6 for 7.4)

Nevertheless, this is a reasonable task for the next release (following 7.4).

BTW: suggested "-pre-compile" target works fine for me.