weblogic.socket.UnrecoverableConnectException [英] weblogic.socket.UnrecoverableConnectException

查看:909
本文介绍了weblogic.socket.UnrecoverableConnectException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个部署在weblogic上的ejb。我能够通过一个简单的Java客户端成功获取远程引用。然而,当我通过我的Web应用程序打到ejb时,会抛出以下异常:

  javax.naming.CommunicationException [根异常是weblogic .socket.UnrecoverableConnectException:[由于未知原因登录失败:HTTP / 1.1 404未找到]] 
在weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:40)
在weblogic.jndi .WLInitialContextFactoryDe​​legate.toNamingException(WLInitialContextFactoryDe​​legate.java:783)
在weblogic.jndi.WLInitialContextFactoryDe​​legate.getInitialContext(WLInitialContextFactoryDe​​legate.java:367)
在weblogic.jndi.Environment.getContext(Environment.java:315)
在weblogic.jndi.Environment.getContext(Environment.java:285)
在weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
在javax.naming.spi.NamingManager。 getInitialContext(NamingManager.java:667)
在javax.naming.InitialContext.getDefaultInitCtx(Ini tialContext.java:288)
javax.naming.InitialContext.init(InitialContext.java:223)
javax.naming.InitialContext。< init>(InitialContext.java:197)

我不知道为什么协议是HTTP,我正在使用t3。这是我的代码:

 属性serverProperties = new Properties(); 
serverProperties.put(java.naming.provider.url,t3:// localhost:3080);
serverProperties.put(java.naming.factory.initial,weblogic.jndi.WLInitialContextFactory);

InitialContext context = new InitialContext(serverProperties);


解决方案

我怀疑你的weblogic监听地址是用你的服务器主机名。请参阅以下文章: http://docs.oracle.com/ cd / E17904_01 / web.1111 / e13709 / setup.htm



具体来说:



Localhost注意事项



如果将服务器实例的侦听地址标识为localhost,则非本地进程将无法连接到服务器实例。托管服务器实例的机器上的只有进程将能够连接到服务器实例。如果服务器实例必须作为本地主机可访问(例如,如果您具有连接到本地主机的管理脚本),并且还必须可由远程进程访问,请将侦听地址留空。服务器实例将确定机器的地址并收听。


I have an ejb deployed on weblogic. I am able to successfully get the remote reference via a simple java client. However when I hit the ejb via my web application it throws the below exception:

javax.naming.CommunicationException [Root exception is weblogic.socket.UnrecoverableConnectException: [Login failed for an unknown reason: HTTP/1.1 404 Not Found]]
    at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:40)
    at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:783)
    at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:367)
    at weblogic.jndi.Environment.getContext(Environment.java:315)
    at weblogic.jndi.Environment.getContext(Environment.java:285)
    at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
    at javax.naming.InitialContext.init(InitialContext.java:223)
    at javax.naming.InitialContext.<init>(InitialContext.java:197)

I am not sure why the protocol is HTTP, i am using t3. Here's my code:

Properties serverProperties = new Properties();
        serverProperties.put("java.naming.provider.url", "t3://localhost:3080");
        serverProperties.put("java.naming.factory.initial", "weblogic.jndi.WLInitialContextFactory");

        InitialContext context = new InitialContext(serverProperties);

解决方案

I suspect your weblogic listen address is configured with your server's hostname. See the following article: http://docs.oracle.com/cd/E17904_01/web.1111/e13709/setup.htm

Specifically it says:

Localhost Considerations

If you identify a server instance's listen address as localhost, non-local processes will not be able to connect to the server instance. Only processes on the machine that hosts the server instance will be able to connect to the server instance. If the server instance must be accessible as localhost (for instance, if you have administrative scripts that connect to localhost), and must also be accessible by remote processes, leave the listen address blank. The server instance will determine the address of the machine and listen on it.

这篇关于weblogic.socket.UnrecoverableConnectException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆