NoClassDefFoundError means that there is a linkage problem meaning a class is loaded by a parent class loader which does not have access to the children class loaders' classes. You must make sure that the class referencing to the MessageException is loaded by the same class loader as the MessageException.

Unfortunately there is not much you can do to figure out what is wrong except these two: - Use "-vebose:class" flag when you start Smx which will could indicate what class is trying to load MessageException - Instrument URL Class Loader. For that have a look at my articles at OnJava.com: http://www.onjava.com/pub/a/onjava/2004/06/30/classloader2.html

Hope this helps and let me know if that worked or not

Andreas Schaefer
CEO of Madplanet.com Inc.
[EMAIL PROTECTED]


On Jan 22, 2008, at 9:02 AM, Gordon Dickens wrote:

I did try defining with the explicit classpath (as below). I also tried setting the "self-first" and "parent-first" settings within separate tests and still the same result.

I want the classes to be loaded from jars within the SU, but it seems as though they are only loading when they are in the ServiceMix/lib/optional directory.

Any other suggestions?

Thanks,
Gordon Dickens

Guillaume Nodet wrote:
Have you tried without defining the <classpath/> element explicitely ?
The component will create the correct classloader by defaut.
Anyway, if this does not work, the problem may be completely different. It depends on where the classes are loaded from: are they loaded from the
SU or from the component or even container for some reason ?


On Jan 18, 2008 9:58 PM, Gordon Dickens <[EMAIL PROTECTED]> wrote:


Hello,

In an effort to minimize the clutter of our ServiceMix (v3.2.1)
lib/optional directory I would like to bundle dependent jars within
their corresponding service units.

The problem I am running into is with a service unit that requires
several cryptix jars for decryption.

The jar definitions are defined within the SUs pom.xml as
      <dependency>
          <groupId>cryptix</groupId>
          <artifactId>cryptix-jce-api</artifactId>
          <version>1.0</version>
      </dependency>
      <dependency>
          <groupId>cryptix</groupId>
          <artifactId>certpath-api-compat</artifactId>
          <version>1.0</version>
      </dependency>
      <dependency>
          <groupId>cryptix</groupId>
          <artifactId>cryptix-jce-provider</artifactId>
          <version>1.0</version>
      </dependency>
      <dependency>
          <groupId>cryptix</groupId>
          <artifactId>cryptix-message-api</artifactId>
          <version>1.0</version>
      </dependency>
      <dependency>
          <groupId>cryptix</groupId>
          <artifactId>cryptix-openpgp-provider</artifactId>
          <version>1.0</version>
      </dependency>
      <dependency>
          <groupId>cryptix</groupId>
          <artifactId>cryptix-pki-api</artifactId>
          <version>1.0</version>
      </dependency>


The SUs xbean.xml contains

  <classpath>
      <location>lib/certpath-api-compat-1.0.jar</location>
      <location>lib/cryptix-jce-api-1.0.jar</location>
      <location>lib/cryptix-jce-provider-1.0.jar</location>
      <location>lib/cryptix-message-api-1.0.jar</location>
      <location>lib/cryptix-openpgp-provider-1.0.jar</location>
      <location>lib/cryptix-pki-api-1.0.jar</location>
      <location>.</location>
  </classpath>

These jars are being included in the deployment jar and in the
servicemix/data directory I see the service unit expanded with the jars
in the SUs exploded lib directory.

The page http://servicemix.apache.org/classloaders.html leads me to
believe that I am doing this correctly.

When this service runs I get java.lang.NoClassDefFoundError:
cryptix/message/MessageException.

Can anyone shed light on this issue?

Thanks in advance,
Gordon Dickens





--
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
.




Reply via email to