[
http://jira.nuxeo.org/browse/NXP-1759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=31426#action_31426
]
Radu Darlea commented on NXP-1759:
----------------------------------
Hi
I tried to add the sample client as test in the WS service package. I also
added the wsimport task into the pom file, but:
1. the task is run every time (including for mvn eclipse:eclipse). Of course,
if the server is not running and hasn't the service deployed it just fails. The
task should be launched only at request.
2. the activation-1.1.jar file in repository doesn't match with the activation
jar I have from jaxws installation.It should be updated if possible. For my
machine I replaced the jar file in repo from jboss directory.
3. the sample compiles fine, but crashes at runtime:
Exception in thread "main" java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[...]
Caused by: javax.xml.ws.WebServiceException: Error creating JAXBContext for
W3CEndpointReference.
at com.sun.xml.ws.spi.ProviderImpl$2.run(ProviderImpl.java:222)
[...]
Caused by: javax.xml.bind.JAXBException
- with linked exception:
[java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory]
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:196)
[...]
Caused by: java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
[...]
The sample constructed with wsimport as ant task runs fine.
Only thing I was able to spot is that the wsimport maven plugin uses the option
-Xbootclasspath/p:/home/rux/.m2/repository/javax/xml/ws/jaxws-api/2.1/jaxws-api-2.1.jar:
/home/rux/.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar
which I suppose should point to 2.1.2-20070917 files instead.
Of course, I am not sure this would solve the problem.
As a general approach, I am not sure how to integrate the sample client in
source repository and into the build system. It can be either as maven plugin
or as ant task. Also, it would be nice if we could export (package) the sample
client together with the wsdl files automatically.
> Integrate the JAXWS based Web Services in Nuxeo build system
> ------------------------------------------------------------
>
> Key: NXP-1759
> URL: http://jira.nuxeo.org/browse/NXP-1759
> Project: Nuxeo Enterprise Platform 5
> Issue Type: Task
> Affects Versions: 5.2 M1
> Environment: JBoss 4.0.5.GA, JAXWS 2.1.2-20070917, Ubuntu Feisty 7.04
> Reporter: Radu Darlea
> Assignee: Thierry Delprat
> Fix For: 5.2 M1
>
> Original Estimate: 4 hours
> Remaining Estimate: 4 hours
>
> In order to run a JAXWS application, JBoss have to be updated. For that, the
> Metro 1.0 and JAXWS 2.1.2-20070917 jars have to be copied in the
> Tomcat/shared/lib directory.
> The project nuxeo-platform-ws-jaxws is currently located in sandbox. It can
> be built / deployed using specific scripts. The usual steps are:
> 1. Compile the written java files and produce the class files.
> 2. Run a task to generate the java files denoting the specific WS annotations
> 3. Compile the generated java files and produce the class files
> 4. Pack the class files (together with the MANIFEST and OSGI files) in a jar
> 5. Deploy the jar into nuxeo.ear/platform.
> Currently, the step 2 can be achieved using apt or wsgen with similar results.
> - In the build.xml located in the root of nuxeo-platform-ws-jaxws project the
> task apt is producing the wanted results.
> - Running maven build in the root of nuxeo-platform-ws-jaxws project fails:
> [INFO] [compiler:compile]
> [INFO] Compiling 13 source files to
> /home/rux/nuxeo-sources/trunk/nuxeo-platform-ws-jaxws/target/classes
> [WARNING] POM for 'com.sun.xml.stream.buffer:streambuffer:pom:0.4:runtime' is
> invalid. It will be ignored for artifact resolution. Reason: Failed to
> validate POM for project com.sun.xml.stream.buffer:streambuffer at Artifact
> [com.sun.xml.stream.buffer:streambuffer:pom:0.4:runtime]
> [WARNING] POM for 'org.jvnet.staxex:stax-ex:pom:1.0:runtime' is invalid. It
> will be ignored for artifact resolution. Reason: Not a v4.0.0 POM. for
> project org.jvnet.staxex:stax-ex at
> /home/rux/.m2/repository/org/jvnet/staxex/stax-ex/1.0/stax-ex-1.0.pom
> [INFO] [jaxws:wsgen {execution: wsgenAccess}]
> Problem encountered during annotation processing;
> see stacktrace below for more information.
> java.lang.annotation.IncompleteAnnotationException: javax.jws.WebMethod
> missing element exclude
> at
> sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:53)
> at $Proxy4.exclude(Unknown Source)
> at
> com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.hasWebMethods(WebServiceVisitor.java:329)
> at
> com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.shouldProcessWebService(WebServiceVisitor.java:305)
> at
> com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.visitClassDeclaration(WebServiceVisitor.java:109)
> at
> com.sun.tools.apt.mirror.declaration.ClassDeclarationImpl.accept(ClassDeclarationImpl.java:95)
> at
> com.sun.tools.ws.processor.modeler.annotation.WebServiceAP.buildModel(WebServiceAP.java:311)
> at
> com.sun.tools.ws.processor.modeler.annotation.WebServiceAP.process(WebServiceAP.java:252)
> at
> com.sun.mirror.apt.AnnotationProcessors$CompositeAnnotationProcessor.process(AnnotationProcessors.java:60)
> at com.sun.tools.apt.comp.Apt.main(Apt.java:454)
> at com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:448)
> at com.sun.tools.apt.main.Main.compile(Main.java:1075)
> at com.sun.tools.apt.main.Main.compile(Main.java:938)
> at com.sun.tools.apt.Main.processing(Main.java:95)
> at com.sun.tools.apt.Main.process(Main.java:85)
> at com.sun.tools.apt.Main.process(Main.java:67)
> at com.sun.tools.ws.wscompile.WsgenTool.buildModel(WsgenTool.java:161)
> at com.sun.tools.ws.wscompile.WsgenTool.run(WsgenTool.java:89)
> at com.sun.tools.ws.WsGen.doMain(WsGen.java:55)
> at
> org.codehaus.mojo.jaxws.AbstractWsGenMojo.execute(AbstractWsGenMojo.java:91)
> at
> org.codehaus.mojo.jaxws.MainWsGenMojo.execute(MainWsGenMojo.java:14)
> at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
> 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:585)
> at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> at
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> error: compilation failed, errors should have been reported
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> Apparently, there is a conflict in the classpath used. Running wsgen from
> shell with the command line
> [EMAIL PROTECTED]:~/nuxeo-sources/trunk/nuxeo-platform-ws-jaxws$ wsgen -d
> /home/rux/nuxeo-sources/trunk/nuxeo-platform-ws-jaxws/target/classes -cp
> /home/rux/nuxeo-sources/trunk/nuxeo-platform-ws-jaxws/target/classes:/home/rux/.m2/repository/org/nuxeo/ecm/platform/nuxeo-platform-api/5.2-SNAPSHOT/nuxeo-platform-api-5.2-SNAPSHOT.jar:/home/rux/.m2/repository/org/nuxeo/ecm/platform/nuxeo-platform-ws/5.2-SNAPSHOT/nuxeo-platform-ws-5.2-SNAPSHOT.jar:/home/rux/.m2/repository/org/nuxeo/ecm/platform/nuxeo-platform-audit-client/5.2-SNAPSHOT/nuxeo-platform-audit-client-5.2-SNAPSHOT.jar:/home/rux/.m2/repository/org/nuxeo/ecm/platform/nuxeo-platform-versioning-api/5.2-SNAPSHOT/nuxeo-platform-versioning-api-5.2-SNAPSHOT.jar:/home/rux/.m2/repository/org/nuxeo/ecm/core/nuxeo-core-schema/1.4-SNAPSHOT/nuxeo-core-schema-1.4-SNAPSHOT.jar:/home/rux/.m2/repository/commons-codec/commons-codec/1.3/commons-codec-1.3.jar:/home/rux/.m2/repository/javax/xml/bind/jaxb-api/2.1.2-20070917/jaxb-api-2.1.2-20070917.jar:/home/rux/.m2/repository/commons-lang/commons-lang/2.2/commons-lang-2.2.jar:/home/rux/.m2/repository/javax/xml/ws/jaxws-api/2.1.2-20070917/jaxws-api-2.1.2-20070917.jar:/home/rux/.m2/repository/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar:/home/rux/.m2/repository/com/sun/xml/xsom/20060306/xsom-20060306.jar:/home/rux/.m2/repository/com/sun/xml/ws/jaxws-rt/2.1.2-20070917/jaxws-rt-2.1.2-20070917.jar:/home/rux/.m2/repository/org/nuxeo/ecm/platform/nuxeo-platform-audit-api/5.2-SNAPSHOT/nuxeo-platform-audit-api-5.2-SNAPSHOT.jar:/home/rux/.m2/repository/org/nuxeo/ecm/platform/nuxeo-platform-url-core/5.2-SNAPSHOT/nuxeo-platform-url-core-5.2-SNAPSHOT.jar:/home/rux/.m2/repository/org/nuxeo/common/nuxeo-common/1.4-SNAPSHOT/nuxeo-common-1.4-SNAPSHOT.jar:/home/rux/.m2/repository/org/nuxeo/ecm/platform/nuxeo-platform-directory-api/5.2-SNAPSHOT/nuxeo-platform-directory-api-5.2-SNAPSHOT.jar:/home/rux/.m2/repository/org/nuxeo/ecm/platform/nuxeo-platform-events-api/5.2-SNAPSHOT/nuxeo-platform-events-api-5.2-SNAPSHOT.jar:/home/rux/.m2/repository/org/nuxeo/runtime/nuxeo-runtime/1.4-SNAPSHOT/nuxeo-runtime-1.4-SNAPSHOT.jar:/home/rux/.m2/repository/org/nuxeo/ecm/core/nuxeo-core-api/1.4-SNAPSHOT/nuxeo-core-api-1.4-SNAPSHOT.jar:/home/rux/.m2/repository/org/nuxeo/ecm/platform/nuxeo-platform/5.2-SNAPSHOT/nuxeo-platform-5.2-SNAPSHOT.jar:
> org.nuxeo.ecm.platform.jaxws.NuxeoWSMainEntrancePointImpl
> does the trick. Please also note that the utility is targeted against one
> single source file
> (org.nuxeo.ecm.platform.jaxws.NuxeoWSMainEntrancePointImpl) and so it has to
> be run for all the code files implementing the Service.
> Actually, in the pom file there are 3 execution tags for every SEI
> implemented.
> It would be nice if, once the project is moved from sandbox to trunk, one
> will simply run usual commands (mvn clean install;ant deploy) and have the WS
> deployed in JBoss.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.nuxeo.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
ECM-tickets mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm-tickets