I just installed Tomcat 4.0.4 and JBoss 3.0.2 seperately.
I am trying to create a sample application to check out my setup. I keep getting the following exception whenever I call this method from my servlet:
private TestSession getSessionBean(){
TestSession myBean = null;
try{
Hashtable props = new Hashtable();
props.put(InitialContext.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
props.put(InitialContext.PROVIDER_URL,
"jnp://127.0.0.1:1099");
InitialContext initialContext =
new InitialContext(props);
TestSessionHome testSessionHome=
(TestSessionHome)initialContext.lookup
(foss.ljf.test.ejb.TestSessionHome.JNDI_NAME);
myBean = testSessionHome.create();
}catch(Exception ex){
ex.printStackTrace();
}
return myBean;
}
log4j:WARN Loader.class.getClassLoader returned null!
javax.naming.CommunicationException. Root exception is java.lang.ClassNotFoundException: foss.ljf.test.ejb.TestSessionHome (no security manager: RMI class loader disabled)
I added the following to the setclasspath.bat:
set JAVA_OPTS=-Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory -Djava.naming.provider.url=localhost:1099 -Djava.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
I already added the following files to %TOMCAT_HOME%\common\lib:
jboss-j2ee.jar
jboss-client.jar
jbosssx-client.jar
jnp-client.jar
jboss-common-client.jar
log4j.jar
Is this a class path problem?
Is there something else I need to setup in JBoss?
Do I need to add the above file to another directory?
I don't really care about security at this time.