users@glassfish.java.net

RE: Upgrading from 3.1.1 -> 3.1.2 - weld/com.sun.messaging issues?

From: Robert Weeks <RWeeks_at_ext-inc.com>
Date: Thu, 19 Jan 2012 09:16:34 -0800

Hey Sahoo -

This is the same bundle I had talked about a few weeks ago - getting the com.sun.messaging information into our bundle to utilize the JMX resources we need to monitor the JMS destinations in our app (which are created from many different bundles).

I am not exporting any of this - I am including the jars and using Bundle-ClassPath to get these accesses (I did try to inline the classes using the classpath and PrivatePackage - but that was not helping at all - and caused more issues it seemed than doing this):

Include-Resource: conf=src/conf,META-INF/beans.xml=src/META-INF/beans.xml,lib=lib
Bundle-ClassPath: .,lib/imq.jar,lib/imqjmx.jar,lib/imqxm.jar

Now - I am importing quite a bit from here - including the com.sun.messaging stuff from above (albeit optional on some). Example:

  com.sun.messaging.jms.ra;resolution:=optional, \
  com.sun.messaging.jms.ra.util;resolution:=optional, \

Since they are needed for some of the above. We do @Inject a few things in some of our bundle classes (these are straight jar bundles btw - in autodeploy/bundles) - thus the need for beans.xml.

If I try and pull the imqjmsra jar out of the rar it comes out of (in glassfish/mq/lib) - and add it here - it adds a slew of other dependencies needed to claim.

Why is this ok/available the way it is in 3.1.1 and not now? Has something changed in the path that weld is given? I would think that imqjmsra would be available for that being in embedded mode. Is this not the case anymore?

Thanks for the response.



But the thing that is different here again is - this works fine in 3.1.1. But in 3.1.2 - no.



Robert Weeks
Lead Developer - Framework and UI
EXTENSION, INC.
Email: rweeks_at_ext-inc.com
Office: 260-797-0200 x4228
General: 877-207-3753
www.OpenTheRedBox.com

________________________________________
From: Sahoo [sanjeeb.sahoo_at_oracle.com]
Sent: Thursday, January 19, 2012 11:56 AM
To: users_at_glassfish.java.net
Cc: Robert Weeks; users_at_glassfish.dev.java.net
Subject: Re: Upgrading from 3.1.1 -> 3.1.2 - weld/com.sun.messaging issues?

Hi Robert,

Have you embedded imqjmsra.jar or some such imq library in your bundle?
What packages is your bundle exporting then? The fact that Weld is able
to load com.sun.messaging.jmq.jmsclient.JMSXAQueueSessionImpl, but not
its dependency like com.sun.messaging.jms.ra.ManagedConnection makes me
think that your bundle is perhaps exporting
com.sun.messaging.jmq.jmsclient package but not
com.sun.messaging.jms.ra. If this is not the correct guess, I am afraid
you have to give us a more concrete example to find out what's going on.

Thanks,
Sahoo
On Thursday 19 January 2012 08:54 PM, Robert Weeks wrote:
> Hello -
>
> I was just experimenting on getting our bundles/apps to run in the latest 3.1.2 - and saw an issue that first arose when we were trying to upgrade weld to 1.1.4 in GlassFish 3.1.1 to help another issue we were having.
>
> When deploying one of our apps there, came across an issue with weld and classloading of certain com.sun.messaging libraries - some of which come from imqjmsra it seems - but we didn't have this issue in 3.1.1 at all.
>
> Since seeing the same issue in 3.1.1 with the weld update - I am wondering if anyone else is seeing issues like this as well. Seems some of the jms embedded libs aren't available to weld/cdi anymore?
>
> The bundle in question does have ejb's in it (timer, mdb, singleton) as well as utilizes some of the imq libraries for JMX monitoring of remote destinations.
>
> Some of the issues we are seeing:
>
> [#|2012-01-19T10:03:10.591-0500|INFO|glassfish3.1.2|org.jboss.weld.ClassLoading|_ThreadID=18;_ThreadName=Thread-3;|WELD-000119 Not generating any bean definitions from com.sun.messaging.jmq.jmsclient.JMSXAQueueSessionImpl because of underlying class loading error|#]
>
> [#|2012-01-19T10:03:10.592-0500|INFO|glassfish3.1.2|org.jboss.weld.ClassLoading|_ThreadID=18;_ThreadName=Thread-3;|catching
> org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class com.sun.messaging.jmq.jmsclient.JMSXAQueueSessionImpl
> at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:152)
> at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:86)
> at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:115)
> at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:171)
> at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:336)
> ...
> Caused by: org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class com.sun.messaging.jmq.jmsclient.XAQueueSessionImpl
> at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:152)
> at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:139)
> ...
> Caused by: org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class com.sun.messaging.jmq.jmsclient.XASessionImpl
> at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:152)
> ...
> Caused by: org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class com.sun.messaging.jmq.jmsclient.UnifiedSessionImpl
> at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:152)
> at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:139)
> at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:118)
> Caused by: java.lang.NoClassDefFoundError: Lcom/sun/messaging/jms/ra/ManagedConnection;
> at java.lang.Class.getDeclaredFields0(Native Method)
> at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
> at java.lang.Class.getDeclaredFields(Class.java:1743)
> ...
>
> and so on.
>
> Thanks for any insight.