4 Replies Latest reply on Aug 23, 2006 10:09 PM by NGUYEN MINH

    urgent naming problem

    NGUYEN MINH Newbie

      I develope a web application in pc - ip 10.0.92.6 by Jbuilder. This machine also install Jboss server 4.0.4. and have ejb: CheckLogin (session Bean)
      Jboss.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN" "http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd">


      <enterprise-beans>

      <ejb-name>CheckLogin</ejb-name>
      <jndi-name>ejb/CheckLogin</jndi-name>

      </enterprise-beans>


      I have deployed this ejb successfully.
      Then i use Jbuilder to build a servlet srvletLogin:
      ....
      System.setProperty("java.naming.factory.url.pkgs",
      "org.jnp.interfaces");

      System.setProperty("java.naming.factory.initial",
      "org.jnp.interfaces.NamingContextFactory");
      System.setProperty("java.naming.provider.url", "10.0.92.6:1099");

      Context ic = new InitialContext();
      Object object = ic.lookup("ejb/CheckLogin");

      ....

      This servlet work fine when run by Jbuilder. Now i build War file contain that servlet and deploy it in tomcat 5.5.17 server ai pc - ip : 10.0.92.116. But now i have error at statement: Object object = ic.lookup("ejb/CheckLogin");

      web.xml source:
      <?xml version="1.0" encoding="UTF-8"?>
      <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
      <display-name>Web App</display-name>

      <servlet-name>jsvllogin</servlet-name>
      <servlet-class>Servlet.jsvllogin</servlet-class>

      <servlet-mapping>
      <servlet-name>jsvllogin</servlet-name>
      <url-pattern>/jsvllogin</url-pattern>
      </servlet-mapping>
      <ejb-ref>
      <ejb-ref-name>ejb/CheckLogin</ejb-ref-name>
      <ejb-ref-type>Session</ejb-ref-type>
      TxEjb.CheckLoginHome
      TxEjb.CheckLogin
      <ejb-link>CheckLogin</ejb-link>
      </ejb-ref>
      <session-config>
      <session-timeout>6000</session-timeout>
      </session-config>
      </web-app>


      Any one can help me?

        • 1. Re: urgent naming problem
          Peter Johnson Master

          Please post the exception and stack trace.

          • 2. Re: urgent naming problem
            NGUYEN MINH Newbie

            Below is stacktrace:

            javax.naming.CommunicationException [Root exception is java.rmi.RemoteException: Service unavailable.]
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:722)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
            at javax.naming.InitialContext.lookup(Unknown Source)
            at Servlet.jsvllogin.doGet(jsvllogin.java:59)
            at Servlet.jsvllogin.doPost(jsvllogin.java:107)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
            at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
            at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
            at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
            at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
            at java.lang.Thread.run(Unknown Source)
            Caused by: java.rmi.RemoteException: Service unavailable.
            at org.jboss.ha.framework.interfaces.HARMIClient.invokeRemote(HARMIClient.java:213)
            at org.jboss.ha.framework.interfaces.HARMIClient.invoke(HARMIClient.java:267)
            at $Proxy0.lookup(Unknown Source)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
            ... 20 more

            • 3. Re: urgent naming problem
              NGUYEN MINH Newbie

              Sorry i forgot to turn on jboss server. Below is stacktrace:

              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: Files/Apache]
              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:722)
              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
              at javax.naming.InitialContext.lookup(Unknown Source)
              at Servlet.jsvllogin.doGet(jsvllogin.java:59)
              at Servlet.jsvllogin.doPost(jsvllogin.java:107)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
              at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
              at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
              at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
              at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
              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: Files/Apache
              at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:325)
              at sun.rmi.transport.Transport$1.run(Transport.java:153)
              at java.security.AccessController.doPrivileged(Native Method)
              at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
              at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
              at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
              at java.lang.Thread.run(Thread.java:595)
              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:625)
              ... 20 more
              Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
              java.net.MalformedURLException: no protocol: Files/Apache
              at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:282)
              at sun.rmi.transport.Transport$1.run(Transport.java:153)
              at java.security.AccessController.doPrivileged(Native Method)
              at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
              at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
              at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
              at java.lang.Thread.run(Thread.java:595)
              Caused by: java.net.MalformedURLException: no protocol: Files/Apache
              at java.net.URL.(URL.java:567)
              at java.net.URL.(URL.java:464)
              at java.net.URL.(URL.java:413)
              at sun.rmi.server.LoaderHandler.pathToURLs(LoaderHandler.java:747)
              at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:147)
              at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620)
              at org.jboss.system.JBossRMIClassLoader.loadClass(JBossRMIClassLoader.java:91)
              at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247)
              at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197)
              at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1543)
              at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1465)
              at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1698)
              at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1304)
              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:349)
              at javax.naming.CompoundName.readObject(CompoundName.java:554)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946)
              at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1818)
              at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1718)
              at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1304)
              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:349)
              at sun.rmi.server.UnicastRef.unmarshalValue(UnicastRef.java:290)
              at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:279)
              ... 6 more

              • 4. Re: urgent naming problem
                NGUYEN MINH Newbie

                Oh, it's ok now, that's because of installing tomcat in directory containing spaces