java.io.IOException: Connection reset by peer wildfly 10

1

I am trying to do remote ejb lookup in wildfly 10 server. Below is the code for lookup.

    private static Object lookup() throws Exception {
                Properties  properties = new Properties();
                properties.put("java.naming.factory.url.pkgs",
                  "org.jboss.ejb.client.naming");
                properties.put("jboss.naming.client.ejb.context",
                  "false");
                properties.put("org.jboss.ejb.client.scoped.context", "true");
                properties.put("endpoint.name", "client-endpoint");

                properties.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED","false");
                properties.put("remote.connections", "default");
                properties.put("remote.connection.default.host", "192.168.1.13");
                properties.put("remote.connection.default.port", "36430");
                properties.put("remote.connection.default.username", "username");
                properties.put("remote.connection.default.password", "pwd");
                properties.put("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", "false");
                properties.put("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");
                properties.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", "false");
                properties.put("remote.connectionprovider.create.options.org.jboss.remoting3.RemotingOptions.MAX_OUTBOUND_MESSAGES", "0x7fffffff");
                properties.put("remote.connectionprovider.create.options.org.jboss.remoting3.RemotingOptions.MAX_INBOUND_MESSAGES", "0x7fffffff");
       InitialContext   ctx = new InitialContext(properties);

       Object obj = (WorkFlowExternalFacade) ctx.lookup("ejb:cwapp/cwebl/WorkFlowExternalFacade!com.xxx.xxx.WorkFlowExternalFacadeRemote);
   System.out.println("Lookup Success:"+obj)

       obj.findAll();

}

The above code is working fine when I change the IP and Port to my local wildfly which is running on 9080 port i.e..

properties.put("remote.connection.default.host", "127.0.0.1"); properties.put("remote.connection.default.port", "9080");

I try to execute the code for remote lookup which wildfly is running in some other machine(192.168.1.13:36430) I am getting below exception..

java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:197)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:380)
at org.xnio.nio.NioSocketConduit.read(NioSocketConduit.java:289)
at org.xnio.conduits.ConduitStreamSourceChannel.read(ConduitStreamSourceChannel.java:127)
at org.xnio.http.HttpUpgrade$HttpUpgradeState$UpgradeResultListener.handleEvent(HttpUpgrade.java:410)
at org.xnio.http.HttpUpgrade$HttpUpgradeState.flushUpgradeChannel(HttpUpgrade.java:369)
at org.xnio.http.HttpUpgrade$HttpUpgradeState.access$900(HttpUpgrade.java:165)
at org.xnio.http.HttpUpgrade$HttpUpgradeState$ConnectionOpenListener.handleEvent(HttpUpgrade.java:340)
at org.xnio.http.HttpUpgrade$HttpUpgradeState$ConnectionOpenListener.handleEvent(HttpUpgrade.java:320)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
at org.xnio.nio.WorkerThread$ConnectHandle.handleReady(WorkerThread.java:326)
at org.xnio.nio.WorkerThread.run(WorkerThread.java:567)
at ...asynchronous invocation...(Unknown Source)
at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:294)
at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:430)
at org.jboss.ejb.client.remoting.EndpointPool$PooledEndpoint.connect(EndpointPool.java:192)
at org.jboss.ejb.client.remoting.NetworkUtil.connect(NetworkUtil.java:153)
at org.jboss.ejb.client.remoting.NetworkUtil.connect(NetworkUtil.java:133)
at org.jboss.ejb.client.remoting.ConnectionPool.getConnection(ConnectionPool.java:78)
at org.jboss.ejb.client.remoting.RemotingConnectionManager.getConnection(RemotingConnectionManager.java:51)
at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.setupEJBReceivers(ConfigBasedEJBClientContextSelector.java:161)
at org.jboss.ejb.client.remoting.ConfigBasedEJBClientContextSelector.getCurrent(ConfigBasedEJBClientContextSelector.java:118)
at org.jboss.ejb.client.naming.ejb.EjbNamingContext.createIdentifiableEjbClientContext(EjbNamingContext.java:269)
at org.jboss.ejb.client.naming.ejb.EjbNamingContext.setupScopedEjbClientContextIfNeeded(EjbNamingContext.java:134)
at org.jboss.ejb.client.naming.ejb.EjbNamingContext.<init>(EjbNamingContext.java:101)
at org.jboss.ejb.client.naming.ejb.ejbURLContextFactory.getObjectInstance(ejbURLContextFactory.java:38)
at javax.naming.spi.NamingManager.getURLObject(NamingManager.java:601)
at javax.naming.spi.NamingManager.getURLContext(NamingManager.java:550)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:345)
at javax.naming.InitialContext.lookup(InitialContext.java:417)

The above exception is coming at ctx.lookup(..) but I am getting proxy object, I tried to print for proxy object

Lookup Success: Proxy for remote EJB StatelessEJBLocator for "xx/xx/WorkFlowExternalFacade", view is interface com.xxx.xxx.xxx.WorkFlowExternalFacadeRemote, affinity is None

but when I try to call the API with the object obj.findAll() I am getting the below exception

java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:cwapp, moduleName:cwebl, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@37918c79
at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:798)
at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:128)
at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:186)
at org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:255)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:200)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:183)
at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:146)
at com.sun.proxy.$Proxy2.findAll(Unknown Source)

Can anyone help me how to fix the above issue?

java
jboss
ejb
wildfly
asked on Stack Overflow Mar 31, 2018 by subbu royal

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0