You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Thomas Grabietz <to...@toms-toy.de> on 2011/10/06 10:50:36 UTC
using axis2 codgen ant-task with jaxb-databinding + xjc2 extension
Hello all,
I'm using the org.apache.axis2.tool.ant.AntCodegenTask with the
jaxbri-databinding.
I need to annotate the jaxb-entities with jpa-annotations, so I'm using
also the Xannotate extension.
My workaround hast to steps:
First I generate the Skeleton, MessageReceiver with the
org.apache.axis2.tool.ant.AntCodegenTask
<target name="codegenServer" depends="declareServer">
<codegen
...
databindingName="jaxbri"
...
/>
</target>
The second step is to overwrite the generated jaxb-entities:
<taskdef name="xjc" classname="org.jvnet.jaxb2_commons.xjc.XJC2Task">
<classpath>
<fileset dir="../resources/lib/annotate/" includes="*.jar" />
<pathelement location="../bin/" />
</classpath>
</taskdef>
<target name="generateServerJaxb"
description="Annotate jaxbri entities with jpa annotations">
<echo>annotate jaxb entities with jpa annotations</echo>
<xjc schema="level5ServiceTypes.xsd"
destDir="${destDirServer}/src"
package="${packageNameServer}.entity">
<arg line="-Xannotate -extension" />
</xjc>
</target>
To generate the entities, I have to set the
jxb:extensionBindingPrefixes="annox"
I have the problem, that the org.apache.axis2.tool.ant.AntCodegenTask
fails while reading this attribute (see the stack trace below). When I
remove this attribute, the org.apache.axis2.tool.ant.AntCodegenTask
works with some warnings, but the XJC2Task fails.
Does anybody have an idea how I can fix this?
Kind regads
Tom
BUILD FAILED
/home/tom/src/java/projects/eclipse_helios/level5Service/wsdl/build.xml:64:
org.apache.axis2.wsdl.codegen.CodeGenerationException:
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at
org.apache.axis2.tool.ant.AntCodegenTask.execute(AntCodegenTask.java:418)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at
org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
at
org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:423)
at
org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:137)
Caused by: org.apache.axis2.wsdl.codegen.CodeGenerationException:
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:293)
at
org.apache.axis2.tool.ant.AntCodegenTask.execute(AntCodegenTask.java:416)
... 16 more
Caused by: java.lang.RuntimeException:
java.lang.reflect.InvocationTargetException
at
org.apache.axis2.wsdl.codegen.extension.JAXBRIExtension.engage(JAXBRIExtension.java:112)
at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:246)
... 17 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.axis2.wsdl.codegen.extension.JAXBRIExtension.engage(JAXBRIExtension.java:101)
... 18 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException:
Unable to generate code using jaxbri
at
org.apache.axis2.jaxbri.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:355)
... 23 more
Caused by: java.lang.RuntimeException: Unable to generate code using jaxbri
at
org.apache.axis2.jaxbri.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:247)
... 23 more
--- Nested Exception ---
org.apache.axis2.wsdl.codegen.CodeGenerationException:
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:293)
at
org.apache.axis2.tool.ant.AntCodegenTask.execute(AntCodegenTask.java:416)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at
org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
at
org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:423)
at
org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:137)
Caused by: java.lang.RuntimeException:
java.lang.reflect.InvocationTargetException
at
org.apache.axis2.wsdl.codegen.extension.JAXBRIExtension.engage(JAXBRIExtension.java:112)
at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:246)
... 17 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.axis2.wsdl.codegen.extension.JAXBRIExtension.engage(JAXBRIExtension.java:101)
... 18 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException:
Unable to generate code using jaxbri
at
org.apache.axis2.jaxbri.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:355)
... 23 more
Caused by: java.lang.RuntimeException: Unable to generate code using jaxbri
at
org.apache.axis2.jaxbri.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:247)
... 23 more
--
Für's private
http://toms-toy.de/Thomas%20Grabietz%20tom@toms-toy.de%20(0xE43515AC)%20pub.asc
GIT d-(---)? s():()> a+ C$>++ UL$>+ P? L>++ E W>+++ N>++$ o K--? w>--- O
M>-- V PS>+ PE Y PGP>++$ t 5 X R tv b>+++ DI D G e> h>++ !r y>+
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org