RAR Looking up problem
mradhika Dec 17, 2004 8:49 AMI have deployed a rar for proprietory JMS implementation in Jboss4.0.1RC2. I have my -ds.xml as follows
<connection-factories> <tx-connection-factory> <jndi-name>stcms/QueueConnectionFactory</jndi-name> <xa-transaction/> <track-connection-by-tx/> <rar-name>rastcms.rar</rar-name> <connection-definition>javax.jms.QueueConnectionFactory</connection-definition> <security-domain-and-application>JmsXARealm</security-domain-and-application> </tx-connection-factory> <tx-connection-factory> <jndi-name>stcms/TopicConnectionFactory</jndi-name> <xa-transaction/> <track-connection-by-tx/> <rar-name>rastcms.rar</rar-name> <connection-definition>javax.jms.TopicConnectionFactory</connection-definition> <security-domain-and-application>JmsXARealm</security-domain-and-application> </tx-connection-factory> </connection-factories>
After deploying the rar I have got the server log
18:50:10,795 INFO [ConnectionFactoryBindingService] Bound connection factory for resource adapter for Connect
ionManager 'jboss.jca:name=stcms/QueueConnectionFactory,service=ConnectionFactoryBinding to JNDI name 'java:stcms/QueueConnectionFactory'
18:50:10,815 INFO [ConnectionFactoryBindingService] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:name=stcms/TopicConnectionFactory,service=ConnectionFactoryBinding to JNDI name 'java:stcms/TopicConnectionFactory'
But when I have tried to test with a sample program
java.util.Hashtable env = new java.util.Hashtable(); env.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory"); env.put(javax.naming.Context.PROVIDER_URL,"jnp://localhost:1099"); env.put(javax.naming.Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces"); InitialContext iniCtx = new InitialContext(env); Object tmp = iniCtx.lookup("stcms/QueueConnectionFactory"); QueueConnectionFactory qcf = (QueueConnectionFactory) tmp; conn = qcf.createQueueConnection(); que = (Queue) iniCtx.lookup("testQueue"); session = conn.createQueueSession(false,QueueSession.AUTO_ACKNOWLEDGE); conn.start();
its giving the following error
Begin sendRecvAsync
Exception in thread "main" javax.naming.NameNotFoundException: stcms not bound at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)
at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
at org.jnp.server.NamingServer.lookup(NamingServer.java:249)
I have tried with other options looking up java:/stcms/QueueConnectionFactory also despite that its giving the same exception.