You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Owen Thomas <ot...@wcg.net.au> on 2007/04/03 00:45:08 UTC
RE: Maven archetype for jsr181 component.
Hello.
I've finally managed to follow the instructions Bruce gave me on 15
March (I had some other work to do in the meantime) but stopped after
step 5 because when I try to deploy the service assembly, ServiceMix
complained that it couldn't find a class in the service unit even though
it compiled under maven fine. The class that it is complaining about is
called by the implementation, so it does not directly service requests.
The error was copious, so I've pruned only the first 35 or so lines, and
attached it below.
Thanks for your help,
Owen.
*
******** Start of output.
ERROR - AutoDeploymentService - Failed to update Service
Assembly: JVMHostServiceAssembly
java.lang.Exception: <?xml version="1.0" encoding="UTF-8"?>
<jbi-task xmlns="http://java.sun.com/xml/ns/jbi/management-message"
version="1.0">
<jbi-task-result>
<frmwk-task-result>
<frmwk-task-result-details>
<task-result-details>
<task-id>deploy</task-id>
<task-result>FAILED</task-result>
<message-type>ERROR</message-type>
</task-result-details>
</frmwk-task-result-details>
</frmwk-task-result>
<component-task-result
xmlns="http://java.sun.com/xml/ns/jbi/management-message">
<component-name>servicemix-jsr181</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>Could not deploy xbean service unit</loc-message>
</msg-loc-info>
</task-status-msg>
<exception-info>
<nesting-level>1</nesting-level>
<msg-loc-info>
<loc-token/>
<loc-message>au/net/wcg/jvmhost/CommandReturn</loc-message>
<stack-trace><![CDATA[java.lang.NoClassDefFoundError:
au/net/wcg/jvmhost/CommandReturn
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getDeclaredMethods(Unknown Source)
at
org.apache.commons.attributes.DefaultCachedRepository.<init>(DefaultCach
edRepository.java:88)
<cut/>
******** End of output.
*
-----Original Message-----
From: Bruce Snyder [mailto:bruce.snyder@gmail.com]
Sent: Saturday, March 17, 2007 5:35 AM
To: servicemix-users@geronimo.apache.org
Subject: Re: Maven archetype for jsr181 component.
On 3/15/07, Owen Thomas <ot...@wcg.net.au> wrote:
> Good day to you all.
>
>
>
> If I'm going to use Maven to develop a component that will fit in to a
> servicemix-jsr181 container, will I need a web-service archetype of
some
> description? What archetype do people recommend my using? I would also
> like to know why.
If you want to deploy your project to the servicemix-jsr181 component,
you want to use either the servicemix-jsr181-annotated-service-unit
Maven archetype or the servicemix-jsr181-wsdl-first-service-unit Maven
Maven archetype to create the JBI service unit (SU) for your project.
This will create a Maven project skeleton for you. Then you'll need to
wrap the SU in a JBI service assembly (SA) for deployment to
ServiceMix. If you're familiar with J2EE development at all, think of
the SU as being equivalent to a WAR file and the SA as being
equivalent to an EAR file. Below are the steps to doing this:
1) Create your project skeleton using either the
servicemix-jsr181-annotated-service-unit Maven archetype or the
servicemix-jsr181-wsdl-first-service-unit Maven Maven archetype:
mvn archetype:create \
-DarchetypeGroupId=org.apache.servicemix.tooling \
-DarchetypeArtifactId=<insert-archetype-name-here> \
-DarchetypeVersion=3.1-incubating \
-DgroupId=<insert-java-package-name-here> \
-DartifactId=<insert-project-name-here> \
-DremoteRepositories=http://people.apache.org/repo/m2-incubating-reposit
ory
2) Fill in the skeleton with your project specific artifacts, i.e.,
populate the src/main/resources/xbean.xml configuration file add Java
classes, add dependencies to the pom.xml, etc.
3) Create a SA using the servicemix-service-assembly Maven archetype
to wrap the SU:
mvn archetype:create \
-DarchetypeGroupId=org.apache.servicemix.tooling \
-DarchetypeArtifactId=servicemix-service-assembly \
-DarchetypeVersion=3.1-incubating \
-DgroupId=<insert-java-package-name-here> \
-DartifactId=<insert-project-name-here> \
-DremoteRepositories=http://people.apache.org/repo/m2-incubating-reposit
ory
You'll need to add a dependency in the pom.xml for the SU created in
step number 1 above.
4) In the ServiceMix distribution, copy the
servicemix-jsr181-3.1-incubating-installer.zip and the
servicemix-shared-3.1-incubating-installer.zip to the install
directory
5) Copy the SA created in step number 3 above to the ServiceMix deploy
directory
6) Test your SU, possibly by sending messages to it using SoapUI
(http://soapui.org/)
You should now have your application deployed and ready to test or use.
I hope I didn't leave out anything major. If you have any questions,
please let us know.
Bruce
--
perl -e 'print
unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'
Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/
RE: Maven archetype for jsr181 component.
Posted by Owen Thomas <ot...@wcg.net.au>.
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:othomas@wcg.net.au]
Sent: Wednesday, April 04, 2007 9:32 AM
To: servicemix-users@geronimo.apache.org
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.
*
RE: Maven archetype for jsr181 component.
Posted by Owen Thomas <ot...@wcg.net.au>.
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.
*
Re: Maven archetype for jsr181 component.
Posted by Guillaume Nodet <gn...@gmail.com>.
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.
On 4/3/07, Owen Thomas <ot...@wcg.net.au> wrote:
>
> Hi Bruce.
>
> Hmmm...
>
> Originally, I thought that ServiceMix didn't need to know about this
> class because it was used only the service unit and the jar which
> contains more methods that the service unit calls.
>
> But then, I realised that the service unit indeed returns a
> CommandReturn object, and I am hoping JAXB will step in and convert this
> class to an XSD (or in-lines the definition in a WSDL) so that XML's are
> produced from this service unit and consumed by the as yet still to be
> constructed requestor.
>
> So, I inserted a dependency in JVMHostServiceAssembly, the Service
> Assembly's POM. I did this after I verified that nothing existed in the
> /lib directory of the Service Assembly. Indeed, nothing but /META-INF
> and the zip file to JVMHostServiceUnit, the service unit, exists in the
> service assembly, so nothing can in fact be put in a /lib directory for
> it doesn't exist.
>
> I insert the following dependency in my POM:
>
> <dependency>
> <groupId>au.net.wcg.utility.jvmhost</groupId>
> <artifactId>JVMHost</artifactId>
> <version>1.0</version>
> </dependency>
>
> When I rebuild, I am surprised to see that neither the /lib directory,
> nor JVMHost.jar, the jar file that contains the CommandReturn class
> exist in the Service Assembly. I assumed that by including this
> dependency, Maven might include the jar, and create the /lib directory
> within which it would put it. I think my assumption was wrong.
>
> Anyway, I redeploy the Service Assembly,....
>
> .... and as I suspected (because of the failure to include a /lib
> directory containing JVMHost.jar), it still doesn't like it.
>
> Was I on the right track?
>
> Owen.
>
> -----Original Message-----
> From: Bruce Snyder [mailto:bruce.snyder@gmail.com]
> Sent: Tuesday, April 03, 2007 12:51 PM
> To: servicemix-users@geronimo.apache.org
> Subject: Re: Maven archetype for jsr181 component.
>
> On 4/2/07, Owen Thomas <ot...@wcg.net.au> wrote:
> > Hello.
> >
> > I've finally managed to follow the instructions Bruce gave me on 15
> > March (I had some other work to do in the meantime) but stopped after
> > step 5 because when I try to deploy the service assembly, ServiceMix
> > complained that it couldn't find a class in the service unit even
> though
> > it compiled under maven fine. The class that it is complaining about
> is
> > called by the implementation, so it does not directly service
> requests.
> >
> > The error was copious, so I've pruned only the first 35 or so lines,
> and
> > attached it below.
> ...
> > <stack-trace><![CDATA[java.lang.NoClassDefFoundError:
> > au/net/wcg/jvmhost/CommandReturn
> > at java.lang.Class.getDeclaredMethods0(Native Method)
> > at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
> > at java.lang.Class.getDeclaredMethods(Unknown Source)
> > at
> >
> org.apache.commons.attributes.DefaultCachedRepository.<init>(DefaultCach
> > edRepository.java:88)
>
> Check your target directory to see if the CommandReturn.class file
> exists (e.g., using the find utility). Also check the SU archive to
> see if the CommandReturn class exists there (e.g., jar tvf | grep
> CommandReturn).
>
> Bruce
> --
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
>
> Apache Geronimo - http://geronimo.apache.org/
> Apache ActiveMQ - http://activemq.org/
> Apache ServiceMix - http://servicemix.org/
> Castor - http://castor.org/
>
--
Cheers,
Guillaume Nodet
------------------------
Architect, LogicBlaze (http://www.logicblaze.com/)
Blog: http://gnodet.blogspot.com/
RE: Maven archetype for jsr181 component.
Posted by Owen Thomas <ot...@wcg.net.au>.
Hi Bruce.
Hmmm...
Originally, I thought that ServiceMix didn't need to know about this
class because it was used only the service unit and the jar which
contains more methods that the service unit calls.
But then, I realised that the service unit indeed returns a
CommandReturn object, and I am hoping JAXB will step in and convert this
class to an XSD (or in-lines the definition in a WSDL) so that XML's are
produced from this service unit and consumed by the as yet still to be
constructed requestor.
So, I inserted a dependency in JVMHostServiceAssembly, the Service
Assembly's POM. I did this after I verified that nothing existed in the
/lib directory of the Service Assembly. Indeed, nothing but /META-INF
and the zip file to JVMHostServiceUnit, the service unit, exists in the
service assembly, so nothing can in fact be put in a /lib directory for
it doesn't exist.
I insert the following dependency in my POM:
<dependency>
<groupId>au.net.wcg.utility.jvmhost</groupId>
<artifactId>JVMHost</artifactId>
<version>1.0</version>
</dependency>
When I rebuild, I am surprised to see that neither the /lib directory,
nor JVMHost.jar, the jar file that contains the CommandReturn class
exist in the Service Assembly. I assumed that by including this
dependency, Maven might include the jar, and create the /lib directory
within which it would put it. I think my assumption was wrong.
Anyway, I redeploy the Service Assembly,....
.... and as I suspected (because of the failure to include a /lib
directory containing JVMHost.jar), it still doesn't like it.
Was I on the right track?
Owen.
-----Original Message-----
From: Bruce Snyder [mailto:bruce.snyder@gmail.com]
Sent: Tuesday, April 03, 2007 12:51 PM
To: servicemix-users@geronimo.apache.org
Subject: Re: Maven archetype for jsr181 component.
On 4/2/07, Owen Thomas <ot...@wcg.net.au> wrote:
> Hello.
>
> I've finally managed to follow the instructions Bruce gave me on 15
> March (I had some other work to do in the meantime) but stopped after
> step 5 because when I try to deploy the service assembly, ServiceMix
> complained that it couldn't find a class in the service unit even
though
> it compiled under maven fine. The class that it is complaining about
is
> called by the implementation, so it does not directly service
requests.
>
> The error was copious, so I've pruned only the first 35 or so lines,
and
> attached it below.
...
> <stack-trace><![CDATA[java.lang.NoClassDefFoundError:
> au/net/wcg/jvmhost/CommandReturn
> at java.lang.Class.getDeclaredMethods0(Native Method)
> at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
> at java.lang.Class.getDeclaredMethods(Unknown Source)
> at
>
org.apache.commons.attributes.DefaultCachedRepository.<init>(DefaultCach
> edRepository.java:88)
Check your target directory to see if the CommandReturn.class file
exists (e.g., using the find utility). Also check the SU archive to
see if the CommandReturn class exists there (e.g., jar tvf | grep
CommandReturn).
Bruce
--
perl -e 'print
unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'
Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/
Re: Maven archetype for jsr181 component.
Posted by Bruce Snyder <br...@gmail.com>.
On 4/2/07, Owen Thomas <ot...@wcg.net.au> wrote:
> Hello.
>
> I've finally managed to follow the instructions Bruce gave me on 15
> March (I had some other work to do in the meantime) but stopped after
> step 5 because when I try to deploy the service assembly, ServiceMix
> complained that it couldn't find a class in the service unit even though
> it compiled under maven fine. The class that it is complaining about is
> called by the implementation, so it does not directly service requests.
>
> The error was copious, so I've pruned only the first 35 or so lines, and
> attached it below.
...
> <stack-trace><![CDATA[java.lang.NoClassDefFoundError:
> au/net/wcg/jvmhost/CommandReturn
> at java.lang.Class.getDeclaredMethods0(Native Method)
> at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
> at java.lang.Class.getDeclaredMethods(Unknown Source)
> at
> org.apache.commons.attributes.DefaultCachedRepository.<init>(DefaultCach
> edRepository.java:88)
Check your target directory to see if the CommandReturn.class file
exists (e.g., using the find utility). Also check the SU archive to
see if the CommandReturn class exists there (e.g., jar tvf | grep
CommandReturn).
Bruce
--
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'
Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/
RE: Maven archetype for jsr181 component.
Posted by Owen Thomas <ot...@wcg.net.au>.
Thanks Bruce for clarifying that for me.
Accept my apologies if, by referring to you as a third person, the
apparent distance this created seemed impolite. I was trying to involve
the participation of others who might have had something to say on the
matter too.
I'll get back to you with the next problem, :)
Owen.
-----Original Message-----
From: Bruce Snyder [mailto:bruce.snyder@gmail.com]
Sent: Tuesday, April 03, 2007 12:52 PM
To: servicemix-users@geronimo.apache.org
Subject: Re: Maven archetype for jsr181 component.
On 4/2/07, Owen Thomas <ot...@wcg.net.au> wrote:
> Oh yea... one other thing.
>
> I assumed that I had followed as Bruce's instructions correctly when
the
> only component I had in my service assembly was the jsr-181 service
> engine. I assume that I did not need an HTTP binding component or
> something similar to talk to the service engine from outside
ServiceMix
> because (I could have been mistaken) his instructions did not appear
to
> specify it.
I now see that I neglected to include the step to create the HTTP
consumer. In order to access the JSR181 SU that you created from
outside the JBI container (e.g., using SoapUI), you will need to
expose it with an HTTP consumer. Below is the command to create this
SU:
mvn archetype:create \
-DarchetypeGroupId=org.apache.servicemix.tooling \
-DarchetypeArtifactId=servicemix-http-consumer-service-unit \
-DarchetypeVersion=3.1-incubating \
-DgroupId=<insert-java-package-name-here> \
-DartifactId=<insert-project-name-here> \
-DremoteRepositories=http://people.apache.org/repo/m2-incubating-reposit
ory
Instructions on configuring the HTTP consumer are available here:
http://incubator.apache.org/servicemix/servicemix-http.html
Then the HTTP consumer SU can be be bundled into the SA by adding a
dependency in the SA's pom.xml for the HTTP consumer.
Bruce
--
perl -e 'print
unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'
Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/
Re: Maven archetype for jsr181 component.
Posted by Bruce Snyder <br...@gmail.com>.
On 4/2/07, Owen Thomas <ot...@wcg.net.au> wrote:
> Oh yea... one other thing.
>
> I assumed that I had followed as Bruce's instructions correctly when the
> only component I had in my service assembly was the jsr-181 service
> engine. I assume that I did not need an HTTP binding component or
> something similar to talk to the service engine from outside ServiceMix
> because (I could have been mistaken) his instructions did not appear to
> specify it.
I now see that I neglected to include the step to create the HTTP
consumer. In order to access the JSR181 SU that you created from
outside the JBI container (e.g., using SoapUI), you will need to
expose it with an HTTP consumer. Below is the command to create this
SU:
mvn archetype:create \
-DarchetypeGroupId=org.apache.servicemix.tooling \
-DarchetypeArtifactId=servicemix-http-consumer-service-unit \
-DarchetypeVersion=3.1-incubating \
-DgroupId=<insert-java-package-name-here> \
-DartifactId=<insert-project-name-here> \
-DremoteRepositories=http://people.apache.org/repo/m2-incubating-repository
Instructions on configuring the HTTP consumer are available here:
http://incubator.apache.org/servicemix/servicemix-http.html
Then the HTTP consumer SU can be be bundled into the SA by adding a
dependency in the SA's pom.xml for the HTTP consumer.
Bruce
--
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'
Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/
RE: Maven archetype for jsr181 component.
Posted by Owen Thomas <ot...@wcg.net.au>.
Oh yea... one other thing.
I assumed that I had followed as Bruce's instructions correctly when the
only component I had in my service assembly was the jsr-181 service
engine. I assume that I did not need an HTTP binding component or
something similar to talk to the service engine from outside ServiceMix
because (I could have been mistaken) his instructions did not appear to
specify it.
Owen.
-----Original Message-----
From: Owen Thomas [mailto:othomas@wcg.net.au]
Sent: Tuesday, April 03, 2007 8:45 AM
To: servicemix-users@geronimo.apache.org
Subject: RE: Maven archetype for jsr181 component.
Hello.
I've finally managed to follow the instructions Bruce gave me on 15
March (I had some other work to do in the meantime) but stopped after
step 5 because when I try to deploy the service assembly, ServiceMix
complained that it couldn't find a class in the service unit even though
it compiled under maven fine. The class that it is complaining about is
called by the implementation, so it does not directly service requests.
The error was copious, so I've pruned only the first 35 or so lines, and
attached it below.
Thanks for your help,
Owen.
*
******** Start of output.
ERROR - AutoDeploymentService - Failed to update Service
Assembly: JVMHostServiceAssembly
java.lang.Exception: <?xml version="1.0" encoding="UTF-8"?>
<jbi-task xmlns="http://java.sun.com/xml/ns/jbi/management-message"
version="1.0">
<jbi-task-result>
<frmwk-task-result>
<frmwk-task-result-details>
<task-result-details>
<task-id>deploy</task-id>
<task-result>FAILED</task-result>
<message-type>ERROR</message-type>
</task-result-details>
</frmwk-task-result-details>
</frmwk-task-result>
<component-task-result
xmlns="http://java.sun.com/xml/ns/jbi/management-message">
<component-name>servicemix-jsr181</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>Could not deploy xbean service unit</loc-message>
</msg-loc-info>
</task-status-msg>
<exception-info>
<nesting-level>1</nesting-level>
<msg-loc-info>
<loc-token/>
<loc-message>au/net/wcg/jvmhost/CommandReturn</loc-message>
<stack-trace><![CDATA[java.lang.NoClassDefFoundError:
au/net/wcg/jvmhost/CommandReturn
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getDeclaredMethods(Unknown Source)
at
org.apache.commons.attributes.DefaultCachedRepository.<init>(DefaultCach
edRepository.java:88)
<cut/>
******** End of output.
*
-----Original Message-----
From: Bruce Snyder [mailto:bruce.snyder@gmail.com]
Sent: Saturday, March 17, 2007 5:35 AM
To: servicemix-users@geronimo.apache.org
Subject: Re: Maven archetype for jsr181 component.
On 3/15/07, Owen Thomas <ot...@wcg.net.au> wrote:
> Good day to you all.
>
>
>
> If I'm going to use Maven to develop a component that will fit in to a
> servicemix-jsr181 container, will I need a web-service archetype of
some
> description? What archetype do people recommend my using? I would also
> like to know why.
If you want to deploy your project to the servicemix-jsr181 component,
you want to use either the servicemix-jsr181-annotated-service-unit
Maven archetype or the servicemix-jsr181-wsdl-first-service-unit Maven
Maven archetype to create the JBI service unit (SU) for your project.
This will create a Maven project skeleton for you. Then you'll need to
wrap the SU in a JBI service assembly (SA) for deployment to
ServiceMix. If you're familiar with J2EE development at all, think of
the SU as being equivalent to a WAR file and the SA as being
equivalent to an EAR file. Below are the steps to doing this:
1) Create your project skeleton using either the
servicemix-jsr181-annotated-service-unit Maven archetype or the
servicemix-jsr181-wsdl-first-service-unit Maven Maven archetype:
mvn archetype:create \
-DarchetypeGroupId=org.apache.servicemix.tooling \
-DarchetypeArtifactId=<insert-archetype-name-here> \
-DarchetypeVersion=3.1-incubating \
-DgroupId=<insert-java-package-name-here> \
-DartifactId=<insert-project-name-here> \
-DremoteRepositories=http://people.apache.org/repo/m2-incubating-reposit
ory
2) Fill in the skeleton with your project specific artifacts, i.e.,
populate the src/main/resources/xbean.xml configuration file add Java
classes, add dependencies to the pom.xml, etc.
3) Create a SA using the servicemix-service-assembly Maven archetype
to wrap the SU:
mvn archetype:create \
-DarchetypeGroupId=org.apache.servicemix.tooling \
-DarchetypeArtifactId=servicemix-service-assembly \
-DarchetypeVersion=3.1-incubating \
-DgroupId=<insert-java-package-name-here> \
-DartifactId=<insert-project-name-here> \
-DremoteRepositories=http://people.apache.org/repo/m2-incubating-reposit
ory
You'll need to add a dependency in the pom.xml for the SU created in
step number 1 above.
4) In the ServiceMix distribution, copy the
servicemix-jsr181-3.1-incubating-installer.zip and the
servicemix-shared-3.1-incubating-installer.zip to the install
directory
5) Copy the SA created in step number 3 above to the ServiceMix deploy
directory
6) Test your SU, possibly by sending messages to it using SoapUI
(http://soapui.org/)
You should now have your application deployed and ready to test or use.
I hope I didn't leave out anything major. If you have any questions,
please let us know.
Bruce
--
perl -e 'print
unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'
Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/