1 2 Previous Next 15 Replies Latest reply on May 9, 2013 4:19 AM by millsp

    problems with jboss-client and remote ejb calls

    peter craddock Novice

      We first ported our application to as7.1.0 and our remote ejb lookups worked ok

       

      Due to other errors we move to as 7.1.1 this seemed to be fine but after we used our remote ejb call to login we would start to get Null pointer exceptions when making subsequent calls to the ejbs. We decided to try the old 7.1.0 client jar and all works ok again.

       

      Is there any problem with using the old client in this way I should be aware of ?

       

      The nightly build client suffers from the same null pointer all the time (we can not even log in). I have another thread were I'm trying to sort out the EJBReciever Nullpointers but can anyone tell me the timeline for a 7.2.0 final release date ?

        • 1. Re: problems with jboss-client and remote ejb calls
          jaikiran pai Master

          It's almost impossible to guess what the problem is without looking at the code, the configurations and the entire exception stacktrace.

          • 2. Re: problems with jboss-client and remote ejb calls
            peter craddock Novice

            I create the initial context with the following props

             

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

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

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

            contextProps.put(Context.SECURITY_PRINCIPAL, "admin");

            contextProps.put(Context.SECURITY_CREDENTIALS, "password");

            contextProps.put(Context.PROVIDER_URL, "remote://ced12212:8034");

             

            and I get this stack trace when using the 7.1.1 client jar

             

            Caused by: java.lang.IllegalStateException: No EJB receiver available for handling [appName:cp,modulename:cp-ejb,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@51f2412a

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

             

            if I use a slighty different set of props to create the initial context and use a  jboss-ejb-client.properties file the error goes away. I cant use the jboss-ejb-client.properties file as the application gets installed on different hosts so I cant use a static file to controil the connection.

            • 3. Re: problems with jboss-client and remote ejb calls
              jaikiran pai Master

              Post the entire exception stacktrace, please. Also please post that relevant code which includes the lookup and invocation.

              • 4. Re: problems with jboss-client and remote ejb calls
                peter craddock Novice

                Here is the full client side exception

                 

                Financial Collaborator Error:

                Internal processing error

                Stack Trace:

                java.lang.RuntimeException: Can't get DataType

                    at com.cedar.cp.impl.datatype.DataTypeEditorSessionImpl.<init>(DataTypeEditorSessionImpl.java:55)

                    at com.cedar.cp.impl.datatype.DataTypesProcessImpl.getDataTypeEditorSession(DataTypesProcessImpl.java:64)

                    at com.cedar.cp.tc.apps.datatype.DataTypeApplication.createSession(DataTypeApplication.java:157)

                    at com.cedar.cp.tc.frm.AbstractApplication$2.run(AbstractApplication.java:243)

                Caused by: com.cedar.cp.api.base.CPException: No EJB receiver available for handling [appName:cp,modulename:cp-ejb,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@7b5c9f9d

                    at com.cedar.cp.ejb.api.base.AbstractSession.unravelException(AbstractSession.java:200)

                    at com.cedar.cp.ejb.api.datatype.DataTypeEditorSessionServer.getItemData(DataTypeEditorSessionServer.java:159)

                    at com.cedar.cp.impl.datatype.DataTypeEditorSessionImpl.<init>(DataTypeEditorSessionImpl.java:47)

                    ... 3 more

                Caused by: java.lang.IllegalStateException: No EJB receiver available for handling [appName:cp,modulename:cp-ejb,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@7b5c9f9d

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

                    at com.cedar.cp.ejb.api.datatype.DataTypeEditorSessionServer.getRemote(DataTypeEditorSessionServer.java:54)

                    at com.cedar.cp.ejb.api.datatype.DataTypeEditorSessionServer.getItemData(DataTypeEditorSessionServer.java:149)

                    ... 4 more

                 

                The context is created with the following props

                 

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

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

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

                contextProps.put(Context.SECURITY_PRINCIPAL, "admin");

                contextProps.put(Context.SECURITY_CREDENTIALS, "password");

                contextProps.put(Context.PROVIDER_URL, "remote://ced12212:8034");

                 

                The jndi lookup works using ejb:cp/cp-ejb/DataTypeEditorSessionSEJB!com.cedar.cp.ejb.api.datatype.DataTypeEditorSessionHome

                but the create fails

                mRemote = home.create();

                 

                as I said the presence of jboss-ejb-client.properties fixes this and it fine with the 7.1.0 client jar

                • 5. Re: problems with jboss-client and remote ejb calls
                  millsp Newbie

                  Hi Jaikiran,

                   

                  I've been working with Pete on this, I've got some test cases which involve an ear and a couple of client jars.  Is there some way I can get them to you in a zip file or should I post the client code onto this page ?

                   

                  Thanks -

                   

                  Phil

                  • 6. Re: problems with jboss-client and remote ejb calls
                    jaikiran pai Master

                    Phil, you can  PM (private message) me those if those aren't supposed to be accessible to public.

                    • 7. Re: problems with jboss-client and remote ejb calls
                      millsp Newbie

                      Hi just a bit of feedback on the latest 7.2.0, which we got from last night's build :

                       

                      The problems we had (running out of resources, and passing resources to new client threads) seem to be fixed when running with -Djboss.ejb.client.properties.file.path=jboss-ejb-client.properties, however when we opt not to use the properties file and programmatically set jboss.naming.client.ejb.context=true in the environment, we get NullPointerExceptions such as the following :

                       

                      CPModelClient : main() : ENTER
                      22-Nov-2012 16:38:12 org.xnio.Xnio <clinit>
                      INFO: XNIO Version 3.0.7.GA
                      22-Nov-2012 16:38:12 org.xnio.nio.NioXnio <clinit>
                      INFO: XNIO NIO Implementation Version 3.0.7.GA
                      22-Nov-2012 16:38:12 org.jboss.remoting3.EndpointImpl <clinit>
                      INFO: JBoss Remoting version 3.2.13.GA
                      22-Nov-2012 16:38:12 org.jboss.ejb.client.EJBClient <clinit>
                      INFO: JBoss EJB Client version 1.0.14.Final
                      CPModelClient : main() : ERROR : null
                      java.lang.NullPointerException
                              at org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver.<init>(RemotingConnectionEJBReceiver.java:102)
                              at org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver.<init>(RemotingConnectionEJBReceiver.java:90)
                              at org.jboss.ejb.client.EJBClientContext.registerConnection(EJBClientContext.java:401)
                              at org.jboss.naming.remote.client.ejb.RemoteNamingEjbClientContextSelector.getContext(RemoteNamingEjbClientContextSelector.java:60)
                              at org.jboss.naming.remote.client.ejb.RemoteNamingEjbClientContextSelector.getCurrent(RemoteNamingEjbClientContextSelector.java:46)
                              at org.jboss.naming.remote.client.ejb.RemoteNamingEjbClientContextSelector.getCurrent(RemoteNamingEjbClientContextSelector.java:15)
                              at org.jboss.ejb.client.EJBClientContext.getCurrent(EJBClientContext.java:252)
                              at org.jboss.ejb.client.EJBClientContext.requireCurrent(EJBClientContext.java:262)
                              at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:154)
                              at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:122)
                              at $Proxy0.create(Unknown Source)
                              at com.cedar.cp.model.client.CPModelClientLoop.main(CPModelClientLoop.java:105)
                      CPModelClient : main() : EXIT

                       

                      This is with the latest JBoss server code and client jar.   Hope this is useful -

                       

                      Phil

                      • 8. Re: problems with jboss-client and remote ejb calls
                        millsp Newbie

                        Hi could you clarify a couple of things on the plan for 7.2 please :

                         

                        - Until 7.2 is released, do you expect that the nightly builds of the 7.2 client jar will be compatible with down-level server releases, e.g. 7.1 ?

                         

                        - When 7.2 is released, do you expect that the issues we’ve raised with the client (resources, new threads, null pointers) will be resolved ?

                         

                        Many thanks

                         

                        Phil

                         

                        • 9. Re: problems with jboss-client and remote ejb calls
                          Vikas B Newbie

                          I am working on JBOSS 7.2.0.Final and still getting this exception :

                           

                          Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException

                              at org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver.<init>(RemotingConnectionEJBReceiver.java:102)

                              at org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver.<init>(RemotingConnectionEJBReceiver.java:90)

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

                              at org.jboss.naming.remote.client.ejb.RemoteNamingEjbClientContextSelector.getContext(RemoteNamingEjbClientContextSelector.java:60)

                              at org.jboss.naming.remote.client.ejb.RemoteNamingEjbClientContextSelector.getCurrent(RemoteNamingEjbClientContextSelector.java:46)

                              at org.jboss.naming.remote.client.ejb.RemoteNamingEjbClientContextSelector.getCurrent(RemoteNamingEjbClientContextSelector.java:15)

                              at org.jboss.ejb.client.EJBClientContext.getCurrent(EJBClientContext.java:271)

                              at org.jboss.ejb.client.EJBClientContext.requireCurrent(EJBClientContext.java:281)

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

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

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

                              at com.abc.client.SampleClient$2.actionPerformed(SampleClient.java:73)

                              at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)

                              at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)

                              at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)

                              at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)

                              at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)

                              at java.awt.Component.processMouseEvent(Component.java:6505)

                              at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)

                              at java.awt.Component.processEvent(Component.java:6270)

                              at java.awt.Container.processEvent(Container.java:2229)

                              at java.awt.Component.dispatchEventImpl(Component.java:4861)

                              at java.awt.Container.dispatchEventImpl(Container.java:2287)

                              at java.awt.Component.dispatchEvent(Component.java:4687)

                              at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)

                              at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)

                              at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)

                              at java.awt.Container.dispatchEventImpl(Container.java:2273)

                              at java.awt.Window.dispatchEventImpl(Window.java:2719)

                              at java.awt.Component.dispatchEvent(Component.java:4687)

                              at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:729)

                              at java.awt.EventQueue.access$200(EventQueue.java:103)

                              at java.awt.EventQueue$3.run(EventQueue.java:688)

                              at java.awt.EventQueue$3.run(EventQueue.java:686)

                              at java.security.AccessController.doPrivileged(Native Method)

                              at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)

                              at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)

                              at java.awt.EventQueue$4.run(EventQueue.java:702)

                              at java.awt.EventQueue$4.run(EventQueue.java:700)

                              at java.security.AccessController.doPrivileged(Native Method)

                              at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)

                              at java.awt.EventQueue.dispatchEvent(EventQueue.java:699)

                              at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)

                              at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)

                              at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)

                              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)

                              at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)

                              at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

                          • 10. Re: problems with jboss-client and remote ejb calls
                            jaikiran pai Master

                            Please try a latest available release from the downloads page. If you are still running into that issue on the latest version, I would like to see a reproducible application so that we can fix this.

                            • 11. Re: problems with jboss-client and remote ejb calls
                              Vikas B Newbie

                              I am using latest JBOSS 7.2.0.Final, please find the attached files which you can use to reproduce the problem

                              • 12. Re: problems with jboss-client and remote ejb calls
                                peter craddock Novice

                                I have been told this is fixed I recreated it in eap 6.1 beta and I have been told a fix has gone into that stream but im waiting on a new client to test this with.

                                 

                                millsp has raised a jira for it in the eap stream I gather this will make it into 7.2 comunity release at some point

                                • 13. Re: problems with jboss-client and remote ejb calls
                                  Vikas B Newbie

                                  I tried on JBOSS EAP 6.1.0.BETA release, I still see following exception :

                                  Lookup name=ejb:/Sample//com.abc.ps.MyPS!com.abc.ps.MyPS

                                  May 08, 2013 12:14:33 PM org.xnio.Xnio <clinit>

                                  INFO: XNIO Version 3.0.7.GA-redhat-1

                                  May 08, 2013 12:14:34 PM org.xnio.nio.NioXnio <clinit>

                                  INFO: XNIO NIO Implementation Version 3.0.7.GA-redhat-1

                                  May 08, 2013 12:14:34 PM org.jboss.remoting3.EndpointImpl <clinit>

                                  INFO: JBoss Remoting version 3.2.15.GA-redhat-1

                                  May 08, 2013 12:14:34 PM org.jboss.ejb.client.EJBClient <clinit>

                                  INFO: JBoss EJB Client version 1.0.17.Final-redhat-1

                                  Exception in thread "main" java.lang.NullPointerException

                                      at org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver.<init>(RemotingConnectionEJBReceiver.java:102)

                                      at org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver.<init>(RemotingConnectionEJBReceiver.java:90)

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

                                      at org.jboss.naming.remote.client.ejb.RemoteNamingEjbClientContextSelector.getContext(RemoteNamingEjbClientContextSelector.java:60)

                                      at org.jboss.naming.remote.client.ejb.RemoteNamingEjbClientContextSelector.getCurrent(RemoteNamingEjbClientContextSelector.java:46)

                                      at org.jboss.naming.remote.client.ejb.RemoteNamingEjbClientContextSelector.getCurrent(RemoteNamingEjbClientContextSelector.java:15)

                                      at org.jboss.ejb.client.EJBClientContext.getCurrent(EJBClientContext.java:271)

                                      at org.jboss.ejb.client.EJBClientContext.requireCurrent(EJBClientContext.java:281)

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

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

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

                                      at com.abc.client.TestClient.lookup(TestClient.java:47)

                                      at com.abc.client.TestClient.doLookups(TestClient.java:21)

                                      at com.abc.client.TestClient.main(TestClient.java:82)

                                   

                                  Here is how I am doing lookup :

                                   

                                  Properties jndiProps = new Properties();

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

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

                                               

                                                jndiProps.put(Context.PROVIDER_URL,"remote://localhost:4447");

                                   

                                                // username

                                                jndiProps.put(Context.SECURITY_PRINCIPAL, "admin1");

                                                // password

                                                jndiProps.put(Context.SECURITY_CREDENTIALS, "sample!23");

                                                // This is an important property to set if you want to do EJB invocations via the remote-naming project

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

                                                // create a context passing these properties

                                                ctx = new InitialContext(jndiProps);

                                  • 14. Re: problems with jboss-client and remote ejb calls
                                    peter craddock Novice

                                    yes you will.

                                     

                                    I believe a different version of remoting is being put into the client in the next build I'll ask millsp to add a link to the other issue

                                    1 2 Previous Next