10 Replies Latest reply on Feb 7, 2014 3:55 AM by sjankus

    No EJB receiver available after several successful connections

    sjankus

      Hello,

       

      we are currently migrating an Application (Swing-Client + JBoss) from JBoss 4.2.3 to JBoss EAP 6.2.


      Our Client is reading a large XML-File (SAX-Parser) and after finishing of reading each branch of the XML-tree, we send the data to the server. I'm creating a new JNDI-Context for each connection. This works fine for a while and you can see many successful transactions in the log-file ("[...] erfolgreich importiert"). But after sending some hundred datasets we suddenly get an exception:


      [...]

      29 Jan 2014 15:50:29,200 [Thread-7] DEBUG cs.io.xml.importer.completer.XMLImportAbstractObject  - Bankverbindung 9db3bXr6kM0000000002 erfolgreich importiert.

      29 Jan 2014 15:50:29,217 [Thread-7] DEBUG cs.io.xml.importer.completer.XMLImportAbstractObject  - Bankverbindung 9db3bXr6kM0000000011 erfolgreich importiert.

      29 Jan 2014 15:50:29,235 [Thread-7] DEBUG cs.io.xml.importer.completer.XMLImportAbstractObject  - Bankverbindung 9db3bXr6kM0000000003 erfolgreich importiert.

      29 Jan 2014 15:50:29,265 [Thread-7] DEBUG cs.io.xml.importer.completer.XMLImportAbstractObject  - Bankverbindung 9db3bXr6kM0000000010 erfolgreich importiert.

      29 Jan 2014 15:50:29,273 [Thread-7] DEBUG cs.io.xml.importer.completer.XMLImportAbstractObject  - Bankverbindung 9db3bXr6kM0000000012 erfolgreich importiert.

      29 Jan 2014 15:50:29,282 [Thread-7] DEBUG cs.io.xml.importer.completer.XMLImportAbstractObject  - Bankverbindung 9db3bXr6kM0000000013 erfolgreich importiert.

      29 Jan 2014 15:50:29,339 [Thread-7] DEBUG cs.io.xml.importer.completer.XMLImportAbstractObject  - Bankverbindung 9db3bXr6kM0000000014 erfolgreich importiert.

      29 Jan 2014 15:50:29,379 [Thread-7] DEBUG cs.io.xml.importer.completer.XMLImportAbstractObject  - Bankverbindung 9db3bXr6kM0000000001 erfolgreich importiert.

      29 Jan 2014 15:50:29,550 [Thread-7] DEBUG cs.io.xml.importer.completer.XMLImportAbstractObject  - Bankverbindung 9db3bXr6kM0000000015 erfolgreich importiert.

      29 Jan 2014 15:50:29,554 [Thread-7] INFO  cs.exception.BaseDescription  - hasAppBundle = false

      29 Jan 2014 15:50:29,555 [Thread-7] ERROR cs.io.xml.importer.completer.XMLImportAbstractObject  - Beim Speichern des Bankverbindung 9db3bXr6kM0000000016 ist/sind folgende(r) Fehler aufgetreten: EJBCLIENT000025: No EJB receiver available for handling [appName:efREporterV2-server, moduleName:efREporterV2-server, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@2da27fba

      java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:efREporterV2-server, moduleName:efREporterV2-server, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@2da27fba

        at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:735)

        at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:116)

        at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183)

        at org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:253)

        at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:198)

        at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:181)

        at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144)

        at com.sun.proxy.$Proxy4.importBankverbindung(Unknown Source)

        at cs.srv.facade.XMLImportFacade.saveBankverbindung(XMLImportFacade.java:1183)

        at cs.io.xml.importer.completer.XMLImportBankverbindungObject.complete(XMLImportBankverbindungObject.java:42)

        at cs.io.xml.importer.ImportXMLHandler.endElement(ImportXMLHandler.java:690)

        at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)

        at org.apache.xerces.impl.xs.XMLSchemaValidator.endElement(Unknown Source)

        at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)

        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)

        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)

        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)

        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)

        at cs.io.xml.importer.ImportStammdaten.performAll(ImportStammdaten.java:74)

        at cs.viewController.io.StammdatenImportierenViewController.run(StammdatenImportierenViewController.java:129)

        at java.lang.Thread.run(Thread.java:744)

      29 Jan 2014 15:50:29,555 [Thread-7] INFO  cs.exception.BaseDescription  - hasAppBundle = false

       

      After this exception the server isn't responding anymore for the running client.

       

      I also attached the class which is doing the lookup.

       

      Thank you in advance,

       

      Sven

        • 1. Re: No EJB receiver available after several successful connections
          wdfink

          It is not recommended to use remote-naming for EJB.

           

          Anyway, did you close the IC and drop the proxy reference, this is important for remote-naming

          • 2. Re: Re: No EJB receiver available after several successful connections
            sjankus

            Hello Wolf-Dieter,

             

            thank you for your quick response.

             

            I extended my ConnectionObject by a closeConnection-Methode which is called after every transaction.

             

              /**

              * Schließt die Verbindung zum Server wieder.

              * @throws TechException

              */

              public void closeConnection() throws TechException {

                try {

                connectionInterface = null;

              jndiContext.close();

              } catch (NamingException e) {

              throw ExceptionMapper.createTechException(e);

              } catch (Exception e) {

              // TODO

              throw ExceptionMapper.createTechException(e);

              }

              }

             

            My connectionObject is called after receiving a org.xml.sax.ContentHandler#endElement - in this case for a banking account.

             

                /**

                * Speichert die importierte Bankverbindung.

                * @param params Die zu speichernde Bankverbindung.

                * @throws ValidationException wenn Pflichtfelder nicht gefüllt bzw. fachliche Prüfungen nicht erfüllt sind.

                * @throws TechException wenn technische Probleme/Fehler aufgetreten sind..

                */

                public void saveBankverbindung(Bankverbindung params)

                    throws ValidationException, TechException {

                    try {

                    ConnectionObject<XMLImportVerwaltung> co = new ConnectionObject<XMLImportVerwaltung>(JNDI_NAME);

              XMLImportVerwaltung iv = co.getConnection();

                        iv.importBankverbindung(params);

                        co.closeConnection();

                    } catch (RemoteException e) {

                        throw ExceptionMapper.createTechException(e);

                    } catch (EJBException e) {

                        throw ExceptionMapper.createTechException(e);

                    }

                }

             

            But now I get an exception on closing every JNDI-object in addition. The disconnection-problem stayed the same.

             

            30 Jan 2014 08:48:47,469 [Remoting "config-based-naming-client-endpoint" read-1] ERROR org.jboss.remoting.handler-errors  - Close handler threw an exception

            java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@dc77dcd rejected from java.util.concurrent.ThreadPoolExecutor@241424cc[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 1]

              at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048)

              at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821)

              at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372)

              at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:110)

              at org.jboss.ejb.client.EJBClientContext.unregisterEJBReceiver(EJBClientContext.java:440)

              at org.jboss.ejb.client.EJBReceiverContext.close(EJBReceiverContext.java:59)

              at org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver$1$1.handleClose(RemotingConnectionEJBReceiver.java:142)

              at org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver$1$1.handleClose(RemotingConnectionEJBReceiver.java:139)

              at org.jboss.remoting3.spi.SpiUtils.safeHandleClose(SpiUtils.java:54)

              at org.jboss.remoting3.spi.AbstractHandleableCloseable$CloseHandlerTask.run(AbstractHandleableCloseable.java:501)

              at org.jboss.remoting3.spi.AbstractHandleableCloseable.runCloseTask(AbstractHandleableCloseable.java:406)

              at org.jboss.remoting3.spi.AbstractHandleableCloseable.closeComplete(AbstractHandleableCloseable.java:277)

              at org.jboss.remoting3.remote.RemoteConnectionChannel.closeAction(RemoteConnectionChannel.java:515)

              at org.jboss.remoting3.spi.AbstractHandleableCloseable.closeAsync(AbstractHandleableCloseable.java:359)

              at org.jboss.remoting3.remote.RemoteConnectionHandler.closeAllChannels(RemoteConnectionHandler.java:392)

              at org.jboss.remoting3.remote.RemoteConnectionHandler.handleConnectionClose(RemoteConnectionHandler.java:110)

              at org.jboss.remoting3.remote.RemoteReadListener.handleEvent(RemoteReadListener.java:78)

              at org.jboss.remoting3.remote.RemoteReadListener.handleEvent(RemoteReadListener.java:45)

              at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)

              at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:189)

              at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:103)

              at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)

              at org.xnio.nio.NioHandle.run(NioHandle.java:90)

              at org.xnio.nio.WorkerThread.run(WorkerThread.java:187)

            30 Jan 2014 08:48:47,470 [Remoting "config-based-naming-client-endpoint" task-4] ERROR org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1  - Channel end notification received, closing channel Channel ID 9a5da992 (outbound) of Remoting connection 0a8c63fd to null

             

            Sadly @EJB isn't working at that point of Code. If I try to use @EJB instead, the Bean stays null. I found another thread (http://stackoverflow.com/questions/848675/ejb-annotation-in-clients) which says "[...]The problem is that @EJB will only be injected in to "managed" classes.[...]".

             

            Any Ideas?

             

            Thanks, Sven

            • 3. Re: Re: Re: No EJB receiver available after several successful connections
              sjankus

              I switched to JBoss AS 7.1.1 for testing. On this server I receive the following stacktrace after many successful transactions.

               

              In addition there is a exception saying "[...] Too many channels open [...]" and at 13:40:06,480 there is an error-message "[...] Channel end notification received, closing channel [...]" and the next transaction is successful again...

               

              Any idea?

               

              Thanks, Sven

               

              30 Jan 2014 13:40:01,352 [Thread-5] INFO  cs.exception.BaseDescription  - hasAppBundle = false

              30 Jan 2014 13:40:01,352 [Thread-5] INFO  cs.exception.BaseDescription  - hasAppBundle = false

              30 Jan 2014 13:40:01,353 [Thread-5] INFO  cs.exception.BaseDescription  - hasAppBundle = false

              30 Jan 2014 13:40:01,353 [Thread-5] INFO  cs.exception.BaseDescription  - hasAppBundle = false

              30 Jan 2014 13:40:01,355 [Remoting "config-based-naming-client-endpoint" task-2] ERROR org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver  - Failed to open channel for context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@7f20a6a1, receiver=Remoting connection EJB receiver [connection=Remoting connection <224ba9f7>,channel=jboss.ejb,nodename=sjankus-think]}

              org.jboss.remoting3.ProtocolException: Too many channels open

                at org.jboss.remoting3.remote.RemoteConnectionHandler.handleOutboundChannelOpen(RemoteConnectionHandler.java:177)

                at org.jboss.remoting3.remote.RemoteConnectionHandler.open(RemoteConnectionHandler.java:307)

                at org.jboss.remoting3.ConnectionImpl.openChannel(ConnectionImpl.java:75)

                at org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver.associate(RemotingConnectionEJBReceiver.java:126)

                at org.jboss.ejb.client.EJBClientContext.registerEJBReceiver(EJBClientContext.java:297)

                at org.jboss.ejb.client.EJBClientContext.registerEJBReceiver(EJBClientContext.java:252)

                at org.jboss.ejb.client.EJBClientContext.registerConnection(EJBClientContext.java:342)

                at org.jboss.naming.remote.client.ejb.RemoteNamingEjbClientContextSelector.setCurrent(RemoteNamingEjbClientContextSelector.java:25)

                at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                at java.lang.reflect.Method.invoke(Method.java:606)

                at org.jboss.naming.remote.client.InitialContextFactory.setupEjbContext(InitialContextFactory.java:425)

                at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:115)

                at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)

                at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)

                at javax.naming.InitialContext.init(InitialContext.java:242)

                at javax.naming.InitialContext.<init>(InitialContext.java:216)

                at cs.srv.facade.ConnectionObject.getConnection(ConnectionObject.java:64)

                at cs.srv.facade.XMLImportFacade.saveReferat(XMLImportFacade.java:986)

                at cs.io.xml.importer.completer.XMLImportReferatObject.complete(XMLImportReferatObject.java:41)

                at cs.io.xml.importer.ImportXMLHandler.endElement(ImportXMLHandler.java:690)

                at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)

                at org.apache.xerces.impl.xs.XMLSchemaValidator.endElement(Unknown Source)

                at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)

                at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)

                at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)

                at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

                at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)

                at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

                at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)

                at cs.io.xml.importer.ImportStammdaten.performAll(ImportStammdaten.java:74)

                at cs.viewController.io.StammdatenImportierenViewController.run(StammdatenImportierenViewController.java:129)

                at java.lang.Thread.run(Thread.java:744)

              30 Jan 2014 13:40:06,359 [Thread-5] INFO  cs.exception.BaseDescription  - hasAppBundle = false

              30 Jan 2014 13:40:06,360 [Thread-5] ERROR cs.io.xml.importer.completer.XMLImportAbstractObject  - Beim Speichern des Referat 9db3bXr6kM0000000118 ist/sind folgende(r) Fehler aufgetreten: No EJB receiver available for handling [appName:efREporterV2-server,modulename:efREporterV2-server,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@56e948ed

              java.lang.IllegalStateException: No EJB receiver available for handling [appName:efREporterV2-server,modulename:efREporterV2-server,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@56e948ed

                at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:584)

                at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:119)

                at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181)

                at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:136)

                at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121)

                at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104)

                at com.sun.proxy.$Proxy4.importReferat(Unknown Source)

                at cs.srv.facade.XMLImportFacade.saveReferat(XMLImportFacade.java:987)

                at cs.io.xml.importer.completer.XMLImportReferatObject.complete(XMLImportReferatObject.java:41)

                at cs.io.xml.importer.ImportXMLHandler.endElement(ImportXMLHandler.java:690)

                at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)

                at org.apache.xerces.impl.xs.XMLSchemaValidator.endElement(Unknown Source)

                at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)

                at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)

                at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)

                at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

                at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)

                at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

                at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)

                at cs.io.xml.importer.ImportStammdaten.performAll(ImportStammdaten.java:74)

                at cs.viewController.io.StammdatenImportierenViewController.run(StammdatenImportierenViewController.java:129)

                at java.lang.Thread.run(Thread.java:744)

              30 Jan 2014 13:40:06,360 [Thread-5] INFO  cs.exception.BaseDescription  - hasAppBundle = false

              30 Jan 2014 13:40:06,360 [Thread-5] INFO  cs.exception.BaseDescription  - hasAppBundle = false

              30 Jan 2014 13:40:06,361 [Thread-5] INFO  cs.exception.BaseDescription  - hasAppBundle = false

              30 Jan 2014 13:40:06,361 [Thread-5] INFO  cs.exception.BaseDescription  - hasAppBundle = false

              30 Jan 2014 13:40:06,477 [Thread-5] INFO  cs.exception.BaseDescription  - hasAppBundle = false

              30 Jan 2014 13:40:06,480 [Remoting "config-based-naming-client-endpoint" task-1] ERROR org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1  - Channel end notification received, closing channel Channel ID 94314024 (outbound) of Remoting connection 1295e11f to localhost/127.0.0.1:4447

              30 Jan 2014 13:40:06,505 [Remoting "config-based-naming-client-endpoint" task-4] ERROR org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1  - Channel end notification received, closing channel Channel ID 9762a82e (outbound) of Remoting connection 0cac44ac to localhost/127.0.0.1:4447

              30 Jan 2014 13:40:06,506 [Thread-5] DEBUG cs.io.xml.importer.completer.XMLImportAbstractObject  - Referat 9db3bXr6kM0000000119 erfolgreich importiert.

              30 Jan 2014 13:40:06,523 [Remoting "config-based-naming-client-endpoint" task-4] ERROR org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1  - Channel end notification received, closing channel Channel ID dc4376b7 (outbound) of Remoting connection 76325651 to localhost/127.0.0.1:4447

              30 Jan 2014 13:40:06,523 [Thread-5] DEBUG cs.io.xml.importer.completer.XMLImportAbstractObject  - Referat 9db3bXr6kM0000000120 erfolgreich importiert.

              30 Jan 2014 13:40:06,540 [Remoting "config-based-naming-client-endpoint" task-4] ERROR org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1  - Channel end notification received, closing channel Channel ID bd97e6f5 (outbound) of Remoting connection 38ec0702 to localhost/127.0.0.1:4447

              30 Jan 2014 13:40:06,541 [Thread-5] DEBUG cs.io.xml.importer.completer.XMLImportAbstractObject  - Referat 9db3bXr6kM0000000121 erfolgreich importiert.

              30 Jan 2014 13:40:06,559 [Remoting "config-based-naming-client-endpoint" task-3] ERROR org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1  - Channel end notification received, closing channel Channel ID cd904e8b (outbound) of Remoting connection 578f530a to localhost/127.0.0.1:4447

              30 Jan 2014 13:40:06,560 [Thread-5] DEBUG cs.io.xml.importer.completer.XMLImportAbstractObject  - Referat 9db3bXr6kM0000000122 erfolgreich importiert.

              30 Jan 2014 13:40:06,580 [Remoting "config-based-naming-client-endpoint" task-3] ERROR org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1  - Channel end notification received, closing channel Channel ID aedb663f (outbound) of Remoting connection 53685543 to localhost/127.0.0.1:4447

              30 Jan 2014 13:40:06,581 [Thread-5] DEBUG cs.io.xml.importer.completer.XMLImportAbstractObject  - Referat 9db3bXr6kM0000000123 erfolgreich importiert.

              30 Jan 2014 13:40:06,606 [Remoting "config-based-naming-client-endpoint" task-3] ERROR org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1  - Channel end notification received, closing channel Channel ID e29f7b90 (outbound) of Remoting connection 23f4c9d5 to localhost/127.0.0.1:4447

              30 Jan 2014 13:40:06,606 [Thread-5] DEBUG cs.io.xml.importer.completer.XMLImportAbstractObject  - Referat 9db3bXr6kM0000000124 erfolgreich importiert.

              30 Jan 2014 13:40:06,627 [Remoting "config-based-naming-client-endpoint" task-4] ERROR org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1  - Channel end notification received, closing channel Channel ID a3f4c7b4 (outbound) of Remoting connection 60896454 to localhost/127.0.0.1:4447

              30 Jan 2014 13:40:06,627 [Thread-5] DEBUG cs.io.xml.importer.completer.XMLImportAbstractObject  - Referat 9db3bXr6kM0000000125 erfolgreich importiert.

              • 4. Re: No EJB receiver available after several successful connections
                wdfink

                The "too many channels" Exception is a wrong handling, as you use remote-naming you need to close the connection, otherwise it's a leak.

                 

                If you have a client which connect the same server's all the time I would use the ejb-client approach where the client library manage the connects. You only need to have a simple InitialContext.

                See documentation EJB invocations from a remote client using JNDI

                • 5. Re: No EJB receiver available after several successful connections
                  sjankus

                  Hello Wolf-Dieter,

                   

                  but I'm closing the connection by setting the received Remoutestub null and calling jndiContext.close();

                   

                  Isn't that enough?

                   

                  Sven

                  • 6. Re: No EJB receiver available after several successful connections
                    jaikiran

                    I switched to JBoss AS 7.1.1 for testing. On this server I receive the following stacktrace after many successful transactions.

                    I think it's better not to test against a older version since there have been numerous bug fixes after that. You might end up spending time on issues which have already been fixed. You might want to test against a latest released WildFly version instead Downloads · WildFly

                    • 7. Re: Re: No EJB receiver available after several successful connections
                      sjankus

                      Hello,

                       

                      I think the key is that importing the data from the XML-file via SAX-parser on the client-side is going faster than storing the data in the database on server-side. So we are opening more and more connections.

                       

                      After successfully storing the data on server-side I'm closing each connection but (IMHO) in that time maybe 5 new connections are created. This wasn't a problem on JBoss 4.2.3 but seams to be a Problem on AS-7.x / 6.x-EAP.

                       

                      Therefor I wrote a litte Client and an EJB to simulate this situation and I got the same problems.

                       

                      Start Thread-499

                      Exception in thread "Thread-503" java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:TestServer, moduleName:TestEJB, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@3b9690f6

                        at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:735)

                        at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:116)

                        at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:183)

                        at org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:253)

                        at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:198)

                        at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:181)

                        at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144)

                        at com.sun.proxy.$Proxy0.doTest(Unknown Source)

                        at de.test.TestClient$TestRun.run(TestClient.java:93)

                       

                      I have stored the Eclipse-Project-Files (using JBoss 6.2 EAP + Java 1.7.0_45) in my Dropbox -> https://dl.dropboxusercontent.com/u/18605441/JBoss-Test.zip (31.856 KB)

                       

                      Any Ideas

                       

                      Thanks, Sven

                      • 8. Re: No EJB receiver available after several successful connections
                        sjankus

                        @Wolf-Dieter

                        Is closing the connection by setting the received Remoutestub null and calling jndiContext.close() enough?

                         

                        If you agree with me I'm not sure if there isn't a problem with JBoss and JNDI. I attached a log-file of my testclient (see my last comment). In this file you can see that I'm starting several Threads and stopping them again by calling jndicontext.close(). My TIME_TO_WAIT-variable was set to 100 on client- and server-side so the client makes a call every 100 ms and the server waits 100 ms to simulate e.g. storing the data in a database.

                         

                        If I increase the clientside value higher then the serverside value, e.g. 300 ms to 100 ms, everything works well.

                         

                        In line 82 you may see that Thread-39 is stopped. At that point only ONE thread (Thread-41) is still running. All other threads are closed and have also closed their jndi-context-object.  So why does the start of a second thread (Thread-42 - line 83) lead to a "java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [...]" if there is only one active connection? Later on some threads (eg. Thread-145 / Thread-146) work correct again .

                         

                        I have now gone back to JBoss 6.1.0 Final (Community not EAP). Here our XML-import is still working. Does anybody have an idea why it isn't working with JBoss 7.x?

                         

                        Kind Regards

                         

                        Sven

                        • 9. Re: No EJB receiver available after several successful connections
                          cehlts

                          Hello Sven,

                           

                          i tried out your sample project and tinkered around for some time. My conclusion is, without studying the underlying sourcecode of the ejb-client-stuff, that you used some unfavorable combination of properties and parameters that threw together some of the legacy-path with the new remote-path. To fix the project i kind of followed the Jboss Documentation and weeded the "legacy" out your code.

                           

                          • no scoped context for testing, means no manual closing or handling of the context
                          • setting the necessary properties via jboss-ejb-client.properties instead of setting them as system.properties
                          • including package prefix CONTEXT_PROPERTIES.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming")
                          • prefixing your JNDI_NAME with the right protocol....ejb:TestServer/TestEJB/TestServerBean!de.test.TestServer

                           

                          This did the trick....atleast for me.....

                           

                          Greetings

                          Chris

                          • 10. Re: No EJB receiver available after several successful connections
                            sjankus

                            Hello Chris,

                             

                            thank you for your response. Your tip was right and now it is working for me on JBoss.

                             

                            There is only one point I dislike in this solution. Our application isn't only deployed on JBoss but also on WebSphere. Using the "old fashioned" JNDI-lookup-way worked for JBoss and WebSphere up to know. But using the JBoss-Remoting-Client from now, we need an additional switch for JBoss / WebSphere and a separat code for connection with WebSphere.

                             

                            THX, Sven