[jboss-user] [Messaging, JMS & JBossMQ] - Re: namenotfound exception in JMS Client
weston.price@jboss.com
do-not-reply at jboss.com
Fri Dec 8 17:43:15 EST 2006
Again, you cannot lookup a resource bound into JNDI in JBoss in a client outside of JBoss.
Change your code to
|
| Properties properties = new Properties();
| properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
| properties.put(Context.URL_PKG_PREFIXES, "org.jnp.interfaces");
| properties.put(Context.PROVIDER_URL, "localhost:3099");
| InitialContext ctx = new InitialContext(properties);
| ConnectionFactory cf = (ConnectionFactory)ctx.lookup("ConnectionFactory");
|
>From this factory you can create a connection and from there a session etc. Also, you will have to look up your destinations from JNDI as well.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992366#3992366
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3992366
More information about the jboss-user
mailing list