×

Loading...
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。

用weblogic来实现jms,接收程序和发送程序都位于weblogic同一服务器上,运行出错:javax.naming.CommunicationException. Root exception is weblogic.socket.Unrecove rableConnectException: [Login failed for an unknown reason:]

本文发表在 rolia.net 枫下论坛看来出错在getInitialContext()这个method,代码如下:

private static InitialContext getInitialContext()
throws NamingException{
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL, "t3://localhost:80");
env.put(Context.SECURITY_PRINCIPAL,"weblogic");//user
env.put(Context.SECURITY_CREDENTIALS,"weblogic");//pwd
env.put("weblogic.jndi.createIntermediateContexts", "true");

return new InitialContext(env);
}
请教什么原因呢?THX !!

错误如下:
...
Exception in thread "main" javax.naming.CommunicationException. Root exception
is weblogic.socket.UnrecoverableConnectException: [Login failed for an unknown r
eason:]
at weblogic.socket.Login.checkLoginSuccess(Login.java:126)
at weblogic.rjvm.t3.T3JVMConnection.connect(T3JVMConnection.java:287)
at weblogic.rjvm.t3.T3JVMConnection.createConnection(T3JVMConnection.jav
a:311)
at weblogic.rjvm.ConnectionManager.createConnection(ConnectionManager.ja
va:1766)
at weblogic.rjvm.ConnectionManager.findOrCreateConnection(ConnectionMana
ger.java:1293)
at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:430)

at weblogic.rjvm.ConnectionManager.bootstrap(ConnectionManager.java:312)

at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(RJVMManager.java
:223)
at weblogic.rjvm.RJVMManager.findOrCreate(RJVMManager.java:181)
at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(RJVMFinder.java:222
)
at weblogic.rjvm.RJVMFinder.findOrCreateRemoteCluster(RJVMFinder.java:28
1)
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:191)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:125)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:296)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLIni
tialContextFactoryDelegate.java:239)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialCont
extFactory.java:135)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:6
62)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243
)
at javax.naming.InitialContext.init(InitialContext.java:219)
at javax.naming.InitialContext.<init>(InitialContext.java:195)
at com.jmssample.QueueSend.getInitialContext(QueueSend.java:115)
at com.jmssample.QueueSend.main(QueueSend.java:83)更多精彩文章及讨论,请光临枫下论坛 rolia.net
Report