-
1. Re: Tomcat and JBoss messaging
ataylor Feb 14, 2008 3:49 AM (in response to jaya_srini)Instead of doing this:
mLog.info("Looking up environment context"); Context envCtx = (Context) ic.lookup("java:comp/env"); mLog.info("Looking up Connection factory"); ConnectionFactory cf = (ConnectionFactory)envCtx.lookup("/ConnectionFactory");
Can you not just look up the connection factory directly i.e.mLog.info("Looking up Connection factory"); ConnectionFactory cf = (ConnectionFactory)iclookup("/ConnectionFactory");
-
2. Re: Tomcat and JBoss messaging
jaya_srini Feb 14, 2008 11:47 AM (in response to jaya_srini)Thanks for the reply, Andy!
I tried that as well but then I get a ServletException when it's trying to look up teh conenction factory
2008-02-13 14:42:16,046 [http-8000-1] ERROR org.apache.catalina.core.ContainerBase.[Standalone].[localhost].[/allocationmessaging].[AllocationMessaging] - Servlet.service() for servlet AllocationMessaging threw exception
javax.servlet.ServletException: Servlet execution threw an exception
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:313)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at com.disney.tomcat.GreenCookieValve.invoke(Unknown Source)
at com.disney.tomcat.RequestThrottleValve.invoke(Unknown Source)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
at org.apache.coyote.http11.Http11NioProcessor.process(Http11NioProcessor.java:888)
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:624)
at org.apache.tomcat.util.net.NioEndpoint$Worker.run(NioEndpoint.java:1465)
at java.lang.Thread.run(Thread.java:619)
Couple of questions...
1) Does tomcat support external JNDI calls? My tomcat app and the JBOSS App server are on the same machine but they are separate services.
2) If it does then just modifying the initial context to point to JBOSS JNDI should be sufficient, correct (the way I am doing in the code posted earlier)? I should need to modify the server.xml or web.xml on the tomcat side, right?
I am sorry if the questions are too trivial :(. I am a newbie with JBoss messaging.
Any input/ideas appreciated!
thank you
jaya -
3. Re: Tomcat and JBoss messaging
jaya_srini Feb 14, 2008 11:51 AM (in response to jaya_srini)Sorry...I meant to ask in my earlier post do I need to modify the server.xml and web.xml to get tomcat to refer to JBoss JNDI resource? I thought the resources specified in those files apply to Tomcat's local JNDI and for any external JNDI access, just modifying the InitialContext should be sufficient.
Please correct me if the above is not true.
jaya -
4. Re: Tomcat and JBoss messaging
timfox Feb 17, 2008 3:06 PM (in response to jaya_srini)Just use the standard JCA JMS resource adaptor - this is available in the same VM:
http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossJMSRA -
5. Re: Tomcat and JBoss messaging
timfox Feb 17, 2008 3:08 PM (in response to jaya_srini)I'm assuming you're trying to access JBM from a Servlet being running with the version of JBoss Web that comes bundled with JBoss AS.
If you're not using that, I'd ask why you don't just use that!