Hello again. Fixed the annotation problem. Adding the operationName parameter seems to have done it. Still, nothing has changed with the deployment.
Sigh... Owen. -----Original Message----- From: Owen Thomas [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 04, 2007 9:32 AM To: [email protected] Subject: RE: Maven archetype for jsr181 component. Hi Guillaume. > You need to put this dependency in the SU for the jsr181 component,not > the SA. The SA is really just a zip of SUs. If you put the dependency > in the jsr181 SU, your jar should be included in the SU under the lib > folder, which is automatically added to the > SU classloader. Yep. It's definitely there. The build for the SU works fine, and it would fail if it wasn't. When I check the POM, the dependency for the JVMHost.jar is definitely in there... This is the dependency you speak of? <dependency> <groupId>au.net.wcg.utility.jvmhost</groupId> <artifactId>JVMHost</artifactId> <version>1.0</version> </dependency> This jar contains the CommandReturn class. Originally, the SU wouldn't build when I put in the WebMethod annotation for the single method defined in the web service class. So, believing that one didn't need the annotation when only one's class had on public method (I had one method only - which is public - so this qualifies), I removed the annotation and the build succeeded. However, the build error returns when I put the annotation back in. I currently believe that it is probable this build error is related. If I find the cause for this build error, I probably am not too far away to finding the cause for the deployment error. I'm stumped. Sigh... Owen. * ******** Start of output. Embedded error: Unable to generate service unit descriptor! <component-task-result xmlns="http://java.sun.com/xml/ns/jbi/management-message"> <component-name>null</component-name> <component-task-result-details> <task-result-details> <task-id>deploy</task-id> <task-result>FAILED</task-result> <message-type>ERROR</message-type> <task-status-msg><msg-loc-info><loc-token/><loc-message>java.lang.Illega lArgumentException: Invalid name []</loc-message></msg-loc-info></task-status-msg> <exception-info> <nesting-level>1</nesting-level> <msg-loc-info> <loc-token /> <loc-message>Invalid name []</loc-message> <stack-trace><![CDATA[java.lang.IllegalArgumentException: Invalid name [] [INFO] at org.codehaus.xfire.service.ServiceInfo.addOperation(ServiceInfo.java:71) [INFO] at org.codehaus.xfire.service.binding.ObjectServiceFactory.addOperation(Obj ectServiceFactory.java:760) [INFO] at org.apache.servicemix.jsr181.xfire.ServiceFactoryHelper$FixedJAXWSServic eFactory.addOperation(ServiceFactoryHelper.java:210) [INFO] at org.codehaus.xfire.service.binding.ObjectServiceFactory.initializeOperat ions(ObjectServiceFactory.java:720) [INFO] at org.codehaus.xfire.service.binding.ObjectServiceFactory.create(ObjectSer viceFactory.java:418) [INFO] at org.codehaus.xfire.annotations.AnnotationServiceFactory.create(Annotatio nServiceFactory.java:253) [INFO] at org.apache.servicemix.jsr181.Jsr181Endpoint.registerService(Jsr181Endpoi nt.java:301) [INFO] at org.apache.servicemix.jsr181.Jsr181Endpoint.validate(Jsr181Endpoint.java :216) [INFO] at org.apache.servicemix.common.DefaultComponent.addEndpoint(DefaultCompone nt.java:300) [INFO] at org.apache.servicemix.common.DefaultComponent.doInit(DefaultComponent.ja va:287) [INFO] at org.apache.servicemix.jsr181.Jsr181Component.doInit(Jsr181Component.java :81) [INFO] at org.apache.servicemix.common.AsyncBaseLifeCycle.init(AsyncBaseLifeCycle. java:142) [INFO] at org.apache.servicemix.jsr181.packaging.Jsr181ServiceUnitAnalyzer.getProv ides(Jsr181ServiceUnitAnalyzer.java:57) [INFO] at org.apache.servicemix.common.xbean.AbstractXBeanServiceUnitAnalyzer.init (AbstractXBeanServiceUnitAnalyzer.java:96) [INFO] at org.apache.servicemix.maven.plugin.jbi.GenerateServiceUnitDescriptorMojo .generateJbiDescriptor(GenerateServiceUnitDescriptorMojo.java:166) [INFO] at org.apache.servicemix.maven.plugin.jbi.GenerateServiceUnitDescriptorMojo .execute(GenerateServiceUnitDescriptorMojo.java:129) [INFO] at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginMa nager.java:417) [INFO] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Default LifecycleExecutor.java:610) [INFO] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifec ycle(DefaultLifecycleExecutor.java:551) [INFO] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultL ifecycleExecutor.java:530) [INFO] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandle Failures(DefaultLifecycleExecutor.java:309) [INFO] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments( DefaultLifecycleExecutor.java:276) [INFO] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifec ycleExecutor.java:143) [INFO] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:393) [INFO] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:182) [INFO] at org.apache.maven.embedder.MavenEmbedder.execute(MavenEmbedder.java:760) [INFO] at org.codehaus.mevenide.netbeans.execute.MavenJavaExecutor.run(MavenJavaEx ecutor.java:257) [INFO] at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:131) [INFO]]]></stack-trace> </msg-loc-info> </exception-info> </task-result-details> </component-task-result-details> </component-task-result> ******** End of output. * And here's the SU class definition in case a lack of one is causing you heartache. If I remove the dependency I specified above from the SU POM, in NetBeans (and I assume the same is true for Eclipse), I get red wavy lines under the method's declaration, the local variable's declaration, and the call to the static method OperatingSystem.executeCommand. In the first two wavy red lines, the editor is complaining that CommandReturn doesn't exist. In the second, it is complaining that the class OperatingSystem (defined along with CommandReturn in the JVMHost jar) doesn't exist. I put the dependency back in and the wavy redness vanishes. * ******** Start of output. @WebService(name = "JVMHostServiceUnit", targetNamespace = "http://wcg.net.au/webservices") public class JVMHostServiceUnit { @WebMethod public CommandReturn processRequest(String command) { CommandReturn commandReturn=new CommandReturn(); try { commandReturn=OperatingSystem.executeCommand(command); } catch (InterruptedException ex) { ex.printStackTrace(); } catch (IOException ex) { ex.printStackTrace(); } return commandReturn; } } ******** End of output. *
