tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Steen <ad...@rmt.com.au>
Subject ConnectionFailed{uri=ejbd://localhost:4201 cause=java.io.IOException: Cannot connect to server: 'ejbd://localhost:4201'
Date Fri, 04 Oct 2013 08:55:49 GMT
Hi

I am trying to look up an ejb running on another app located on the same tomee instance.

My code is attached below, but I am getting the Exception as perth the trace at the bottom
of my email, I am not sure where to go from here, my current investigation have been fruitless.

The code works for looking up local beans using the "LocalInitialContextFactory" for the webapp
with the ejbs, but I am unable to lookup ejbs from my other webapp. (I am unable to deploy
as a single app, as this would be the easiest solution.

Any help would be appreciated.

Cheers
Adam

try {
    env = new Properties();
    env.setProperty("java.naming.factory.initial", "org.apache.openejb.client.RemoteInitialContextFactory");
    env.setProperty("java.naming.provider.url", "ejbd://localhost:4201");
    InitialContext context = new InitialContext(env);

    String jndiName = name + "RemoteHome";
    
    Object objref = context.lookup(jndiName);
    
    context.close();
    
    Object narrowed = PortableRemoteObject.narrow(objref, clazz);

    return narrowed;
} catch (Exception e) {
    e.printStackTrace();
    e.print
};

javax.naming.NamingException: Cannot lookup '/EngineRemoteHome'. [Root exception is java.rmi.RemoteException:
Unable to connect; nested exception is:
        java.io.IOException: Cannot connect to server: 'ejbd://localhost:4201'.  Exception:
java.net.SocketTimeoutException : connect timed out]
        at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:235)
        at javax.naming.InitialContext.lookup(InitialContext.java:411)
        at au.com.rmt.util.persistence.FPServiceLocator.getBlah(FPServiceLocator.java:54)
        at au.com.rmt.flex.SQLEngine.runSQL(SQLEngine.java:264)
        at au.com.rmt.flex.SQLEngine.execInternal(SQLEngine.java:294)
        at au.com.rmt.flex.SQLEngine.exec(SQLEngine.java:367)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:421)
        at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183)
        at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1503)
        at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:884)
        at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:121)
        at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
        at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44)
        at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
        at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:146)
        at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:278)
        at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:322)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at au.com.rmt.web.filter.SessionCheckFilter.doFilter(SessionCheckFilter.java:30)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
        at org.apache.tomee.catalina.OpenEJBValve.invoke(OpenEJBValve.java:45)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
        at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:314)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:722)
Caused by: java.rmi.RemoteException: Unable to connect; nested exception is:
        java.io.IOException: Cannot connect to server: 'ejbd://localhost:4201'.  Exception:
java.net.SocketTimeoutException : connect timed out
        at org.apache.openejb.client.Client.processRequest(Client.java:139)
        at org.apache.openejb.client.Client.request(Client.java:116)
        at org.apache.openejb.client.JNDIContext.request(JNDIContext.java:71)
        at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:229)
        ... 42 more
Caused by: java.io.IOException: Cannot connect to server: 'ejbd://localhost:4201'.  Exception:
java.net.SocketTimeoutException : connect timed out
        at org.apache.openejb.client.SocketConnectionFactory$SocketConnection.failure(SocketConnectionFactory.java:311)
        at org.apache.openejb.client.SocketConnectionFactory$SocketConnection.open(SocketConnectionFactory.java:298)
        at org.apache.openejb.client.SocketConnectionFactory.getConnection(SocketConnectionFactory.java:152)
        at org.apache.openejb.client.ConnectionManager.getConnection(ConnectionManager.java:103)
        at org.apache.openejb.client.AbstractConnectionStrategy.connect(AbstractConnectionStrategy.java:87)
        at org.apache.openejb.client.AbstractConnectionStrategy.connect(AbstractConnectionStrategy.java:68)
        at org.apache.openejb.client.ConnectionManager.getConnection(ConnectionManager.java:81)
        at org.apache.openejb.client.Client.processRequest(Client.java:137)
        ... 45 more
Caused by: java.net.SocketTimeoutException: connect timed out
        at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
        at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:75)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
        at java.net.Socket.connect(Socket.java:579)
        at org.apache.openejb.client.SocketConnectionFactory$SocketConnection.open(SocketConnectionFactory.java:290)
        ... 51 more

Mime
View raw message