請教各位大蝦:在JBoss下使用JMS通訊機制遇到的問題

Chocoo發表於2006-12-30
Hashtable props = new Hashtable();
props.putContext.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
props.put(Context.PROVIDER_URL, "localhost:11099");
props.put("java.naming.rmi.security.manager", "yes");
props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming");
jndiContext = new InitialContext();
queueConnectionFactory = (QueueConnectionFactory) jndiContext.lookup"ConnectionFactory");
queue = (Queue) jndiContext.lookup("queue/testQueue");

但是遇到問題了:
JNDI lookup failed: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial

求救。。。。。。。。。。。。

非常感謝!!!!

相關文章