3 Replies Latest reply on Sep 6, 2002 7:48 AM by tdang

    EJB Client Problem

    rsuffling

      I am having problems getting my client application looking up a simple statefull sessionbean. My environment is:
      Windows2000
      jboss-3.0.0_tomcat-4.0.3
      jsdk1.4.0
      j2sdkee1.3.1

      The problem would appear to be which jar files to include in the class path. Does anyone have a definitive list of jar files to include in the CLASSPATH? Are jar files from j2sdkee1.3.1 required? Any help much appreciated.

      The jndi properties file contains:

      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.provider.url=jnp://localhost:1099/
      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
      # The jnp protocol socket factory class
      jnp.socketFactory=org.jnp.interfaces.TimedSocketFactory
      # The TimedSocketFactory connection timeout in milliseconds(0 == blocking)
      jnp.timeout=0
      # The TimedSocketFactory read timeout in milliseconds(0 == blocking)
      jnp.sotimeout=0

      The batch file I use is:

      @echo off
      set LCP=.
      REM Default locations of jars we depend on
      for %%i in (C:\jboss-3.0.0_tomcat-4.0.3\client\*.jar) do call lcp.bat %%i
      for %%i in (C:\jboss-3.0.0_tomcat-4.0.3\server\all\lib\*.jar) do call lcp.bat %%i
      REM for %%i in (..\client\*.jar) do call lcp.bat %%i
      REM This automatically adds system classes to CLASSPATH
      if exist C:\j2sdk1.4.0\lib\tools.jar set LCP=%LCP%;C:\j2sdk1.4.0\lib\tools.jar
      cd lib\client
      echo C:\j2sdk1.4.0\bin\java.exe -classpath "%LCP%" count.client.CountClient
      cd lib\client
      @C:\j2sdk1.4.0\bin\java.exe -classpath "%LCP%" count.client.CountClient
      cd ..\..


      The error message I get is:
      D:\MyProjects\MasteringEJBsII\StatefulSession>run-client.bat
      C:\j2sdk1.4.0\bin\java.exe -classpath ".;C:\jboss-3.0.0_tomcat-4.0.3\client\conc
      urrent.jar;C:\jboss-3.0.0_tomcat-4.0.3\client\gnu-regexp.jar;C:\jboss-3.0.0_tomc
      at-4.0.3\client\jaas.jar;C:\jboss-3.0.0_tomcat-4.0.3\client\jacorb.jar;C:\jboss-
      3.0.0_tomcat-4.0.3\client\jboss-client.jar;C:\jboss-3.0.0_tomcat-4.0.3\client\jb
      oss-common-client.jar;C:\jboss-3.0.0_tomcat-4.0.3\client\jboss-iiop-client.jar;C
      :\jboss-3.0.0_tomcat-4.0.3\client\jboss-j2ee.jar;C:\jboss-3.0.0_tomcat-4.0.3\cli
      ent\jboss-jsr77.jar;C:\jboss-3.0.0_tomcat-4.0.3\client\jboss-net-client.jar;C:\j
      boss-3.0.0_tomcat-4.0.3\client\jboss-system-client.jar;C:\jboss-3.0.0_tomcat-4.0
      .3\client\jbossha-client.jar;C:\jboss-3.0.0_tomcat-4.0.3\client\jbossmq-client.j
      ar;C:\jboss-3.0.0_tomcat-4.0.3\client\jbossmqha.jar;C:\jboss-3.0.0_tomcat-4.0.3\
      client\jbosssx-client.jar;C:\jboss-3.0.0_tomcat-4.0.3\client\jcert.jar;C:\jboss-
      3.0.0_tomcat-4.0.3\client\jmx-connector-client-factory.jar;C:\jboss-3.0.0_tomcat
      -4.0.3\client\jmx-ejb-connector-client.jar;C:\jboss-3.0.0_tomcat-4.0.3\client\jm
      x-rmi-connector-client.jar;C:\jboss-3.0.0_tomcat-4.0.3\client\jnet.jar;C:\jboss-
      3.0.0_tomcat-4.0.3\client\jnp-client.jar;C:\jboss-3.0.0_tomcat-4.0.3\client\jsse
      .jar;C:\jboss-3.0.0_tomcat-4.0.3\client\log4j.jar;C:\j2sdk1.4.0\lib\tools.jar" c
      ount.client.CountClient
      The system cannot find the path specified.
      Looking up the homeObject
      javax.naming.CommunicationException. Root exception is java.lang.ClassNotFoundE
      xception: count.ejb.CountHome (no security manager: RMI class loader disabled)
      at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:521)
      at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:6
      37)
      at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:309
      )
      at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStrea
      m.java:241)
      at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1459)
      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1422)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
      616)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1264)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:322)
      at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
      at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:3
      0)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:449)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:429)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      at count.client.CountClient.main(Unknown Source)

      The batch

        • 1. Re: EJB Client Problem

          Looks like you've included everything except your
          ejb's home/remote interfaces.

          jboss\client contains all the jars for the client side.

          Regards,
          Adrian

          • 2. Re: EJB Client Problem
            tdang

            I think there are not a full list of jar files for the CLASSPATH because it varies from client to client. Here are the jar files needing for my client:

            - %JBOSS_INSTALL%\server\default\lib\jboss.jar
            - %JBOSS_INSTALL%\server\default\lib\jaas.jar
            - %JBOSS_INSTALL%\server\default\lib\log4j.jar
            - %JBOSS_INSTALL%\server\default\lib\jboss-j2ee.jar
            - %JBOSS_INSTALL%\server\default\lib\jnpserver.jar
            - %JBOSS_INSTALL%\client\jboss-common-client.jar
            - %JBOSS_INSTALL%\client\jbosssx-client.jar

            That's all what my client needs. I do not need any other jar files, even from from Sun j2sdkee1.3.1.

            NOTE: Instead of j2ee.jar from Sun j2sdkee1.3.1 you have to use jboss-j2ee.jar from JBoss.

            Hope it helps!

            • 3. Re: EJB Client Problem
              tdang

              I think there are not a full list of jar files for the CLASSPATH because it varies from client to client. Here are the jar files needing for my client:

              - %JBOSS_INSTALL%\server\default\lib\jboss.jar
              - %JBOSS_INSTALL%\server\default\lib\jaas.jar
              - %JBOSS_INSTALL%\server\default\lib\log4j.jar
              - %JBOSS_INSTALL%\server\default\lib\jboss-j2ee.jar
              - %JBOSS_INSTALL%\server\default\lib\jnpserver.jar
              - %JBOSS_INSTALL%\client\jboss-common-client.jar
              - %JBOSS_INSTALL%\client\jbosssx-client.jar

              That's all what my client needs. I do not need any other jar files, even from from Sun j2sdkee1.3.1.

              NOTE: Instead of j2ee.jar from Sun j2sdkee1.3.1 you have to use jboss-j2ee.jar from JBoss.

              Hope it helps!