Topic: 为什么不能在JBOSS中LOOKUP到ConnectionFactory呢

  Print this page

1.为什么不能在JBOSS中LOOKUP到ConnectionFactory呢 Copy to clipboard
Posted by: horry
Posted on: 2004-05-31 06:35

在JBOSS 3.2.1中
程序是这样子的
private InitialContext getContext() throws NamingException {
Hashtable props = new Hashtable();
props.put(
InitialContext.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
props.put(InitialContext.PROVIDER_URL, "jnp://127.0.0.1:1099");

InitialContext initialContext = new InitialContext(props);
return initialContext;
}
然后在MAIN中
try {
System.out.println("Looking up the factory ");

InitialContext ctx = getContext();

QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup("ConnectionFactory");
这时出错,说得不到ConnectionFactory
为什么呢?
请哪位高人指点一二谢谢!


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923