Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

can I use a servlet as JMS client?

4 views
Skip to first unread message

ann

unread,
Sep 27, 2001, 5:31:24 PM9/27/01
to

I use servlet as JMS client, send msg to JMS server (Weblogic Server6.1), and
get return msg, it works fine in one machine, but when I run servlet in WLS1(6.1),
and set up JMS server in another machine WLS2(6.1), it can not work.
I write a main program, connect to remote JMS server, it connect correctly,
but same code in servlet can not work, I got following err, do I need to do some
config in web.xml or weblogic.xml?

thanks in advance
ann

src code:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL, "t3://10.1.1.7:7001");

ctx = new InitialContext(env);

queueConnectionFactory = (QueueConnectionFactory)
ctx.lookup("javax.jms.QueueConnectionFactory");

queueConnection = queueConnectionFactory.createQueueConnection();

queueSession = queueConnection.createQueueSession(false,
Session.AUTO_ACKNOWLEDGE);

error when execute queueConnection.createQueueSession:

weblogic.jms.common.JMSException: Connection not found
at weblogic.jms.dispatcher.InvocableManager.invocableFind(InvocableManag
er.java:121)
at weblogic.jms.dispatcher.Request.wrappedFiniteStateMachine(Request.jav
a:503)
at weblogic.jms.dispatcher.DispatcherImpl.dispatchSync(DispatcherImpl.ja
va:272)
at weblogic.jms.client.JMSConnection.sessionCreate(JMSConnection.java:26
1)
at weblogic.jms.client.JMSConnection.createQueueSession(JMSConnection.ja
va:228)
at EjbXml_webApp.myServlet.initJMS(myServlet.java:168)
at EjbXml_webApp.myServlet.doGet(myServlet.java:79)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:263)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:2390)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:1959)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)


0 new messages