Reputation: 693
I’m trying to run a sample JMS consumer code under Tomcat 7, which consumes JMS queue running on a remote WebLogic 12. To do so, I’m using the “WebLogic thin client” approach (added wlclient.jar, wljmsclient.jar to my classpath).
Here’s the code snippet:
Hashtable ht = new Hashtable();
ht.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL, "t3://testjmsserver:8710");
Context cx = new InitialContext(ht);
ConnectionFactory cf = (ConnectionFactory)cx.lookup("jms/TestFactory");
Connection connection = cf.createConnection();
When I’m running it – the discover works fine, but cf.createConnection() call is stuck for a minute, then it throws exception (see full exception dump below).
Note that running the same code under fully-blown WebLogic instead of Tomcat – works just fine.
What am I doing wrong? How can I find the root cause of the exception I’m getting?
Thanks.
Upvotes: 2
Views: 5333
Reputation: 693
OK, here's what's happening:
There are 3 ways to consume WebLogic JMS:
I'm really surprised that option #3 is not the default one (and even maybe the only one available), especially considering the fact that Oracle docs say that #3 is the fastest and the best one (e.g. here: http://docs.oracle.com/cd/E17904_01/web.1111/e13717/wlthint3client.htm)
So the bottom line is - if you want to run WebLogic JMS consumer under Tomcat, simply use wlthint3client.jar from the WebLogic "server/lib" folder.
Upvotes: 2