[ 
http://jira.nuxeo.org/browse/NXP-1759?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_30187
 ] 

Radu Darlea commented on NXP-1759:
----------------------------------

Problems:
1. the resulted jar should use the MANIFEST.MF file from 
src/main/resources/META-INF.
2. In the build.xml there is a

      <option key="r" value="${build.home}"/>
      <source dir="${basedir}/src/main/java/org/nuxeo/ecm/platform/jaxws/">
        <include name="ExternalEditWSImpl.java"/>
      </source>
    </apt>

The apt is run only for this file. Nuxeo has more (3) services defined by their 
implementations (SEI). To compile all, I replaced this part with

      <option key="r" value="${build.home}"/>
      <source dir="${basedir}/src/main/java/org/nuxeo/ecm/platform/jaxws/">
        <include name="*.java"/>
      </source>
    </apt>

in order to produce all the files are needed in there and felt over my old 
beloved error:

      [apt] warning: Attempt to create 
'/home/rux/nuxeo-sources/trunk/nuxeo-platform-ws-jaxws/target/classes/org/nuxeo/ecm/platform/jaxws/jaxws/ClientAuthenticationExceptionBean.java'
 multiple times
      [apt] java.io.IOException
      [apt]     at 
com.sun.tools.apt.mirror.apt.FilerImpl.prepareFile(FilerImpl.java:318)
      [apt]     at 
com.sun.tools.apt.mirror.apt.FilerImpl.getPrintWriter(FilerImpl.java:265)
      [apt]     at 
com.sun.tools.apt.mirror.apt.FilerImpl.createSourceFile(FilerImpl.java:190)
      [apt]     at 
com.sun.tools.ws.wscompile.FilerCodeWriter.openSource(FilerCodeWriter.java:65)
      [apt]     at 
com.sun.codemodel.writer.FilterCodeWriter.openSource(FilterCodeWriter.java:27)
      [apt]     at 
com.sun.codemodel.writer.ProgressCodeWriter.openSource(ProgressCodeWriter.java:55)
      [apt]     at 
com.sun.codemodel.JPackage.createJavaSourceFileWriter(JPackage.java:459)
      [apt]     at com.sun.codemodel.JPackage.build(JPackage.java:410)
      [apt]     at com.sun.codemodel.JCodeModel.build(JCodeModel.java:281)
      [apt]     at com.sun.codemodel.JCodeModel.build(JCodeModel.java:271)
      [apt]     at 
com.sun.tools.ws.processor.modeler.annotation.WebServiceWrapperGenerator.doPostProcessWebService(WebServiceWrapperGenerator.java:113)
      [apt]     at 
com.sun.tools.ws.processor.modeler.annotation.WebServiceWrapperGenerator.postProcessWebService(WebServiceWrapperGenerator.java:101)
      [apt]     at 
com.sun.tools.ws.processor.modeler.annotation.WebServiceVisitor.visitClassDeclaration(WebServiceVisitor.java:147)
      [apt]     at 
com.sun.tools.apt.mirror.declaration.ClassDeclarationImpl.accept(ClassDeclarationImpl.java:95)
      [apt]     at 
com.sun.tools.ws.processor.modeler.annotation.WebServiceAP.buildModel(WebServiceAP.java:326)
      [apt]     at 
com.sun.tools.ws.processor.modeler.annotation.WebServiceAP.process(WebServiceAP.java:267)
      [apt]     at 
com.sun.mirror.apt.AnnotationProcessors$CompositeAnnotationProcessor.process(AnnotationProcessors.java:60)
      [apt]     at com.sun.tools.apt.comp.Apt.main(Apt.java:454)
      [apt]     at 
com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:448)
      [apt]     at com.sun.tools.apt.main.Main.compile(Main.java:1075)
      [apt]     at com.sun.tools.apt.main.Main.compile(Main.java:938)
      [apt]     at com.sun.tools.apt.Main.processing(Main.java:95)
      [apt]     at com.sun.tools.apt.Main.process(Main.java:43)
      [apt]     at com.sun.tools.apt.Main.main(Main.java:34)
      [apt] [total 2656ms]

This, I think, is meaning that apt is:
i. creating the compiled class files based on the annotations for a first class 
(NuxeoWSMainEntrancePointImplvI believe in our case), including the 
ClientAuthenticationExceptionBean.java
ii. trying to create the compiled class files based on the annotations for the 
second class (ExternalEditWSImpl I believe), sees that the class already exist 
and jumps out!!! So it fails creating the classes for this SEI.
This for sure is a bad habit of this tool, but it only one we have.
I saw this every time and in order to surpass I run the apt task for all SEI 
individually. In our case, I first use the build.xml with
        <include name="*.java"/>
and run second time
        <include name="(ExternalEditWSImpl.java"/>
and only after this I create the jar with all the files.

Do you think we could have multiple apt tasks for every SEI running before 
creating the jar? In this moment it would be about
ExternalEditWSImpl
NuxeoWSMainEntrancePointImpl
WSAuditBean
3. Do you think would be possible that on the ant server task to have, at the 
end, a task to copy
cp temp/OSGI-INF/deployment-container.xml 
/opt/jboss/server/default/deploy/nuxeo.ear/OSGI-INF/

 cp temp/OSGI-INF/templates/sun-jaxws.xml 
/opt/jboss/server/default/deploy/nuxeo.ear/OSGI-INF/templates/
 cp temp/OSGI-INF/templates/web.xml 
/opt/jboss/server/default/deploy/nuxeo.ear/OSGI-INF/templates/
? These files are configuring the nuxeo servlet and are replacing the existing 
ones.

Otherwise it looks promising!
Thx, Radu
p.s. Why the installation part? Is it needed by apt? I believe it can use the 
TOMCAT/shared/lib jars! Providing that installers allows the developer to 
install very easy them in tomcat.
p.s.2. I don't think we should care the license. It is license related to the 
installation  of metro/jaxws, which shouldn't be the Nuxeo task... Thierry? 

> 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

Reply via email to