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

        am using Eclipse and from the main class am running the java class ie ctrl + F11

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

          Then you need to add the jboss-*.properties to the Eclipse 'Run Configurations' for this class.

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

            Hi Oliver,

             

            I placed the jboss-ejb-client.properties in the class path of my (remote) client application, but still am able to get the remote object, but by invoking the method am getting the exception.

            Can u please share your code how to invoke your ejb remote bean object and calling the method inside the bean remote object

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

              As this is the normal behaviour of the client. The 'lookup' will never call the server!

              So you get an exception if you access the bean.

               

              For examples you might have a look into the quickstarts (or clone/download it) :

              git clone git://github.com/jboss-jdf/jboss-as-quickstart.git

               

              ejb-remote, cluster-ha-singleton-service and ejb-multi-server contain clients that will use what you will see.

              See the description and documentation here, also each quickstart will have a README.md

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

                System.setProperty("jboss.ejb.client.properties.file.path", "C:\\jboss-ejb-client.properties"); // Content of the file I posted already.

                 

                Properties properties = new Properties();

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

                Context jndiContext = new InitialContext(properties);

                 

                 

                Object ref = jndiContext.lookup( "ejb:/MtzWebComm//CommEJB!de.miditec.communication.ejb.CommEJBHome");

                CommEJBHome commEJBHome = (CommEJBHome) PortableRemoteObject.narrow(ref, CommEJBHome.class);

                 

                CommEJB commEJB = commEJBHome.create(1);

                 

                System.out.println( commEJB.getHello() );

                commEJB.remove();

                 

                So, it's similar to your code.

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

                  Now am getting different type of exception.

                   

                  if i am setting the properties.file.path

                  ie System.setProperty("jboss.ejb.client.properties.file.path", "C:\\FLMS_DEMO\\jboss-ejb-client.properties");

                   

                  am getting below exception

                   

                  java.lang.IllegalStateException: No EJB receiver available for handling [appName:,modulename:JMSRa,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@1342ba4

                      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.EJBClientInvocationContext.retryRequest(EJBClientInvocationContext.java:206)

                      at org.jboss.ejb.client.EJBReceiverInvocationContext.retryInvocation(EJBReceiverInvocationContext.java:95)

                      at org.jboss.ejb.client.remoting.NoSuchEJBExceptionResponseHandler.processMessage(NoSuchEJBExceptionResponseHandler.java:78)

                      at org.jboss.ejb.client.remoting.ChannelAssociation$ResponseReceiver.handleMessage(ChannelAssociation.java:395)

                      at org.jboss.remoting3.remote.RemoteConnectionChannel$5.run(RemoteConnectionChannel.java:437)

                      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

                      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

                      at java.lang.Thread.run(Unknown Source)

                      at ...asynchronous invocation...(Unknown Source)

                      at org.jboss.ejb.client.remoting.NoSuchEJBExceptionResponseHandler$ResultProducer.getResult(NoSuchEJBExceptionResponseHandler.java:101)

                      at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:270)

                      at org.jboss.ejb.client.TransactionInterceptor.handleInvocationResult(TransactionInterceptor.java:47)

                      at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:272)

                      at org.jboss.ejb.client.ReceiverInterceptor.handleInvocationResult(ReceiverInterceptor.java:132)

                      at org.jboss.ejb.client.EJBClientInvocationContext.getResult(EJBClientInvocationContext.java:260)

                      at org.jboss.ejb.client.EJBClientInvocationContext.awaitResponse(EJBClientInvocationContext.java:399)

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

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

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

                      at $Proxy0.create(Unknown Source)

                      at CacheStructures.LookUp_Bean.getJMSRARemote(LookUp_Bean.java:196)

                      at CacheStructures.LookUp_Bean.main(LookUp_Bean.java:218)

                   

                   

                  If i am not setting the System.property is getting below exception

                   

                  ie  // System.setProperty("jboss.ejb.client.properties.file.path", "C:\\FLMS_DEMO\\jboss-ejb-client.properties");

                   

                   

                  java.lang.IllegalStateException: No EJB receiver available for handling [appName:,modulename:JMSRa,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@4b222f

                      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 $Proxy0.create(Unknown Source)

                      at CacheStructures.LookUp_Bean.getJMSRARemote(LookUp_Bean.java:196)

                      at CacheStructures.LookUp_Bean.main(LookUp_Bean.java:218)

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

                    Are Client and JBoss on different machines?

                     

                    If yes, you need to set in the properties files also username and password, because security-realm is enabled by default.

                    remote.connection.default.username=xxx

                    remote.connection.default.password=yyy

                     

                    Only if the client runs locally you don’t need to set the username/password.

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

                      My client and JBoss are running in same machine.

                       

                      i tried with username and password also.

                       

                       

                      In the JBoss Console am getting the below error

                       

                      12:10:37,742 ERROR [org.jboss.remoting.remote.connection] (Remoting "ispl03" read-1) JBREM000200: Remote connection failed: java.io.IOException: An existing

                      connection was forcibly closed by the remote host

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

                        To eliminate influence of other components (e.g. Windows - I suppose you use this - Firewalls etc)

                        are you able to run one of the quickstarts successfully?

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

                          Firewalls is off only in my system.

                          Below listed jar's for Jboss am using in clinet application. Is any problem with jar's

                           

                          Jar.jpg

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

                            For AS7 you should use the jar file in the JBOSS/bin/client folder, see the instructions in the README file for informations about jar and mavaen use.

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

                              so you are saying only "jboss-client.jar" required in client side application right?

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

                                Below i pasted the code of the Home interface class

                                 

                                package Home;

                                import java.rmi.RemoteException;

                                import javax.ejb.CreateException;

                                import javax.ejb.EJBHome;

                                import Remote.JMSRARemote;

                                public interface JMSRAHome extends EJBHome{

                                     public JMSRARemote create() throws RemoteException, CreateException;

                                }

                                 

                                 

                                And below is the code for Remote class

                                 

                                package Remote;

                                import java.rmi.RemoteException;

                                import java.util.ArrayList;

                                import java.util.Vector;

                                import javax.ejb.EJBObject;

                                public interface JMSRARemote extends EJBObject{

                                     public String ReadTxnFromInputQueueString(String strQName)throws RemoteException;

                                }

                                 

                                 

                                Is this code is correct?

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

                                  Yes

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

                                    I created a sample class file (LookUp_Bean.java) and having the code for getting the remote object and I run this class files and here it’s working fine am getting the remote object and am able to call the methods inside the ejb bean.

                                    But from my client application if I run means it’s not working. In this case the main class is different class and from the main class am calling the (LookUp_Bean.java) class for getting the remote object. Both times am using same method. Am getting below exception.

                                    I placed the properties file in the class path of the client application

                                     

                                     

                                    java.lang.IllegalStateException: No EJB receiver available for handling [appName:,modulename:JMSRa,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@2b2c81

                                           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 $Proxy14.create(Unknown Source)

                                           at CacheStructures.LookUp_Bean.getJMSRARemote(LookUp_Bean.java:199)

                                           at FMSMain.main(FMSMain.java:103)