EJB Client Problem
rsuffling Sep 5, 2002 2:26 PMI 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