weblogic.socket.UnrecoverableConnectException

醉酒当歌 提交于 2019-12-24 14:24:27

问题


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);

回答1:


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.



来源:https://stackoverflow.com/questions/18566225/weblogic-socket-unrecoverableconnectexception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!