Clever.  They're using the security Access Controller to set the context
classloader to the servlet class loader.  Every class load will trigger a
SecurityManager call that runs this special Privilege that sets the
classloader.  It will work with any Java2 system BTW.

Thanks for the info, it fixed my problem.

Cheers
Chris Audley
Urbanfetch.com

-----Original Message-----
From: Aaron Mulder [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 13, 2000 5:42 PM
To: jBoss
Subject: Re: [jBoss-User] Connecting to jBoss from Tomcat 3.2b3


        If you're running Tomcat under JDK 1.2.2+, look at the Tomcat link
on the jBoss web page.  You can ignore most of it, since it's intended for
people running jBoss and Tomcat in the same VM, but there is a section on
adding a JDK 1.2 request interceptor to Tomcat's server.xml that you
should follow.  This will fix your ClassLoader problems.

Aaron

On Wed, 13 Sep 2000, Chris Audley wrote:
> I've implemented a simple stateless session EJB for jBoss and successfully
> deployed it.  I have a simple test program and I'm able to connect to the
> bean with no problem.  However, now that I'm trying to run the bean from
> Tomcat, I'm experiencing class loader problems.  I'm running tomcat
> separately from jBoss, but on the same machine ( RH Linux 6.1 with Sun jdk
> 1.3 from 9/7 ).
> 
> I can connect to JnP with no problem, but when I try to lookup the Home
> interface I get a class not found exception.  I can see from the stack
trace
> ( below ) that the rmi code is trying to find the home interface in the
> CLASSPATH classloader, not the webapp specific class loader.
> 
> Can anyone think of a solution to this problem?
> 
> Cheers
> Chris Audley
> 
> LocationService naming context unavailable -
> javax.naming.CommunicationException.  Root exception is
> java.lang.ClassNotFoundException: com.ufexpress.addr.LocationServiceHome
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
>         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
>         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:195)
>         at
>
sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:
> 183)
>         at
>
java.io.ObjectInputStream.inputProxyClassDescriptor(ObjectInputStream.java:9
> 82)
>         at
java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
>         at
java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
>         at
> java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1186)
>         at
java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
>         at
java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
>         at java.rmi.MarshalledObject.get(MarshalledObject.java:138)
>         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:284)
>         at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:265)
>         at javax.naming.InitialContext.lookup(InitialContext.java:350)
>         at java.lang.reflect.Method.invoke(Native Method)
>         at
>
com.ufexpress.retail.PooledInitialContext.invoke(PooledInitialContext.java:1
> 08)
>         at $Proxy0.lookup(Unknown Source)
>         at
> com.ufexpress.retail.OrderEntryAction.perform(OrderEntryAction.java:97)
>         at
>
org.apache.struts.action.ActionServlet.processActionInstance(ActionServlet.j
> ava:793)
>         at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:702)
>         at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:332)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
> org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:387)
>         at org.apache.tomcat.core.Handler.service(Handler.java:263)
>         at
> org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:371)
>         at
>
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:74
> 9)
>         at
> org.apache.tomcat.core.ContextManager.service(ContextManager.java:695)
>         at
>
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
> onnectionHandler.java:207)
>         at
> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:403)
>         at
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
>         at java.lang.Thread.run(Thread.java:484)
> 
> 
> --
> --------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Problems?:           [EMAIL PROTECTED]
> 



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to