9 Replies Latest reply on Dec 4, 2007 1:34 PM by gavin cai

    call a remote EJB

    Roberto Perencio Newbie

      hi everybody
      i have a problem trying to lookup an EJB from a standalone client, using the queue example of JBoss.
      I do this:

      ic = new InitialContext();
      fe = (Interface)ic.lookup("/JndiName");

      in jndi.properties i set the server url properly in this way:

      I get this excpetion:
       [java] java.lang.reflect.UndeclaredThrowableException
       [java] at $Proxy0.getUtenteByID(Unknown Source)
       [java] at org.jboss.example.jms.queue.QueueExample.example(QueueExample
       [java] at org.jboss.example.jms.common.ExampleSupport.run(ExampleSuppor
       [java] at org.jboss.example.jms.queue.QueueExample.main(QueueExample.ja
       [java] Caused by: java.lang.Exception: Can not make remoting client invocat
      ion due to not being connected to server.
       [java] at org.jboss.remoting.Client.invoke(Client.java:611)
       [java] at org.jboss.remoting.Client.invoke(Client.java:599)
       [java] at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(Inv
       [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInv
       [java] at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(Cl
       [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInv
       [java] at org.jboss.aspects.security.SecurityClientInterceptor.invoke(S
       [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInv
       [java] at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInte
       [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInv
       [java] at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(Stateles

      Any suggestion?

        • 1. Re: call a remote EJB
          Ronald Sigal Master

          Hi Bob,

          I'm not sure what I'm looking at here. The JBossMessaging Queue example itself doesn't have anything to do with EJB's - it's a pure jms example. So maybe you adapted it to do something other than produce and consume a message? If so, can you give some more information?

          Does the unmodified Queue example run for you?

          • 2. Re: call a remote EJB
            Sebastian Schnabl Newbie


            i have exactly the same problem in my standalone java-client. Same exception, when i try to call a method of a remote-ejb.

            Error occurrs only since and with jboss 4.20CR1 "official released" Version. Before we used a svn-checkout of 4.20 from around November 06, and this version didn't make this problem.

            using following initial-context settings:

            public static Context getInitialContext()
             throws javax.naming.NamingException {
             Properties env = new Properties();
             env.put(Context.PROVIDER_URL, "jnp://");
             env.put(Context.SECURITY_PRINCIPAL, "admin");
             env.put(Context.SECURITY_CREDENTIALS, "admin");
             return new InitialContext(env);

            Ejb-reference lookup seems to be ok, but when i try to call a concrete method of the ejb-reference, jboss throws error above.

            Any idea ?

            • 3. Re: call a remote EJB
              Sebastian Schnabl Newbie

              It seems for me like a problem with the DEFAULT the classpath and/or included jars, which ECLIPSE 3.2 per default sets for the test-client.

              If i manually add all necessary jars of jboss to my test client project, then programm will run ok. But if i let eclipse determine the classpath (via Button "default"), the above error will thrown.

              Remember: This misbehaivor only occurs with jboss 4.20CR1 release of march 07, NOT with svn-checkout of november 06.

              • 4. Re: call a remote EJB

                I met with this problem while using JBossAOP 1.3 Libraries provided by JBossIDE-1.5-ALL. Removing the libraies and add those jars in ${jboss.home}/client, it works. Not sure which jar causes this problem, maybe jboss-aspect-library-jdk50.jar

                • 5. Re: call a remote EJB
                  Ronald Sigal Master

                  The exception

                  java.lang.Exception: Can not make remoting client invocation due to not being connected to server

                  is thrown when org.jboss.remoting.Client.invoke() is called before Client.connect() is called. This restriction exists in Remoting versions 2.0.0 and above, but not before. The current version of org.jboss.aspects.remoting.InvokeRemoteInterceptor, which comes with JBossAS 4.2, calls Client.connect(), but the version that comes with JBossAS 4.0.5 does not.

                  InvokeRemoteInterceptor is found in jboss-4.2.0.GA/server/default/deploy/jboss-aop-jdk50.deployer/jboss-aspect-library-jdk50.jar and jboss-4.2.0.GA/client/jboss-aspect-jdk50-client.jar. Make sure you're using the correct versions of these jars.


                  • 6. Re: call a remote EJB
                    Sebastian Schnabl Newbie

                    It seems, only version 1.3 of jboss-aspect-library-jdk50.jar comes bundled with actual jboss-ide 2.0.0Beta2. See eclipse-plugin org.jboss.ide.jdt.aop.core_1.2.0.Beta2 in ECLIPS_HOME/plugins-folder ...

                    • 7. Re: call a remote EJB
                      Ronald Sigal Master

                      I've posted a note on the jboss-ide forum,


                      about using a newer version of jboss-aspect-library-jdk50.jar in their next release.


                      • 8. Re: call a remote EJB
                        Xie Deping Newbie

                        copy \jboss-4.2.0.GA\server\all\deploy\jboss-aop-jdk50.deployer\jboss-aspect-library-jdk50.jar

                        then ,it's OK.

                        • 9. Re: call a remote EJB
                          gavin cai Newbie

                          i meet the same problem .my env:JBOSS 2.0 BETA2 +JBOSS4.2.2
                          but in Jboss4.2.2GA ok.