-
1. Re: Sending Messages to a Weblogic Queue
sfcoy Dec 20, 2012 8:04 PM (in response to cwalker67)I expect that you need to get rid of all of the javax.* classes from your wlfullclient.jar.
-
2. Re: Sending Messages to a Weblogic Queue
nickarls Dec 21, 2012 2:19 AM (in response to sfcoy)Are there any lighter jars (e.g. weblogic.jar) that could be used?
-
3. Re: Sending Messages to a Weblogic Queue
sfcoy Dec 21, 2012 2:30 AM (in response to nickarls)The weblogic.jar from around 9g onward contains manifest classpath entries that are a minefield of backwardly relative paths (../../../modules/...).
-
4. Re: Sending Messages to a Weblogic Queue
cwalker67 Dec 21, 2012 7:25 AM (in response to sfcoy)I had also thought that might work but when I removed the javax.* classes from the wlfullclient.jar file, I started getting "ClassNotFound" exceptions.
-
5. Re: Sending Messages to a Weblogic Queue
sfcoy Dec 21, 2012 5:15 PM (in response to cwalker67)Can you share the details? You may need more module dependencies.
-
6. Re: Sending Messages to a Weblogic Queue
cwalker67 Jan 3, 2013 1:21 PM (in response to sfcoy)Using the wlfullclient.jar file, when executing this line
{code} QueueConnectionFactory qcf = (QueueConnectionFactory)ctx.lookup("/ecologic/jms/ConnectionFactory"); {code}
I get the exception:
{code}java.lang.ClassCastException: weblogic.jms.client.JMSConnectionFactory cannot be cast to javax.jms.QueueConnectionFactory{code}
So I modified the code to use the weblogic specific class as such:
{code}
weblogic.jms.client.JMSConnectionFactory qcf = (weblogic.jms.client.JMSConnectionFactory)ctx.lookup("/ecologic/jms/ConnectionFactory");
QueueConnection qc = qcf.createQueueConnection();
{code}
and got the following exception on the "createQueueConnection()" call:
{code}
java.lang.LinkageError: loader constraint violation: when resolving method "weblogic.jms.client.JMSConnectionFactory.createQueueConnection()Ljavax/jms/QueueConnection;" the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, com/ge/dm/services/ea/cim/CimRequestTrigger, and the class loader (instance of org/jboss/modules/ModuleClassLoader) for resolved class, weblogic/jms/client/JMSConnectionFactory, have different Class objects for the type javax/jms/QueueConnection used in the signature
{code}
Removing the "javax.*" code from the wlfullclient.jar file got me a:
{code}java.lang.NoClassDefFoundError: javax/transaction/SystemException{code}
when just trying to get the initialContext.
-
7. Re: Sending Messages to a Weblogic Queue
rodakr Jan 3, 2013 4:06 PM (in response to cwalker67)use wlthinclient.jar
-
8. Re: Sending Messages to a Weblogic Queue
cwalker67 Jan 4, 2013 4:30 PM (in response to rodakr)using "wlthinclient.jar" results in the same exceptions.
-
9. Re: Sending Messages to a Weblogic Queue
rodakr Jan 4, 2013 6:44 PM (in response to cwalker67)you have to exclude in modul.xml all javax.xxxx from wlthin client
and define the modul global in standalone.xml. With only weblogic packages it should be fine.
-
10. Re: Sending Messages to a Weblogic Queue
cwalker67 Jan 6, 2013 10:15 AM (in response to rodakr)First- Thanks for your help!
I've modified the module.xml to look like this:
{code:xml}<module xmlns="urn:jboss:module:1.0" name="wlthinclient">
<exports>
<exclude path="javax/*"/>
</exports>
<resources>
<resource-root path="wlthint3client.jar" />
</resources>
<dependencies>
<module name="org.omg.api" />
<module name="javax.api" />
<module name="sun.jdk" />
</dependencies>
</module>{code}
That gets me further along but i still get an exception unless I use the weblogic specific classes.
I still can't cast a "weblogic.jms.client.JMSConnectionFactory" to a "javax.jms.ConnectionFactory". I also get an exception when looking up the queue:
{code}Queue queue = (Queue)ctx.lookup("/ecologic/jms/OnDemandRequest");{code}
returns the exception
{code}weblogic.jms.common.DestinationImpl cannot be cast to javax.jms.Queue{code}
Adding the exclude to the module.xml did help. the following now works:
{code}weblogic.jms.client.JMSConnectionFactory qcf = (weblogic.jms.client.JMSConnectionFactory)ctx.lookup("/ecologic/jms/ConnectionFactory");
Connection qc = qcf.createConnection();{code}
where it didn't before. It still appears I'm missing something having to use the weblogic specific classes.
-
11. Re: Sending Messages to a Weblogic Queue
rodakr Jan 7, 2013 5:54 AM (in response to cwalker67)In your source code you should just use standad JMS API, you don't need to use internal weblogic packages. Only weblogic connection factory is needed if you want to use t3.
With this modu definition it woks for me:
<module xmlns="urn:jboss:module:1.1" name="com.weblogic.wlthint3client">
<resources>
<resource-root path="wlthint3client.jar">
<filter>
<exclude-set>
<path name="javax.ejb"/>
<path name="javax.ejb.spi"/>
<path name="javax.transaction"/>
<path name="javax.jms"/>
<path name="javax.xml"/>
<path name="javax.xml.stream"/>
</exclude-set>
</filter>
</resource-root>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="sun.jdk" export="false" services="import">
<exports>
<include-set>
<path name="sun/security/acl"/>
<path name="META-INF/services"/>
</include-set>
</exports>
</module>
<module name="com.sun.xml.bind" />
<module name="org.omg.api"/>
<module name="javax.ejb.api" export="false" />
<module name="javax.transaction.api" export="false" />
<module name="javax.jms.api" export="false" />
<module name="javax.xml.stream.api" export="false" />
<module name="org.picketbox" optional="true"/>
<module name="javax.servlet.api" optional="true"/>
<module name="org.jboss.logging" optional="true"/>
<module name="org.jboss.as.web" optional="true"/>
<module name="org.jboss.as.ejb3" optional="true"/>
</dependencies>
</module>
Just make shure , yours ear wars doesn't contains any weblogic libraries like weblogic.jar or wlthint3client.jar, when you define wls client as modul.
-
12. Re: Sending Messages to a Weblogic Queue
cwalker67 Jan 7, 2013 9:12 AM (in response to rodakr)That did the trick. I had to use the "wlfullclient.jar" though. Without it, on errors, I got marshalling exceptions for a couple of the weblogic exception classes.
Thanks for all your help!!
-
13. Re: Sending Messages to a Weblogic Queue
rodakr Jan 7, 2013 12:12 PM (in response to cwalker67)I started with wlfullclient.jar from WLS 10.3.5 and later by more testing I run in troubles with packages collisions... so depends what your application is doing, it might work or not with wlfullcient.jar.
wlthint3client.jar was designed by bea weblogic to work also in foreign Application Servers. This is even oficially supported.
And wltint3client is also official Weblogic Client for JMS! You shouldn't have Problems with any internal Weblogic Classes, if you Code According to JMS Standard API.
-
14. Re: Sending Messages to a Weblogic Queue
aniruthmp Dec 11, 2014 3:09 PM (in response to cwalker67)Hello Radek,
You just resolved my issue with Wildfly to Weblogic12c (on jdk1.8). I was trying to resolve this for the past 2 days and finally was able to do it. My sincere thanks to you.
Ani