6 Replies Latest reply on Jun 21, 2007 7:50 AM by Carlo de Wolf

    Client accessing EJB3 via RMIoverHTTTP on Port 80

    Sandor Fiedler Newbie

      Hi folks,

      I am trying to figure this out for a month and no success so far. We are having a Swing-Client with the need for accessing EJB3 Stateless Session Beans over HTTP only on port 80 (because of the use of different firewalls).

      Solving the problem to get JNDI-Lookup over HTTP was quiet easy. But all delivered poxies trying to connect via socket://${jboss.bind.address}:3878 as configured in ejb3.deployer/META-INF/jboss-service.xml.

      The use of @RemoteBinding(clientBindUrl=ext-ip:port) is as bad as stated in other posts throughout this forum. In fact we need a configuration within a configfile (i.e. jboss.xml, jboss-service.xml,etc.).

      Could any one push me in the right direction?

      Regards Sandor

        • 1. Re: Client accessing EJB3 via RMIoverHTTTP on Port 80
          Morten Hauch Newbie

          Hi,

          As far as I understand all you have to do is change
          socket://${jboss.bind.address}:3873
          to
          http://${jboss.bind.address}:80
          in ejb3.deployer/META-INF/jboss-service.xml.

          You can read more about JBoss remoting in
          http://labs.jboss.com/file-access/default/members/jbossremoting/freezone/docs/guide/JBoss_Remoting_Guide.pdf
          and
          http://www.onjava.com/pub/a/onjava/2005/02/23/remoting.html

          • 2. Re: Client accessing EJB3 via RMIoverHTTTP on Port 80
            Sandor Fiedler Newbie

            Thanks for replying, but it seems there is more needed.

            I testet the mentioned and got the following error on startup

            08:55:45,172 WARN [ServiceController] Problem creating service jboss.remoting:type=Connector,name=DefaultEjb3Connector,handler=ejb3
            java.lang.NoClassDefFoundError: org/apache/coyote/Adapter
             at java.lang.ClassLoader.defineClass1(Native Method)
             at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
             at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
             at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
             at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
             at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
             at java.security.AccessController.doPrivileged(Native Method)
             at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
             at org.jboss.mx.loading.RepositoryClassLoader.findClassLocally(RepositoryClassLoader.java:675)
             at org.jboss.mx.loading.RepositoryClassLoader.findClass(RepositoryClassLoader.java:655)
             at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
             at org.jboss.mx.loading.RepositoryClassLoader.loadClassLocally(RepositoryClassLoader.java:193)
             at org.jboss.mx.loading.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:131)
             at org.jboss.mx.loading.LoadMgr3.nextTask(LoadMgr3.java:399)
             at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:520)
             at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:408)
             at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
             at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
             at java.lang.Class.getDeclaredConstructors0(Native Method)
             at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
             at java.lang.Class.getConstructor0(Class.java:2671)
             at java.lang.Class.newInstance0(Class.java:321)
             at java.lang.Class.newInstance(Class.java:303)
             at org.jboss.remoting.InvokerRegistry.loadServerInvoker(InvokerRegistry.java:436)
            ...
            

            Any ideas?
            Sandor

            • 3. Re: Client accessing EJB3 via RMIoverHTTTP on Port 80
              Sandor Fiedler Newbie

              In addition to my last post is here the exception stack trace when calling from client side:

              Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.String
               at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:62)
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
               at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
               at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
               at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:72)
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
               at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:103)
               at $Proxy1.login(Unknown Source)
              

              However the delivered proxy is configured right. Is there an unmarshaller missing. How would this get configured.

              Sandor

              • 4. Re: Client accessing EJB3 via RMIoverHTTTP on Port 80
                Sandor Fiedler Newbie

                After a bit more investigating I've a solution here
                http://wiki.jboss.org/wiki/Wiki.jsp?page=Accessing_EJB3s_over_HTTP_HTTPS

                This works so far but the next step is to eliminate the JBoss specific annotation

                @RemoteBinding(clientBindUrl="0.0.0.0:80/servlet-invoker/ServerInvokerServlet")

                by using a configuration in - lets say - jboss.xml.

                Question: How is this annotation expressed as per a deployment descriptor?

                Any hints?

                Regards
                Sandor

                • 5. Re: Client accessing EJB3 via RMIoverHTTTP on Port 80
                  Sandor Fiedler Newbie

                  Hi all,

                  I've found that there was a JIRA-Issue on defining a xml equivalent for @RemoteBinding.clientBindUrl but I'm unable to find any docs.

                  Could anyone please push me in the right direction.

                  Regards
                  Sandor