-
1. Re: Using Tomcat with HornetQ
khanna111 May 1, 2010 7:51 PM (in response to khanna111)Been reading the documentation and these are the details on the progress so far:
1. Tried using the Embedded JMS Server Example and that led to "NamingException - Context is read only"
javax.naming.NamingException: Context is read only
at org.apache.naming.NamingContext.checkWritable(NamingContext.java:903)
at org.apache.naming.NamingContext.bind(NamingContext.java:831)
at org.apache.naming.NamingContext.rebind(NamingContext.java:208)
at org.apache.naming.NamingContext.rebind(NamingContext.java:223)
at org.jnp.server.NamingBeanImpl.start(NamingBeanImpl.java:184)
at src.s1.init(s1.java:84)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:637)Is there a tomcat-how-to for running this example (perhaps with the jms resource declarations for tomcat) ?
Is there another way around?
Thanks
Gaurav
-
2. Re: Using Tomcat with HornetQ
timfox May 2, 2010 6:18 AM (in response to khanna111)The exception is pretty clear: the context you're passing in when creating the jms server is read only. This is not part of HornetQ (it's an Apache class)
It will need to be read-write if you want HornetQ to load JMS destinations and connection factories into it.
You need to use a proper JNDI implementation that allows you to bind objects into it, or disable JNDI.
-
3. Re: Using Tomcat with HornetQ
timfox May 2, 2010 6:28 AM (in response to timfox)You can use the JBoss JNDI implementation if you like (see the embedded JMS example). Probably you have a jndi.properties on your classpath that is pointing to the Apache implementation instead.
-
4. Re: Using Tomcat with HornetQ
khanna111 May 2, 2010 7:58 PM (in response to timfox)Thank you Tim. I'll look for it later since I have moved on to not using JNDI for the prototype.
I have another questions on clustering that I will post as a separate thread.
Thanks
Gaurav
-
5. Re: Using Tomcat with HornetQ
azarny Aug 25, 2010 5:25 AM (in response to khanna111)It can be done with some limitations. See http://wash-inside-out.blogspot.com/2010/08/hornetq-jms-integration-with-tomcat.html for more details.
Cheers, Igor