It was tomcat 3.1.  Thanks for the explanation.  

-----Original Message-----
From: Richard Backhouse [mailto:[EMAIL PROTECTED]]
Sent: Sunday, December 17, 2000 9:13 AM
To: jBoss
Subject: Re: [jBoss-User] RE: standalone tomcat classloader issues?


If you look at the code for the Jdk12Interceptor (it comes with the binary
version of tomcat) you will see that all it really does is set
the context class loader for every request. It applies to jdk 1.2 and above.
This is because the Thread.setContextClassLoader() was
added to the jdk for 1.2. The reason you need it with jboss access is that
the
jndi code uses Thread.getContextClassLoader to load the
jndi implementation. If you place the jndi impl class jar in your
web-inf/lib
directory then then classloader for this web app needs to be
the context classloader. Thus setting it for every request is required
because
you don't know which thread is going to be used to call
your servlet/jsp.

By the way the Jdk12Interceptor was only introduced for Tomcat 3.2 and
above. I
rememeber running tomcat 3.1 standalone with
jboss without needing anything like this. I don't know for sure but probably
a
different classloader architecture was beeing used.

Richard Backhouse

Jay Walters wrote:

> Why is this interceptor named Jdk12Interceptor if you need it when you're
> running JDK 1.3 at both ends?  I suppose I should ask the Tomcat folks
this,
> but is it some type of JDK 1.2 emulation?  Seems interesting to me at
least.
>
> -----Original Message-----
> From: Richard Backhouse [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 15, 2000 10:33 PM
> To: jBoss
> Subject: Re: [jBoss-User] RE: standalone tomcat classloader issues?
>
> Actually looking at code the for the EmbeddedTomcatService it nows adds
> its own request
> interceptor that does similar logic to what the Jdk12Interceptor does.
> Older versions did add the
> Jdk12Interceptor though.
>
> Richard Backhouse wrote:
> >
> > You do if you run tomcat standalone. If you check out the code for the
> > EmbeddedTomcat Service you
> > will see that it adds this request interceptor for you.
> >
> > Jay Walters wrote:
> > >
> > > If you're running everything on 1.3 you don't need the
Jdk12Interceptor
> (at
> > > least I haven't).
> > >
> > > -----Original Message-----
> > > From: Richard Backhouse [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, December 15, 2000 6:57 PM
> > > To: jBoss
> > > Subject: Re: [jBoss-User] RE: standalone tomcat classloader issues?
> > >
> > > Chris,
> > >
> > > Here is what I have had to do to get my web app talking to jboss via
> tomcat
> > > standalone :
> > >
> > > 1.Add jndi.properties to the bin directory of tomcat
> > > 2. Add the Jdk12Interceptor request interceptor to the server.xml
file.
> > > 3 Make sure that the jndi.properties has the java.naming.provider.url
> line
> > > uncommented and set to the host that the jboss server is running on
(If
> same
> > > machine then just localhost)
> > > 4 Add the jboss client jars (jboss-client.jar, jnp-client.jar) to the
> > > WEB-INF/lib of the warfile
> > > 5 Add ejb.jar and jta-spec1_0_1.jar to WEB-INF/lib of the war file
> > > 6. If you are running jdk1.2 for the Tomcat vm then you will also need
> > > jndi.jar.
> > >
> > > Hope this helps
> > >
> > > Richard Backhouse
> > > Oak Grove Software
> > >
> > > Chris Wilson wrote:
> > >
> > > > sorry,
> > > >
> > > > i forgot to mention what stuff i was running.  i'm using jboss 2.0
> final,
> > > > tomcat 3.2.1, jdk 1.3 on win 2000
> > > >
> > > > cheers,
> > > > chris
> > > >
> > > > | chris wilson || web dev ||| www.wondergeek.com || |
> > > >
> > > > > -----Original Message-----
> > > > > From: Chris Wilson [mailto:[EMAIL PROTECTED]]
> > > > > Sent: Friday, December 15, 2000 10:51 AM
> > > > > To: [EMAIL PROTECTED]
> > > > > Subject: standalone tomcat classloader issues?
> > > > >
> > > > >
> > > > > hello,
> > > > >
> > > > > i've just started using jboss and tomcat.  i have jboss and
> > > > > tomcat running separately (no integration) and am attempting to
> > > > > access ejb's from a jsp.
> > > > >
> > > > > i followed the instructions at jboss.org that told me to put the
> > > > > jboss client files and my ejb interfaces into the WEB-INF/lib
> > > > > directory of my webapp.  however, when i do that, i get a
> > > > > ClassNotFound exception when trying to load the
> > > > > org.jnp.interfaces.NamingContextFactory.  if i put my files in
> > > > > tomcat's main lib directory, then everything works fine.  i don't
> > > > > want to do this however for two reasons: (1) the docs said it
> > > > > should go in WEB-INF/lib and (2) i can't pack up my app into a
> > > > > war if the classes have to be in the global lib directory.
> > > > >
> > > > > i've searched archives regarding this issue and from what i could
> > > > > tell, it's a class loader problem?
> > > > >
> > > > > anyone have any ideas what i'm doing wrong?  thanks for the help
> > > > > in advance!
> > > > >
> > > > > here is the list of file in my WEB-INF/lib:
> > > > >
> > > > > 11/14/2000  07:12p               7,958 ejb.jar
> > > > > 12/14/2000  03:23p               4,435 its.jar
> > > > > 11/14/2000  07:12p              71,549 jboss-client.jar
> > > > > 11/14/2000  07:12p              14,294 jnp-client.jar
> > > > > 11/14/2000  07:12p               8,809 jta-spec1_0_1.jar
> > > > > 12/15/2000  09:42a              23,348 kronos-ext.jar
> > > > > 12/15/2000  09:42a               7,371 kronos.jar
> > > > > 12/14/2000  02:36p               3,341 wondergeek.jar
> > > > >
> > > > >
> > > > > here is my jsp code causing the error:
> > > > >
> > > > > Hashtable env = new Hashtable();
> > > > > env.put("java.naming.factory.initial",
> > > > > "org.jnp.interfaces.NamingContextFactory");
> > > > > env.put("java.naming.provider.url", "localhost:1099");
> > > > > env.put("java.naming.factory.url.pkgs", "org.jboss.naming");
> > > > > Context context = new InitialContext(env);
> > > > > // i don't think i even ever get here...
> > > > > Object ref = context.lookup("KronosServerBean");
> > > > > KronosServerHome kh =
> > > > > (KronosServerHome)PortableRemoteObject.narrow(ref,
> > > > > KronosServerHome.class);
> > > > > KronosServer ks = kh.create();
> > > > >
> > > > >
> > > > > and here is the stacktrace from tomcat:
> > > > >
> > > > > Internal Servlet Error:
> > > > >
> > > > > javax.servlet.ServletException: Cannot instantiate class:
> > > > > org.jnp.interfaces.NamingContextFactory
> > > > >       at
> > > > > org.apache.jasper.runtime.PageContextImpl.handlePageException(Page
> > > > > ContextImpl.java:459)
> > > > >       at
> > > > > _0002findex_0002ejspindex_jsp_30._jspService(_0002findex_0002ejspi
> > > > > ndex_jsp_30.java:89)
> > > > >       at
> > > > >
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
> > > > >       at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > > > >       at
> > > > > org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(Jsp
> > > > > Servlet.java:177)
> > > > >       at
> > > > >
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
> > > > >       at
> > > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
> > > > >       at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > > > >       at
> > > > >
> org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
> > > > >       at org.apache.tomcat.core.Handler.service(Handler.java:286)
> > > > >       at
> > > > >
> org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
> > > > >       at
> > > > > org.apache.tomcat.core.ContextManager.internalService(ContextManag
> > > > > er.java:797)
> > > > >       at
> > > > >
> org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
> > > > >       at
> > > > > org.apache.tomcat.service.http.HttpConnectionHandler.processConnec
> > > > > tion(HttpConnectionHandler.java:210)
> > > > >       at
> > > > >
> > >
> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
> > > > >       at
> > > > >
> > >
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
> > > > >       at java.lang.Thread.run(Thread.java:484)
> > > > >
> > > > > Root cause:
> > > > > javax.naming.NoInitialContextException: Cannot instantiate class:
> > > > > org.jnp.interfaces.NamingContextFactory.  Root exception is
> > > > > java.lang.ClassNotFoundException:
> > > org.jnp.interfaces.NamingContextFactory
> > > > >       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
> > > > >
> > >
> com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:45)
> > > > >       at
> > > > >
> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:655)
> > > > >       at
> > > > >
> javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
> > > > >       at javax.naming.InitialContext.init(InitialContext.java:222)
> > > > >       at javax.naming.InitialContext.(InitialContext.java:198)
> > > > >       at
> > > > > _0002findex_0002ejspindex_jsp_30._jspService(_0002findex_0002ejspi
> > > > > ndex_jsp_30.java:68)
> > > > >       at
> > > > >
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
> > > > >       at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > > > >       at
> > > > > org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(Jsp
> > > > > Servlet.java:177)
> > > > >       at
> > > > >
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
> > > > >       at
> > > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
> > > > >       at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > > > >       at
> > > > >
> org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
> > > > >       at org.apache.tomcat.core.Handler.service(Handler.java:286)
> > > > >       at
> > > > >
> org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
> > > > >       at
> > > > > org.apache.tomcat.core.ContextManager.internalService(ContextManag
> > > > > er.java:797)
> > > > >       at
> > > > >
> org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
> > > > >       at
> > > > > org.apache.tomcat.service.http.HttpConnectionHandler.processConnec
> > > > > tion(HttpConnectionHandler.java:210)
> > > > >       at
> > > > >
> > >
> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
> > > > >       at
> > > > >
> > >
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
> > > > >       at java.lang.Thread.run(Thread.java:484)
> > > > >
> > > > > cheerio,
> > > > > chris
> > > > >
> > > > > | chris wilson || web dev ||| www.wondergeek.com || |
> > > >
> > > > --
> > > > --------------------------------------------------------------
> > > > 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]
> >
> > --
> > --------------------------------------------------------------
> > 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]



--
--------------------------------------------------------------
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