1 2 3 Previous Next 43 Replies Latest reply on Sep 23, 2013 8:07 AM by thiru123 Go to original post
      • 30. Re: EJB bean is not working in Multi threading of JBoss 7.1.1 Final
        olli24

        Hi Wolf-Dieter

         

        During testing I faced something really strange.

         

        If my multithreading remote client runs under JRE 1.6.0_27 everything is fine, as I confirmed.

         

        But if I let run the same remote client under other JRE versions like 1.6.0_21 or 1.6.0_34, after some remote method invocations I get again the IllegalStateException: No EJBReceiver available for node name oliver2

        This is the StackTrace:

        java.lang.IllegalStateException: No EJBReceiver available for node name oliver2

        at org.jboss.ejb.client.EJBClientContext.requireNodeEJBReceiver(EJBClientContext.java:613)

        at org.jboss.ejb.client.EJBClientContext.requireNodeEJBReceiverContext(EJBClientContext.java:648)

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

        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)

         

        That means I still have a problem.

        What does it really mean that “No EJBReceiver” is available?

        What can I do to make an “EJBReceiver” available?

        Can I increase something in the JBoss EBJClient?

         

        And really strange is the different between the JRE versions on client side.

         

        My JBoss runs under JDK 1.6.0_27 or JDK 1.6.0_34, but this make no different.

        • 31. Re: EJB bean is not working in Multi threading of JBoss 7.1.1 Final
          wdfink

          I don't understand the difference between your attempts. I suppose you run in different environment because you must have something like a mail method for both cases ...

          Could you provide more details

          • 32. Re: EJB bean is not working in Multi threading of JBoss 7.1.1 Final
            wdfink

            What does it really mean that “No EJBReceiver” is available?

            The client context will be initialized by the jboss-ejb-client.properties and/or the InitialContext. In fact for both there is a list of available server-connections.

            If you do a lookup(...) the client create a Proxy based on the Remote interface (notice there is no server access as this was in previous versions!)

            If you use the proxy and execute a method the list of servers are hunted whether it can handle the request (EJB identificator is [ejb:]app/modul/bean!view)

            All possibilities are given to a selector class (default is Random....) to choice one of the posibilities.

            If there are none you get such Exception

            reasons:

            • no EJB with that name deployed
            • no server available  (for this ejb)
            • connection closed by error (should be reopend if possible)

             

            If you run the same code in different JVM versions, your behaviour looks like a JVM bug (nio), What if you use the last Java7 (I would prefer that for AS7)

            Could you reproduce it with a upstream compilation (As7.2.X or 7.1.3)?

             

            You might set logging org.jboss.ejb.client=TRACE to see more informations

            • 33. Re: EJB bean is not working in Multi threading of JBoss 7.1.1 Final
              bijoyjp

              I have a main method ClientMain.java and another java file LookUp_Bean.java.

              1. The LookUp_Bean class having the method for getting the remote object for ejb. And the LookUp_Bean class i created a main method for getting the remote object

              public static void main(String[] args){

              LookUp_Bean.getJMSRARemote("localhost:4447");

              }

               

              I run this LookUp_Bean class and am getting the remote object.

               

              1. In the other case I have a main class for entire client application ie ClientMain.java. From the ClientMain am calling the method inside the Lookup_Bean class am getting the exception

               

              LookUp_Bean.getJMSRARemote("localhost:4447");

              At the line of objRemote = home.create(); am getting the exception.

              1. java.lang.IllegalStateException: No EJB receiver available for handling [appName:,modulename:JMSRa,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@2b2c81
              • 34. Re: EJB bean is not working in Multi threading of JBoss 7.1.1 Final
                wdfink

                Sound that you start the ClientMain in a wrong environment, i.e. miss the jboss-ejb-client.prop in the classpath.

                • 35. Re: EJB bean is not working in Multi threading of JBoss 7.1.1 Final
                  bijoyjp

                  My client application structure I will explain.

                  • FDE_RT (folder)
                    • CacheStructures (folder)
                      • LookUp_Bean.java (file)
                      • LookUp_Bean.class (file)

                                 

                    • DBStructures (folder)
                    • Lib (folder)
                    • .classpath (file)
                    • ClientMain.java (file)
                    • ClientMain.class (file)
                    • jboss-ejb-client.properties (file)

                   

                  In this structure if am running LookUp_Bean.java am getting the result successfully. But if I am running “ClientMain.java” means am getting the exception.

                  • 36. Re: EJB bean is not working in Multi threading of JBoss 7.1.1 Final
                    olli24

                    If I use on client side a JRE which causes the problem I see in the JBoss log file

                    "JBAS011806: Channel end notification received"

                     

                    JBoss log

                    2012-08-23 15:48:17,068 TRACE [org.jboss.remoting.remote] Closed inbound channel on Connection handler for Remoting connection 0133bcc2 to /10.1.2.81:52129

                    2012-08-23 15:48:17,069 TRACE [org.jboss.remoting.resource] Completed close of Channel ID 7fb4e1bd (inbound) of Remoting connection 0133bcc2 to /10.1.2.81:52129

                    2012-08-23 15:48:17,069 INFO  [org.jboss.as.naming] JBAS011806: Channel end notification received, closing channel Channel ID 7fb4e1bd (inbound) of Remoting connection 0133bcc2 to /10.1.2.81:52129

                    2012-08-23 15:48:17,069 DEBUG [org.jboss.naming.remote.server.RemoteNamingService] Channel Channel ID 7fb4e1bd (inbound) of Remoting connection 0133bcc2 to /10.1.2.81:52129 closed.

                    2012-08-23 15:48:17,070 TRACE [org.jboss.remoting.resource] Closing Channel ID 7fb4e1bd (inbound) of Remoting connection 0133bcc2 to /10.1.2.81:52129 synchronously

                    2012-08-23 15:48:17,070 TRACE [org.xnio.nio.selector] Beginning select on sun.nio.ch.WindowsSelectorImpl@10bc3c9

                    2012-08-23 15:48:17,071 TRACE [org.xnio.nio.selector] Selected on sun.nio.ch.WindowsSelectorImpl@10bc3c9

                    2012-08-23 15:48:17,072 TRACE [org.xnio.nio.selector] Selected key sun.nio.ch.SelectionKeyImpl@192722c for java.nio.channels.SocketChannel[connected oshut local=oliver2/10.1.2.81:9000 remote=/10.1.2.81:52129]

                    2012-08-23 15:48:17,072 TRACE [org.xnio.listener] Invoking listener Read listener for org.xnio.channels.FramedMessageChannel around TCP socket channel (NIO) <145502b> on channel TCP socket channel (NIO) <145502b>

                    2012-08-23 15:48:17,073 TRACE [org.xnio.listener] Invoking listener org.jboss.remoting3.remote.RemoteReadListener@168ef25 on channel org.xnio.channels.FramedMessageChannel around TCP socket channel (NIO) <145502b>

                    2012-08-23 15:48:17,074 TRACE [org.xnio.channels.framed] Copying message from java.nio.HeapByteBuffer[pos=4 lim=5 cap=8196] into java.nio.HeapByteBuffer[pos=0 lim=8192 cap=8192]

                    2012-08-23 15:48:17,074 TRACE [org.jboss.remoting.remote] Received connection close request

                     

                    For "JBAS011806: Channel end notification received" I found this:

                    https://issues.jboss.org/browse/AS7-1338

                     

                    But if I use on client side the newest JRE 1.7.0_06, JBoss prompts no "Channel end notification received".

                    Everything is working fine.

                     

                    It seems its a bug inside the JRE, in the NIO part as you mentioned.

                    In the fixed bug list of JRE 1.7.0_06 are some bugs for NIO listed.

                    http://www.oracle.com/technetwork/java/javase/2col/7u6-bugfixes-1733378.html

                     

                    Conclusion:

                    I will use now on client side at least JRE 1.7.0_06 and I am happy.

                    • 37. Re: EJB bean is not working in Multi threading of JBoss 7.1.1 Final
                      bijoyjp

                      Am using jdk1.6.0_33 and jre1.6.0_33, is this is an issue?

                       

                      Or i need to use jre 7

                      • 38. Re: EJB bean is not working in Multi threading of JBoss 7.1.1 Final
                        bijoyjp

                        am getting below error in Jboss console :

                        11:16:32,529 ERROR [org.jboss.remoting.remote.connection] (Remoting "ispl03" rea

                        d-1) JBREM000200: Remote connection failed: java.io.IOException: An existing con

                        nection was forcibly closed by the remote host

                         

                        I tried with jdk1.6.0_34 and jre1.6.0_34 also, but results are same. How u solve ur issue ? is it required to use JRE 7 for this problem

                        • 39. Re: EJB bean is not working in Multi threading of JBoss 7.1.1 Final
                          olli24

                          Even it’s working, I can see on client side following warning.

                          org.jboss.ejb.client.remoting.ChannelAssociation     - Unsupported message received with header 0xffffffff

                           

                          What does this mean, can I ignore this?

                          In many AS7 samples in the internet I can see this warning, but I didn’t find a clarifying about this warning.

                          • 40. Re: EJB bean is not working in Multi threading of JBoss 7.1.1 Final
                            olli24

                            Hi James.

                             

                            I think your issue and my issue are different problems.

                            The common is only we both using a remote EJB client.

                             

                            I assume my problem is caused by the multi-threading in the client in conjunction with a JRE NIO bug.

                            But as I said under client JRE 1.7.0_06 I cannot reproduce the problem anymore.

                            • 41. Re: EJB bean is not working in Multi threading of JBoss 7.1.1 Final
                              wdfink

                              You can ignore this WARN, this is a internal info and in further releases this will be a DEBUG/TRACE message.

                              • 42. Re: EJB bean is not working in Multi threading of JBoss 7.1.1 Final
                                bijoyjp

                                I think now my problem solved and its working fine.

                                 

                                I used below code

                                 

                                  objProperties = new Properties();

                                  objProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");

                                  objProperties.put(Context.PROVIDER_URL, "remote://" + Url);

                                  objProperties.put("jboss.naming.client.ejb.context", true);

                                  objProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");

                                  jndiContext  = new InitialContext(objProperties);

                                 

                                  obj = jndiContext.lookup("JMSRa/JMSRA!Home.JMSRAHome");

                                  /*

                                  * jar name is JMSRa

                                */

                                  home = (JMSRAHome) PortableRemoteObject.narrow(obj, JMSRAHome.class);

                                  objRemote = home.create();

                                 

                                jndiContext.close();

                                 

                                If am not using jndiContext.close();  means my application is not working, I don’t kno what’s the reason

                                 

                                And "jboss-ejb-client.properties" in the client application class path also.

                                 

                                In the “jboss-ejb-client.properties” file I used below properties

                                     remote.connections=default

                                     remote.connection.default.host=localhost

                                     remote.connection.default.port=4447

                                     remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false

                                     remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false

                                 

                                 

                                The only one jar we need to use related to JBoss in client application is “jboss-client.jar” which is taken from “jboss-as-7.1.1.Final\bin\client” folder

                                 

                                 

                                Thanks for Wolf-Dieter Fink and Oliver Katzer for your valuable helps


                                • 43. Re: EJB bean is not working in Multi threading of JBoss 7.1.1 Final
                                  thiru123

                                  Thanks Bijoy.

                                   

                                  I had the same problem. Your reply was useful to me.

                                  1 2 3 Previous Next