Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-10340

EJB over HTTP doesn't work for stateful beans

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Blocker
    • 7.1.0.DR18
    • 7.1.0.DR16, 7.1.0.DR17
    • EJB
    • None

    Description

      When looking up a stateful EJB instance over HTTP transport, it fails during session creation.
      When HTTP2 is enabled (<enable-http2 value="true"/>) then it fails with

      Exception in thread "main" javax.naming.CommunicationException: EJBCLIENT000062: Failed to look up "/server/HelloBeanStateful!ejb.HelloBeanRemote?stateful" [Root exception is java.util.concurrent.ExecutionException: java.nio.channels.ClosedChannelException]
      	at org.jboss.ejb.client.EJBRootContext.lookupNative(EJBRootContext.java:139)
      	at org.wildfly.naming.client.AbstractContext.lookup(AbstractContext.java:88)
      	at org.wildfly.naming.client.WildFlyRootContext.lookup(WildFlyRootContext.java:144)
      	at javax.naming.InitialContext.lookup(InitialContext.java:417)
      	at client.Client.main(Client.java:25)
      Caused by: java.util.concurrent.ExecutionException: java.nio.channels.ClosedChannelException
      	at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
      	at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895)
      	at org.wildfly.httpclient.ejb.HttpEJBReceiver.createSession(HttpEJBReceiver.java:155)
      	at org.jboss.ejb.client.EJBClientContext.lambda$createSession$3(EJBClientContext.java:678)
      	at org.jboss.ejb.client.EJBClientContext.performLocatedAction(EJBClientContext.java:704)
      	at org.jboss.ejb.client.EJBClientContext.createSession(EJBClientContext.java:679)
      	at org.jboss.ejb.client.EJBClient.createSession(EJBClient.java:287)
      	at org.jboss.ejb.client.EJBRootContext.lookupNative(EJBRootContext.java:137)
      	... 4 more
      Caused by: java.nio.channels.ClosedChannelException
      	at io.undertow.client.http2.Http2ClientConnection.close(Http2ClientConnection.java:315)
      	at io.undertow.client.http.HttpClientConnection.close(HttpClientConnection.java:452)
      	at org.xnio.IoUtils.safeClose(IoUtils.java:152)
      	at org.wildfly.httpclient.common.HttpConnectionPool$ClientConnectionHolder.done(HttpConnectionPool.java:291)
      	at org.wildfly.httpclient.common.HttpTargetContext$1$1.failed(HttpTargetContext.java:274)
      	at io.undertow.client.http2.Http2ClientExchange.failed(Http2ClientExchange.java:125)
      	at io.undertow.client.http2.Http2ClientConnection.close(Http2ClientConnection.java:315)
      	at org.xnio.IoUtils.safeClose(IoUtils.java:152)
      	at io.undertow.client.http2.Http2ClientConnection$Http2ReceiveListener.handleEvent(Http2ClientConnection.java:459)
      	at io.undertow.client.http2.Http2ClientConnection$Http2ReceiveListener.handleEvent(Http2ClientConnection.java:366)
      	at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
      	at io.undertow.server.protocol.framed.AbstractFramedChannel$FrameReadListener.handleEvent(AbstractFramedChannel.java:931)
      	at io.undertow.server.protocol.framed.AbstractFramedChannel$FrameReadListener.handleEvent(AbstractFramedChannel.java:912)
      	at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
      	at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)
      	at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:89)
      	at org.xnio.nio.WorkerThread.run(WorkerThread.java:569)
      

      when HTTP2 is disabled, the client just hangs without throwing any error message, and this shows in the log of the server which is being invoked:

      13:58:13,668 ERROR [stderr] (default task-10) Exception in thread "default task-10" java.lang.NullPointerException
      13:58:13,668 ERROR [stderr] (default task-10) 	at org.jboss.as.ejb3.remote.AssociationImpl.execute(AssociationImpl.java:229)
      13:58:13,668 ERROR [stderr] (default task-10) 	at org.jboss.as.ejb3.remote.AssociationImpl.receiveSessionOpenRequest(AssociationImpl.java:272)
      13:58:13,668 ERROR [stderr] (default task-10) 	at org.wildfly.httpclient.ejb.HttpSessionOpenHandler.lambda$handleInternal$0(HttpSessionOpenHandler.java:133)
      13:58:13,669 ERROR [stderr] (default task-10) 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      13:58:13,669 ERROR [stderr] (default task-10) 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      13:58:13,669 ERROR [stderr] (default task-10) 	at java.lang.Thread.run(Thread.java:745)
      

      Attachments

        Issue Links

          Activity

            People

              sdouglas1@redhat.com Stuart Douglas
              jmartisk@redhat.com Jan Martiska
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: