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 <[EMAIL PROTECTED]> 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:[EMAIL PROTECTED]
Sent: Tuesday, April 03, 2007 12:51 PM
To: [email protected]
Subject: Re: Maven archetype for jsr181 component.
On 4/2/07, Owen Thomas <[EMAIL PROTECTED]> 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)[EMAIL PROTECTED]&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/