1 2 3 4 Previous Next 50 Replies Latest reply on Dec 19, 2014 10:25 AM by fapinheiro Branched to a new discussion.

    ejb access from one server to a second server

    schnabeltier

      Hello,

       

      can you help me?

       

      If you want to access an ejb in a desktop client, you can use a

      jndi-lookup with "jboss-ejb-client.properties",

       

      What do I have to do, if I want to access a ejb from one jboss-server to a different jboss-server?

      Where do I have to put "jboss-ejb-client.properties" in the server?

      Is there an other way to specify, where to find the second jboss-server?

       

      Please help.

        • 1. Re: ejb access from one server to a second server
          bjorn.palmqvist

          Hi,

           

          I'm also intrested in this. We have a similar prroblem, where we access one ejb from a standalon client on a server1, that ejb need, in some cases, access an ejb on a second server (server2).

           

          We have specifyed the -Djboss.ejb.client.properties.file.path=/path/to/file/jboss-as-ejb-client.properties in the standalone.sh to the javavm and in the standalone.xml (just to be sure).

           

          The first request works fine (client to server), but the second fails (server1 to server2) every time with the same massage.

           

          14:14:25,114 ERROR [stderr] (pool-9-thread-7) java.lang.IllegalArgumentException: Could not find module app: module: jboss-as-ejb-remote-server-side-7.1.0.CR1-SNAPSHOT distinct name:

          14:14:25,114 ERROR [stderr] (pool-9-thread-7) at org.jboss.as.ejb3.remote.LocalEjbReceiver.findBean(LocalEjbReceiver.java:227)

          ...

           

          We have seen contact between the server on the remoting port, fetching the namespace, from server2 to server1.

           

            14:13:16,410 DEBUG [org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver] (Remoting "config-based-ejb-client-endpoint" task-1) Received module availability message for appName:  moduleName: jboss-as-ejb-remote-server-side-7.1.0.CR1-SNAPSHOT distinctName:  for receiver context org.jboss.ejb.client.EJBReceiverContext@644b27ad

           

          Any thoughts on this?

          • 2. Re: ejb access from one server to a second server
            schnabeltier

            Hi,

             

            possibly I should mention, that we start the server with -Djboss.ejb.client.properties.file.path=../standalone/configuration/jboss-ejb-client.properties

             

            the file "jboss-ejb-client.properties" looks simply like:

             

            endpoint.name=client-endpoint

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

            remote.connections=default

            remote.connection.default.host=10.0.41.223   <-- the second server

            remote.connection.default.port = 4447

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

             

            We use Jboss 7.1.0.CR1beta.

             

            We get:

             

            javax.ejb.EJBException: java.lang.IllegalArgumentException: Could not find module app: Inventory.Seam module: Inventory.Seam-ejb-2.0-SNAPSHOT distinct name:; nested exception is: java.lang.IllegalArgumentException: Could not find module app: Inventory.Seam module: Inventory.Seam-ejb-2.0-SNAPSHOT distinct name:

            java.lang.IllegalArgumentException: Could not find module app: Inventory.Seam module: Inventory.Seam-ejb-2.0-SNAPSHOT distinct name:

             

            But we are sure, that the naming is correct, because the exact same name runs with a desktop client.

            Please help.

            • 3. Re: ejb access from one server to a second server
              markl78

              Im also seeing this issue, when I try to lookup ejb on serverB from my accessbean on serverA it fails in the same way ( the lookup is actually ok, but I cannot invoke the bean , home.create() fails miserably with IllegalArgumentException like above, from standalone java app the thing works fine )

               

              /Markus

              • 4. Re: ejb access from one server to a second server
                sfcoy

                In the past I've federated the JNDI trees as described in org.jboss.naming.ExternalContext MBean. This makes the global JNDI namespace of server2 visible in server1 as a subcontext.

                 

                It then makes no difference in your code whether or not the remote EJB is in the same server or a remote server, aside from the ENC->global name mapping (and assuming proper RMI calling semantics).

                 

                I'm not sure how to do this in JBoss 7 though.

                • 5. Re: ejb access from one server to a second server
                  jaikiran

                  Sorry everyone, it was my plan a few weeks back to add an example for this usecase, but just haven't been able to get to this yet. I'll make sure I have something very soon.

                  • 6. Re: ejb access from one server to a second server
                    juan_jordaan

                    I also have this problem. Can't wait for the example

                    • 7. Re: ejb access from one server to a second server
                      sci

                      I have a similar problem.

                      When do you plan to add the example for this problem?

                      • 8. Re: ejb access from one server to a second server
                        mreasy

                        Very soon he said

                        btw. the other posting, which was referred to, most probably was this: https://community.jboss.org/message/638692

                        • 9. Re: ejb access from one server to a second server
                          schnabeltier

                          It would be fine, if you could give us the example before 7.1.0.Final.

                          • 10. Re: ejb access from one server to a second server
                            jaikiran

                            I just added the documentation here https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+server+instance. Those steps are supposed to work (we have testcases for those), but I haven't verified whatever I've written in that documentation against a sample application (too late in the night right now). So give it a try and let us know how it goes. If you run into any issues, feel free to report them here.

                            • 11. Re: ejb access from one server to a second server
                              rodakr

                              Hi Jaikiran

                               

                              Are you shure , you would like give this as end solution... ?

                               

                              For each remote EJB Destination I have to change Client Server configuration.....

                              - create  outbound-socket-binding ( static )

                              - create  remote-outbound-connection ( static )

                              -  jboss-ejb-client.xml entries... ( static )

                               

                              What is the reason to doing so?  It sounds for me like stone age.... not modern light way fast App Server AS 7.1 ...

                              Pass Connection URL to JNDIContext needs one Line source code, is dynamic for any remote destination and needs one line code... an 0 Lines configuration and 0 number of config files...

                              I can do this with pure java rmi ... and 10 years old App Server... but not with EE 6 AS 7.1 ....

                               

                              And now I need to do static configuration... static config files so a client can call remote ejb...on remote server.

                               

                              What if my client needs to call 5 EJB's on 5 different remote Servers...

                              According to your server to server docu I would have to configure 5 outbound-cocket-bindig, 5 remote -outbound-connection, and put 5 remoting-ejb-receiver in to jboss-ejb-client.xml....

                              Each time  my client lookup an EJB , depends on order in jboss-ejb-client.xml client will get worst case 4 lookup misses....  until he use the correct remoting-ejb-receiver for given EJB...

                              This will be performance killer....

                               

                              Imaging an Administrator which deploy an Application on AS 7.1.  Now Administrator will need to know all remote EJB destination in this ear File... and will have to change Client Server configuration... so this Application can do remote calls....

                              I thing Jboss Support will be overflowed with support Requests from clients...

                               

                               

                              Why not make ejb remote call so simple for users of AS 7 , like calling an HTTP Url ...  ?

                              • 12. Re: ejb access from one server to a second server
                                schnabeltier

                                Hello,

                                 

                                I tried it, but I got "java.lang.IllegalArgumentException: Could not find module app: Inventory.Seam module: Inventory.Seam-ejb-2.0-SNAPSHOT distinct name:"

                                I am sure that the naming is not the problem, because it works in the client scenario.

                                • 13. Re: ejb access from one server to a second server
                                  j_ri

                                  I completely agree!

                                   

                                  The usual lookup code using the InitialContext with the Context.PROVIDER_URL value has to work.

                                  • 14. Re: ejb access from one server to a second server
                                    juan_jordaan

                                    I am now getting a java.lang.IllegalStateException : No EJB receiver available, and I think it might have something to do with not specifying SSL_ENABLED=false. Where do I specify that now in the jboss-ejb-client.xml ?

                                    1 2 3 4 Previous Next