Wanna Know All
Wanna Know All

Reputation: 693

Consume WebLogic (t3) JMS from Tomcat

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

Answers (1)

Wanna Know All
Wanna Know All

Reputation: 693

OK, here's what's happening:

There are 3 ways to consume WebLogic JMS:

  1. "Full", i.e. running client under fully-blown WebLogic, or using wlfullclient.jar. This is what was working for me before, but that won't work when running under Tomcat
  2. "IIOP" tunneling client, wlclient.jar + wljmsclient.jar, which is what I've been doing here and this is what wasn't working (likely due to firewall/server-config issues around IIOP protocol tunneling).
  3. "T3 thin" client, i.e. running using wlthint3client.jar, which is what I eventually started using and it's working just fine.

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

Related Questions