JBoss 2.4.1 + Catalina 4.01 ... a no go?!?
franktv Oct 25, 2001 4:17 PMHello all!
I'm running out of options trying to use Jboss 2.4.1 with Catalina 4.01 (running in separate VMs on the same WinNT box). I have a simple stateless session bean that I know works (works fine from standard Java client) hosted in Jboss. The problem is (there's always a problem right) that I am unable to use the same lookup code from a simple JSP client hosted in Catalina. I can get the Initial Context, but get errors when I try to lookup the Home interface of my bean. I have all the appropriate jboss-client jars in myapp/web-inf/lib in Catalina and am starting Catalina with the -nonaming option. Still no success.
My JSP code:
<%
System.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
System.setProperty("java.naming.provider.url", "jnp://localhost:1099");
System.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
try
{
out.print("Begin");
InitialContext ic = new InitialContext();
out.print("Got context");
out.print("java.naming.factory.initial=" + System.getProperty("java.naming.factory.initial") + "");
out.print("java.naming.provider.url=" + System.getProperty("java.naming.provider.url") + "");
out.print("java.naming.factory.url.pkgs=" + System.getProperty("java.naming.factory.url.pkgs") +
"");
Object ref = ic.lookup("MyBean");
out.print("Got reference");
MyBeanHome home = (MyBeanHome) PortableRemoteObject.narrow (ref, MyBeanHome.class);
MyBean ejbMyBean = home.create();
out.print("Home object created");
out.print("It works!");
}
catch(Exception e)
{
e.printStackTrace();
out.print(e.toString());
}
%
Output it produces:
Begin
Got context
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
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]
I've seen various posts on the Tomcat & JBoss lists regarding problems with JNDI and such ... but nothing quite like this problem. Can someone kindly tell me if this is a bug ... or am I doing something wrong that I just can't see. Thanks a million!
- Frank