1 2 Previous Next 27 Replies Latest reply on Jul 31, 2013 7:13 AM by millsp Go to original post
      • 15. Re: JBoss 7.2 Final (from Git) ... client jar issues ?
        millsp

        Hi do you need anything else from me on this at the moment ?

        • 16. Re: JBoss 7.2 Final (from Git) ... client jar issues ?
          jaikiran

          No, I have the necessary information to understand what's going on. Thank you for those details.

           

          But, I had a look at the remote-naming project and we didn't end up releasing that fix. The fix has been committed to git though. If you are willing to build from source, then I can help you with the instructions on what needs to be done, so that you can test to see if it fixes your issue. Let me know.

          • 17. Re: JBoss 7.2 Final (from Git) ... client jar issues ?
            millsp

            Yes please.  We might not be able to progress it for a day or two, but if you could outline how to do it that would be a big help.  Thanks -

            • 18. Re: JBoss 7.2 Final (from Git) ... client jar issues ?
              jaikiran

              So it looks like you are building from the 7.2 pre release tag. Once you have checked out that branch/tag or whichever tag/branch you are using, follow the steps below:

               

              1) Open the <JBoss AS source code home>/pom.xml in a text editor

              2) Update the remote naming project version to 1.0.6.Final-SNAPSHOT. The correct line to update looks like:

               

              <version.org.jboss.remote-naming>1.0.6.Final-SNAPSHOT</version.org.jboss.remote-naming>

              3) Rebuild JBoss AS using the same command that you are used to for building it. This step will rebuild the AS with this new version of remote naming project and will also generate a new jboss-client.jar which contains these updated classes

              4) Start up the server and run your client tests/program. Just make sure you are using this new jboss-client.jar in the client classpath.

               

              If you run into issues trying this, feel free to post here.

              • 19. Re: JBoss 7.2 Final (from Git) ... client jar issues ?
                millsp

                OK we'll give that a go.  Thanks -

                • 20. Re: JBoss 7.2 Final (from Git) ... client jar issues ?
                  millsp

                  Hi Jaikiran,

                   

                  Yes that has fixed the threading problem.  However the other test we do - creating an initial context repeatedly, looking up objects in JNDI repeatedly - failed after a number of iterations, with the following error :

                   

                  ...

                  CPModelClient : main() : iteration [43]
                  CPModelClient : main() : iteration [44]
                  CPModelClient : main() : iteration [45]
                  CPModelClient : main() : iteration [46]
                  CPModelClient : main() : iteration [47]
                  CPModelClient : main() : iteration [48]
                  CPModelClient : main() : iteration [49]
                  CPModelClient : main() : iteration [50]
                  CPModelClient : main() : iteration [51]
                  CPModelClient : main() : ERROR : EJBCLIENT000025: No EJB receiver available for handling [appName:cp-model, moduleName:cp-model.jar, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@2052d1a4
                  java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:cp-model, moduleName:cp-model.jar, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@2052d1a4
                          at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:693)
                          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.doInvoke(EJBInvocationHandler.java:177)
                          at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:161)
                          at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:124)
                          at $Proxy0.create(Unknown Source)
                          at com.cedar.cp.model.client.CPModelClientLoopRemoting.main(CPModelClientLoopRemoting.java:106)
                  CPModelClient : main() : EXIT

                   

                  With the other jboss-client.jar we had originally built from Git, this looping test was fine, but using the initial context etc. in a different thread was causing a problem.

                  • 21. Re: JBoss 7.2 Final (from Git) ... client jar issues ?
                    jaikiran

                    What do the logs indicate for the failure (other than this exception)? Try enabling TRACE level logging for org.jboss.ejb.client and org.jboss.remote.naming packages to see if it shows more details.

                    • 22. Re: JBoss 7.2 Final (from Git) ... client jar issues ?
                      millsp

                      OK I might need a hint ... I understand the JBoss client uses JDK logging, I've set up a pretty minimal config file and have succeeded in turning the INFO messages (e.g. "INFO: JBoss EJB Client version 1.0.16.Final") on and off.

                       

                      However when I set the level to FINEST, I don't get any additional trace other than the 5 or 6 INFO messages ... I'm guessing I've missed something ?

                       

                      • 23. Re: JBoss 7.2 Final (from Git) ... client jar issues ?
                        millsp

                        Sorry - I twigged what I needed to do, here are the last few iterations.  The full trace file is 70k if you'd like it, there might be a better way to get it to you than posting it all in here:

                         

                        CPModelClient : main() : iteration [43]
                        11:31:41,896 DEBUG [EJBClientContext] org.jboss.ejb.client.RandomDeploymentNodeSelector@4a787235 deployment node selector selected node1 node for appname=cp-model,modulename=cp-model.jar,distinctname=
                        11:31:41,896 TRACE [ChannelAssociation] Received message with header 0x5
                        11:31:41,896 DEBUG [EJBClientContext] org.jboss.ejb.client.RandomDeploymentNodeSelector@4a787235 deployment node selector selected node1 node for appname=cp-model,modulename=cp-model.jar,distinctname=
                        11:31:41,896 TRACE [ChannelAssociation] Received message with header 0x5
                        11:31:41,896 DEBUG [InitialContextFactory] Looking for jboss-naming-client.properties using classloader sun.misc.Launcher$AppClassLoader@4aad3ba4
                        11:31:41,896 DEBUG [InitialContextFactory] jboss.naming.client.endpoint.create.options. has the following options {}
                        11:31:41,896 DEBUG [InitialContextFactory] jboss.naming.client.remote.connectionprovider.create.options. has the following options {}
                        11:31:41,896 DEBUG [InitialContextFactory] jboss.naming.client.connect.options. has the following options {}
                        11:31:41,896 DEBUG [EJBClientContext] org.jboss.ejb.client.RandomDeploymentNodeSelector@4a787235 deployment node selector selected node1 node for appname=cp-model,modulename=cp-model.jar,distinctname=
                        11:31:41,896 TRACE [ChannelAssociation] Received message with header 0x5
                        CPModelClient : main() : iteration [44]
                        11:31:41,896 DEBUG [EJBClientContext] org.jboss.ejb.client.RandomDeploymentNodeSelector@4a787235 deployment node selector selected node1 node for appname=cp-model,modulename=cp-model.jar,distinctname=
                        11:31:41,896 TRACE [ChannelAssociation] Received message with header 0x5
                        11:31:41,896 DEBUG [EJBClientContext] org.jboss.ejb.client.RandomDeploymentNodeSelector@4a787235 deployment node selector selected node1 node for appname=cp-model,modulename=cp-model.jar,distinctname=
                        11:31:41,896 TRACE [ChannelAssociation] Received message with header 0x5
                        11:31:41,896 DEBUG [InitialContextFactory] Looking for jboss-naming-client.properties using classloader sun.misc.Launcher$AppClassLoader@4aad3ba4
                        11:31:41,896 DEBUG [InitialContextFactory] jboss.naming.client.endpoint.create.options. has the following options {}
                        11:31:41,896 DEBUG [InitialContextFactory] jboss.naming.client.remote.connectionprovider.create.options. has the following options {}
                        11:31:41,896 DEBUG [InitialContextFactory] jboss.naming.client.connect.options. has the following options {}
                        11:31:41,896 DEBUG [EJBClientContext] org.jboss.ejb.client.RandomDeploymentNodeSelector@4a787235 deployment node selector selected node1 node for appname=cp-model,modulename=cp-model.jar,distinctname=
                        11:31:41,896 TRACE [ChannelAssociation] Received message with header 0x5
                        CPModelClient : main() : iteration [45]
                        11:31:41,896 DEBUG [EJBClientContext] org.jboss.ejb.client.RandomDeploymentNodeSelector@4a787235 deployment node selector selected node1 node for appname=cp-model,modulename=cp-model.jar,distinctname=
                        11:31:41,896 TRACE [ChannelAssociation] Received message with header 0x5
                        11:31:41,896 TRACE [EJBClientContext] EJB client context org.jboss.ejb.client.EJBClientContext@6a9bd5d8 has been closed, returning an empty collection of EJB receivers
                        CPModelClient : main() : ERROR : EJBCLIENT000025: No EJB receiver available for handling [appName:cp-model, moduleName:cp-model.jar, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@27bae40c
                        CPModelClient : main() : EXIT
                        11:31:41,927 ERROR [RemoteNamingStoreV1] Channel end notification received, closing channel Channel ID a11c08ae (outbound) of Remoting connection 577ede6a to myhost/myipaddress:myport
                        11:31:41,927 INFO  [remoting] EJBCLIENT000016: Channel Channel ID 96cf82fc (outbound) of Remoting connection 577ede6a to myhost/myipaddress:myport can no longer process messages
                        11:31:41,927 DEBUG [ChannelAssociation] Closing channel Channel ID 96cf82fc (outbound) of Remoting connection 577ede6a to myhost/myipaddress:myport
                        11:31:41,927 DEBUG [RemotingConnectionEJBReceiver] Closing channelChannel ID 96cf82fc (outbound) of Remoting connection 577ede6a to myhost/myipaddress:myport
                        java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:cp-model, moduleName:cp-model.jar, distinctName:] combination for invocation context org.jboss
                        .ejb.client.EJBClientInvocationContext@27bae40c
                                at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:693)
                                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.doInvoke(EJBInvocationHandler.java:177)
                                at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:161)
                                at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:124)
                                at $Proxy1.remove(Unknown Source)
                                at com.cedar.cp.model.client.CPModelClientLoopRemoting.main(CPModelClientLoopRemoting.java:115)

                        • 24. Re: JBoss 7.2 Final (from Git) ... client jar issues ?
                          jaikiran

                          I've released 1.0.6.Final version of remote-naming. If you want to use it, you can start using it by upgrading your maven dependency.

                           

                          By the way, for the other issue in your latest post, can you please create a separate thread with relevant details? That way, I can understand it a bit better.

                          • 25. Re: JBoss 7.2 Final (from Git) ... client jar issues ?
                            millsp

                            OK.  I've created "EAP 6.1.0 Alpha : Error using home interface in different thread", please let me know if you need anything else.  Thanks -

                            • 26. Re: JBoss 7.2 Final (from Git) ... client jar issues ?
                              cbehrenberg

                              Hi Phil,

                               

                              I stumbled upon this thread and your original posting, because I had similar problems while migrating from AS 7.1.1 to AS 7.2. The information about this topic is very diffuse on the internet, but we believe we have found a solution to the problem that works.

                              On the one hand you configure JNDI properties like before - but just the URL_PKG_PREFIXES value - and on the other hand you create a second Property object used to administer a special EJB Client Configuration, for which you can set up one or more remote connections to be used. If you don’t want to do it programmatically, you can still put those values into a jboss-ejb-client.properties file located in main\resources of your application.

                               

                              I tested it for a non-Maven project with the AS 7.2 jboss-client.jar in the \bin folder and it works; it works for Maven projects as well, if the following bom is added as dependency:

                               

                               

                              <dependency>

                                     <groupId>org.jboss.as</groupId>

                                     <artifactId>jboss-as-ejb-client-bom</artifactId>

                                     <version>7.2.0.Final</version>

                                     <type>pom</type>

                              </dependency>

                               

                               

                              Example code as follows. Please note that the string “XXX” represents the name of the connection - you can use your own, or “default” for testing; in all cases you have to summarize all connections to be used in the “remote.connections” statement:

                               

                               

                              final Properties ejbProps = new Properties();

                               

                              // setup connection parameters

                              ejbProps.setProperty("remote.connection.XXX.host", "xxx.xxx.xxx.xxx");

                              ejbProps.setProperty("remote.connection.XXX.port", "4447");

                              ejbProps.setProperty("remote.connection.XXX.username", "user");

                              ejbProps.setProperty("remote.connection.XXX.password", "password");

                               

                              // connections to be used

                              ejbProps.setProperty("remote.connections", "XXX");

                               

                              ejbProps.setProperty("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", "false");

                              ejbProps.setProperty("remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", "false");

                               

                              EJBClientConfiguration ejbClientConfig = new PropertiesBasedEJBClientConfiguration(ejbProps);

                              ContextSelector<EJBClientContext> ejbClientContextSelector = new ConfigBasedEJBClientContextSelector(ejbClientConfig);

                              EJBClientContext.setSelector(ejbClientContextSelector);

                               

                              final Properties jndiProps = new Properties();

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

                               

                              InitialContext ctx = new InitialContext(jndiProps);

                               

                              // do lookup

                              // remote invocation

                               

                               

                              I hope this useful to you or somebody else. Note: the user/pass can be skipped, if you don’t use RBAC, but I just wanted to reprint it here if you need to know how to pass credentials.

                               

                              Best regards,

                              -Christian

                              • 27. Re: JBoss 7.2 Final (from Git) ... client jar issues ?
                                millsp

                                Hi Christian,

                                 

                                Thank you for this information.  This is exactly what we couldn't figure out how to do ... how to get the client to use programmatic properties, instead of looking for jboss-ejb-client.properties.

                                We gave up on that ('EJB client') approach in favour of 'remoting', which seemed better suited to using programmatic properties.  We've now got a build of 7.2 which works for our application, like you we took the 7.2.0.Final tag from Git but made another change to the pom for the version of remote-naming, as my colleague has outlined in

                                 

                                https://community.jboss.org/thread/229783

                                 

                                Thanks and regards -

                                 

                                Phil

                                1 2 Previous Next