9 Replies Latest reply on Nov 11, 2003 8:21 PM by yerunlong

    use ebj deployed on another machine

    yerunlong Newbie

      hi all
      i deployed application which include an ejb and its testing web page - ejbtest.jsp on jboss server 3.2, it works well, it didn't work when i deployed another web page -ejbtest1.jsp on another machine(only tomcat server5.0 installed on it). pls help me

        • 1. Re: use ebj deployed on another machine
          Jon Barnett Master

          It is difficult to tell as you haven't indicated the global JNDI naming for your EJB.

          Normally, you'd use the following for a remote client:
          env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
          env.put(Context.PROVIDER_URL, "jnp://180.0.8.12:1099");
          env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces" );

          env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
          env.put(Context.PROVIDER_URL, "180.0.8.12:1099");
          env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces" );

          You also need to put jbossall-client.jar in the shared/lib directory for Tomcat so it can perform the lookup, like any other remote client.

          Otherwise, post the stacktrace for the error and the global JNDI binding for the EJB.

          • 2. Re: use ebj deployed on another machine
            yerunlong Newbie

            thank you very much, jonlee

            i upload the lastest ejbtest1.jsp and ejb deploy files together for your checking, here is the error stack trace :

            javax.naming.CommunicationException [Root exception is java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
            java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
            java.net.MalformedURLException: no protocol: 5.0/shared/classes/]
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:647)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
            at javax.naming.InitialContext.lookup(Unknown Source)
            at org.apache.jsp.ejbtest.ejbtest_jsp._jspService(ejbtest_jsp.java:65)
            at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:563)
            at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:563)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:563)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
            at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
            at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:563)
            at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
            at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:209)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:670)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:517)
            at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:575)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
            at java.lang.Thread.run(Unknown Source)
            Caused by: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
            java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
            java.net.MalformedURLException: no protocol: 5.0/shared/classes/
            at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
            at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
            at sun.rmi.server.UnicastRef.invoke(Unknown Source)
            at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:528)
            ... 33 more
            Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
            java.net.MalformedURLException: no protocol: 5.0/shared/classes/
            Caused by: java.net.MalformedURLException: no protocol: 5.0/shared/classes/


            in addition jbossall-client.jar has been deployed and what global JNDI you mentioned means, jonlee


            • 3. Re: use ebj deployed on another machine
              yerunlong Newbie

              attached files

              • 4. Re: use ebj deployed on another machine
                Jon Barnett Master

                Your global JNDI is specified by:
                <jndi-name>cliffordejb/encryptbean</jndi-name>

                Normally, within J2EE deployments, components use a local name that points to the global name. It allows some flexibility for components changing the global JNDI binding.

                Anyway, your problem seems to be tied to the protocol - meaning you aren't even getting to the JNDI lookup problem. Try specifying jnp://180.0.8.12:1099 for the URL.

                • 5. Re: use ebj deployed on another machine
                  yerunlong Newbie

                  specifying jnp://180.0.8.12:1099 for the URL does not work also.
                  is tomcat j2ee-compatable web container? it works well with java application and throws exception with web application.

                  • 6. Re: use ebj deployed on another machine
                    Jon Barnett Master

                    Hang on. My bad. I should have picked this up.

                    I'm guessing you are running at least one of your systems in a Windows environment. Probably Tomcat 5.0. The bad protocol is due to a directory path for your installation containing a space. For your J2EE systems and for your Java (to be on the safe side), it is best that all of these are installed in a path name that contains no spaces.

                    The thing that gives it away - 5.0/shared/classes. That should probably be a directory, Tomcat 5.0/shared/classes. JNDI and RMI has a hard time with the space. Anyway, let us know if reinstalling all your Java and Java application installations to directories without spaces fixes your problem.

                    • 7. Re: use ebj deployed on another machine
                      yerunlong Newbie

                      you are right that both of my jboss server and client tomcat server are running on windows 2k professional.
                      it seemed to be solved when i finished reinstalling tomcat 5.0 onto a directory without space, a new exception has been throwed:

                      javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: EncryptHome (no security manager: RMI class loader disabled)]
                      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:652)
                      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
                      at javax.naming.InitialContext.lookup(InitialContext.java:347)
                      at org.apache.jsp.ejbtest.ejbtest1_jsp._jspService(ejbtest1_jsp.java:65)
                      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
                      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
                      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
                      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:284)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:204)
                      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
                      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
                      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:563)
                      at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:245)
                      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:199)
                      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
                      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:563)
                      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:195)
                      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
                      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
                      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
                      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:563)
                      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
                      at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
                      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:563)
                      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
                      at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:209)
                      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:670)
                      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:517)
                      at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:575)
                      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
                      at java.lang.Thread.run(Thread.java:534)
                      Caused by: java.lang.ClassNotFoundException: EncryptHome (no security manager: RMI class loader disabled)
                      at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:531)
                      at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:639)
                      at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:309)
                      at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:241)
                      at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1469)
                      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1432)
                      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
                      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
                      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
                      at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
                      at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:30)
                      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:550)
                      ... 33 more

                      any suggestions about that?



                      • 8. Re: use ebj deployed on another machine
                        Jon Barnett Master

                        Did you include your interfaces (classes) like EncryptHome (and probably Encrypt if you follow some sort of EJB naming convention) in the remote application? Normally, you would package up the client-code as a client JAR and put them in your WAR's WEB-INF/lib.

                        • 9. Re: use ebj deployed on another machine
                          yerunlong Newbie

                          thanks for your kindly help, jonlee!
                          it is working fine now. to conclude, it is recommend to install tomcat5.0 on to directories without space.