-
1. Re: JMS Client Connection Factory lookup failed
gaohoward Jan 3, 2012 10:28 PM (in response to ashutoshpandey.in)Did you try explicitly specify properties in the code and initialize the context using the InitialContext(Hashtable props) constructor?
-
2. Re: JMS Client Connection Factory lookup failed
ashutoshpandey.in Jan 4, 2012 12:48 AM (in response to gaohoward)Hey Yong, thanks for reply.
I created jndi.properties file but still I'm getting "Need to specify ...." error
I guess the name "ConnectionFactory" is either not found or should be written in some other way.
I've checked various tutorials on the net but none of them tell which jar file(s) i've to put in classpath.
-
3. Re: JMS Client Connection Factory lookup failed
jaikiran Jan 4, 2012 1:49 AM (in response to ashutoshpandey.in)Remote access to resources via JNDI (except for EJBs) isn't supported yet in AS7. Keep an eye on https://issues.jboss.org/browse/AS7-1338
-
4. Re: JMS Client Connection Factory lookup failed
peterfry Jan 4, 2012 2:45 PM (in response to jaikiran)I've just hit this issue too. It is a shame as I've battled through the transition to JBoss modules and finally managed to get JPA working in a way where the persistence unit is shared by both an EJB jar and 2 war files and of all things its messaging and remote JNDI look up of a ConnectionFactory that seems to be a show stopper.
I'm a bit new to HornetMQ but is there another/alternative documented way to get a queue connection / connection factory from a standalone client to HornetMQ as hosted by JBoss AS 7?
Looking at
https://issues.jboss.org/browse/AS7-1338
Things don't look too hopeful - this is a show stopper for the migration project I am working on.
Peter.
-
5. Re: JMS Client Connection Factory lookup failed
szhigunov Jan 4, 2012 6:03 PM (in response to peterfry)I am also watching this topic and asked the same question before: http://community.jboss.org/thread/173066?tstart=0
Right now you can use HornetQ API to connect remote JMS client to JBoss 7. Check HornetQ documentation.
Simple test code:
Queue queue = new HornetQQueue("testQueue"); Map<String, Object> connectionParams = new HashMap<String, Object>(); connectionParams.put(TransportConstants.HOST_PROP_NAME, "localhost"); connectionParams.put(TransportConstants.PORT_PROP_NAME, 5445); TransportConfiguration transportConfiguration = new TransportConfiguration( NettyConnectorFactory.class.getName(), connectionParams); ConnectionFactory cf = (ConnectionFactory) HornetQJMSClient.createConnectionFactoryWithoutHA( JMSFactoryType.CF, transportConfiguration); Connection connection connection = cf.createConnection();
...
I have a question about https://issues.jboss.org/browse/AS7-1338
I am not clear what it says about Queues and Topics? Will they be available in JNDI along with connection factory?
-
6. Re: JMS Client Connection Factory lookup failed
gaohoward Jan 4, 2012 9:38 PM (in response to szhigunov)Re:
I have a question about https://issues.jboss.org/browse/AS7-1338
I am not clear what it says about Queues and Topics? Will they be available in JNDI along with connection factory?
I think so.
When you use hornetq client API to connect directly, make sure you take care of reusing the connection/session etc.
Howard
-
7. Re: JMS Client Connection Factory lookup failed
peterfry Jan 12, 2012 10:01 AM (in response to szhigunov)Thanks for the information, everything seems to be working and existing wrapper API around JMS was already reusing connections/sessions which addresses Howard's point.
-
8. Re: JMS Client Connection Factory lookup failed
ktnagel Jan 13, 2012 11:10 AM (in response to szhigunov)Hi Sergey,
we will have the same thing to do soon.
I had the idea to build a session bean as a relay, and access that from the client.
Would that be an option?
Regards,
Thomas
-
9. Re: JMS Client Connection Factory lookup failed
szhigunov Jan 16, 2012 10:53 AM (in response to ktnagel)I think it is possible but using some wrapper around HornedQ API looks more straightforward to me. The other option is to wait for 7.1 final which is scheduled to come out early February. My understanding is that it will support all standard JNDI lookups for JMS.