users@glassfish.java.net

Re: ClassNotFoundException: javax.resource.spi.ResourceAdapter

From: Jagadish Prasath Ramu <Jagadish.Ramu_at_Sun.COM>
Date: Tue, 30 Mar 2010 11:34:35 +0530

On Mon, 2010-03-29 at 12:07 -0700, Robert Weeks wrote:

> > javaee.jar in GlassFish v3 will have references to individual technology
> > API jars. (Refer MANIFEST.MF of GFv3_Root/lib/javaee.jar). Also, the
> > classpath is relative and hence you cannot move javaee.jar to a
> > different location.
> >
> > If you have not relocated the javaee.jar and still facing the issue, can
> > you post the exception stack trace and if possible the steps too.
>
> I have not moved any jars - *except* for some of the jms jars into my domain/lib/ext/ dir:
> imq.jar
> imqjmsra.jar
> jms.jar
http://docs.sun.com/app/docs/doc/820-7695/beade?l=en&a=view

As per the classloader hierarchy of GlassFish, these jars (made
available as part of extension classloader) will not have access to Java
EE APIs (made available as part of Public API Classloader).
You can try copying these jars to "lib" directory (common classloader)
of GlassFish, remove the jars from ext dir and restart GlassFish.

Thanks,
-Jagadish
>
> I had to put these in place because of errors I was seeing in deploying a current ruby/rails app into the gf jruby container - which solved those issues.
>
> I don't see this until I deploy this app into place - which seems to be in getting activemessaging to work with jms, but I do still get the class missing exception below:
>
> [#|2010-03-29T15:02:09.940-0400|SEVERE|glassfishv3.0|grizzly|_ThreadID=18;_ThreadName=Thread-1;|doSelect exception
> java.lang.NoClassDefFoundError: javax/resource/spi/ResourceAdapter
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:698)
> at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
> at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
> at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
> ...
>
> I go into the felix console and start that specific bundle (in my case - [ 86] [Resolved ] [ 1] javax.resource API v.1.6-alpha (3.0.0.b74b)) - when I start this and restart the domain I see that it is active ([ 86] [Active ] [ 1] javax.resource API v.1.6-alpha (3.0.0.b74b)) - yet I still get the NoClassDefFoundError issue above.
>
> So I assume I need to have this available in the classpath somehow, but not really sure how to get around this roadblock.
>
> Thanks for your time.
>
> >
> > Thanks,
> > -Jagadish
> >
> > On Thu, 2010-03-25 at 07:08 -0700, Robert Weeks wrote:
> >> Hello -
> >>
> >> I am seeing some confusing behavior here wrt to a missing class:
> >>
> >> java.lang.ClassNotFoundException: javax.resource.spi.ResourceAdapter
> >>
> >> When trying to setup resource adapters for JMS brokers.
> >>
> >> I assumed this would be a part of the javaee.jar file - ($GF_HOME/lib/javaee.jar) - which in itself does not contain any of the classes.
> >>
> >> So I started looking into the modules and found 'javax.resource.jar' - which when looking at the osgi console was set to 'Resolved'. So I started it to see if it would help - which it seems it did - but still having problems setting up a reliable jms broker for this domain.
> >>
> >> Is anyone else seeing this issue when trying to set these up (not using the default domain 'domain1' by the way - using a newly created domain).
> >>
> >> Thanks for any insight.
>
>
> --
> Robert B. Weeks
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>