tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cox, Charlie" <c...@cincom.com>
Subject RE: Tomcat classpath problem
Date Tue, 10 Jun 2003 15:48:24 GMT
unpack your jar to WEB-INF/classes and remove javax/servlet tree. This will
provide you with your classes without the conflicting servlet classes.

Charlie

> -----Original Message-----
> From: Manav Gupta [mailto:Manav.Gupta@cramer.com]
> Sent: Tuesday, June 10, 2003 10:58 AM
> To: Tomcat (E-mail)
> Subject: Tomcat classpath problem
> 
> 
> Apologies for the re-post, but I'm not sure if my messages 
> are reaching the
> list.
> -------
> Hi,
>  
> I'm trying to understand the tomcat class loading mechanism 
> and have read
> through the Class Loader HOW-TO (
> http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-h
> owto.html
> <http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-
> howto.html> ).
>  
> 
> How does one make additional jars available to tomcat? I 
> understand one can
> add them to WEB-INF/lib,but there are sometimes that approach 
> does not work.
> Here's a scenario:
> I'm using tomcat 4.1.24 with jdk 1.4.1_02. One of the 
> required libraries for
> my web app is oc4j.jar. If I put that oc4j.jar into the 
> WEB-INF/lib, tomcat
> throws the following error on startup:
> =====
> Starting service Tomcat-Standalone
> Apache Tomcat/4.1.24
> WebappClassLoader:
> validateJarFile(D:\jakarta-tomcat-4.1.24\bin\..\webapps\graphi
> cs\WEB-INF\lib
> \oc4j.jar) - jar not loaded. See Servlet Spec 2.3, section 
> 9.7.2. Offending
> class: javax/servlet/Servlet.class
> =====
> Upon checking, I found oc4j.jar has javax.servlet.Servlet and 
> I suspect it
> does not adhere to Servlet Spec 2.3 (but probably something 
> earlier than
> that). 
>  
> If I do not put oc4j.jar in WEB-INF/lib, I get the following error:
>  
> 2003-06-10 13:28:43 StandardWrapperValve[jsp]: 
> Servlet.service() for servlet
> jsp threw exception
> javax.servlet.ServletException:
> javax.servlet.jsp.tagext.TagInfo.<init>(Ljava/lang/String;Ljav
> a/lang/String;
> Ljava/lang/String;Ljava/lang/String;Ljavax/servlet/jsp/tagext/
> TagLibraryInfo
> ;Ljavax/servlet/jsp/tagext/TagExtraInfo;[Ljavax/servlet/jsp/ta
> gext/TagAttrib
> uteInfo;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;
> [Ljavax/servle
> t/jsp/tagext/TagVariableInfo;)V
>  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
>  at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilt
> er(Application
> FilterChain.java:247)
>  at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli
> cationFilterCh
> ain.java:193)
>  at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardW
> rapperValve.ja
> va:256)
>  at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invok
> eNext(StandardPipeline.java:643)
>  at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:480)
>  at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>  at
> org.apache.catalina.core.StandardContextValve.invoke(StandardC
> ontextValve.ja
> va:191)
>  at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invok
> eNext(StandardPipeline.java:643)
>  at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:480)
>  at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>  at
> org.apache.catalina.core.StandardContext.invoke(StandardContex
> t.java:2415)
>  at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHost
> Valve.java:180
> )
>  at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invok
> eNext(StandardPipeline.java:643)
>  at
> org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDi
> spatcherValve.
> java:171)
>  at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invok
> eNext(StandardPipeline.java:641)
>  at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReport
> Valve.java:172
> )
>  at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invok
> eNext(StandardPipeline.java:641)
>  at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:480)
>  at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>  at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEn
> gineValve.java
> :174)
>  at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invok
> eNext(StandardPipeline.java:643)
>  at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:480)
>  at 
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>  at 
> org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.
> java:223)
>  at
> org.apache.coyote.http11.Http11Processor.process(Http11Process
> or.java:594)
>  at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandle
> r.processConne
> ction(Http11Protocol.java:392)
>  at
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoi
> nt.java:565)
>  at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> ThreadPool.jav
> a:619)
>  at java.lang.Thread.run(Thread.java:536)
> Root cause is; java.lang.NoSuchMethodError:
> javax.servlet.jsp.tagext.TagInfo.<init>(Ljava/lang/String;Ljav
> a/lang/String;
> Ljava/lang/String;Ljava/lang/String;Ljavax/servlet/jsp/tagext/
> TagLibraryInfo
> ;Ljavax/servlet/jsp/tagext/TagExtraInfo;[Ljavax/servlet/jsp/ta
> gext/TagAttrib
> uteInfo;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;
> [Ljavax/servle
> t/jsp/tagext/TagVariableInfo;)V
>  at
> org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(Ta
> gLibraryInfoIm
> pl.java:385)
> (and a whole lot of lines)
>  
> This above error stems from a particular tag library that I 
> have written,
> and when tomcat tries to generate the java source from the 
> jsp page, it
> fails (the translated file inside the work folder has a size 
> of zero bytes).
>  
> But, If I remove the oc4j.jar from the tomcat startup path (I 
> had modified
> setclasspath.bat to include oc4j.jar) and oc4j.jar is there inside
> WEB-INF/lib then I get the following error:
> javax.naming.NoInitialContextException: Cannot instantiate class:
> com.evermind.server.rmi.RMIInitialContextFactory.  Root exception is
> java.lang.ClassNotFoundException:
> com.evermind.server.rmi.RMIInitialContextFactory
>         at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappC
> lassLoader.jav
> a:1443)
>         at
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappC
> lassLoader.jav
> a:1289)
>         at 
> java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:217)
>         at
> com.sun.naming.internal.VersionHelper12.loadClass(VersionHelpe
> r12.java:42)
>         at
> javax.naming.spi.NamingManager.getInitialContext(NamingManager
> .java:649)
>         at
> javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
>         at javax.naming.InitialContext.init(InitialContext.java:219)
>         at javax.naming.InitialContext.<init>(InitialContext.java:195)
>         at
> com.cramer.graphics.server.ViewHelperUtility.getInventory(View
> HelperUtility.
> java:45)
>         at
> com.cramer.graphics.server.NetworkViewHelper.initialiseValueOb
> jects(NetworkV
> iewHelper.java:54)
>         at
> com.cramer.graphics.server.NetworkViewHelper.<init>(NetworkVie
> wHelper.java:3
> 7)
>         at 
> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>         at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeCo
> nstructorAcces
> sorImpl.java:39)
>         at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Dele
> gatingConstruc
> torAccessorImpl.java:27)
>         at 
> java.lang.reflect.Constructor.newInstance(Constructor.java:274)
>         at
> com.cramer.graphics.taglib.ViewHelperTag.createObject(ViewHelp
> erTag.java:86)
>         at
> com.cramer.graphics.taglib.ViewHelperTag.doInitBody(ViewHelper
> Tag.java:52)
>         at
> org.apache.jsp.networkViewGenerator_jsp._jspService(networkVie
> wGenerator_jsp
> .java:105)
>         at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
>         at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServlet
> Wrapper.java:2
> 10)
>         at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet
> .java:295)
>         at 
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
>         at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilt
> er(Application
> FilterChain.java:247)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli
> cationFilterCh
> ain.java:193)
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardW
> rapperValve.ja
> va:256)
>         at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invok
> eNext(StandardPipeline.java:643)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:480)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>         at
> org.apache.catalina.core.StandardContextValve.invoke(StandardC
> ontextValve.ja
> va:191)
>         at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invok
> eNext(StandardPipeline.java:643)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:480)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>         at
> org.apache.catalina.core.StandardContext.invoke(StandardContex
> t.java:2415)
>         at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHost
> Valve.java:180
> )
>         at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invok
> eNext(StandardPipeline.java:643)
>         at
> org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDi
> spatcherValve.
> java:171)
>         at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invok
> eNext(StandardPipeline.java:641)
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReport
> Valve.java:172
> )
>         at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invok
> eNext(StandardPipeline.java:641)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:480)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>         at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEn
> gineValve.java
> :174)
>         at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invok
> eNext(StandardPipeline.java:643)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:480)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>         at
> org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.
> java:223)
>         at
> org.apache.coyote.http11.Http11Processor.process(Http11Process
> or.java:594)
>         at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandle
> r.processConne
> ction(Http11Protocol.java:392)
>         at
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoi
> nt.java:565)
>         at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> ThreadPool.jav
> a:619)
>         at java.lang.Thread.run(Thread.java:536)
> $$$$$$java.lang.reflect.InvocationTargetException
> com.cramer.graphics.shared.GraphicsException: ViewHelperUtility:
> getObjectInventory:Cannot instantiate class:
> com.evermind.server.rmi.RMIInitialContextFactory at
> com.cramer.graphics.server.ViewHelperUtility.getInventory(ViewHelperU
> tility.java:64)
> at
> com.cramer.graphics.server.NetworkViewHelper.initialiseValueOb
> jects(NetworkV
> iewHelper.java:54)
>         at
> com.cramer.graphics.server.NetworkViewHelper.<init>(NetworkVie
> wHelper.java:3
> 7)
>         at 
> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>         at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeCo
> nstructorAcces
> sorImpl.java:39)
>         at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Dele
> gatingConstruc
> torAccessorImpl.java:27)
>         at 
> java.lang.reflect.Constructor.newInstance(Constructor.java:274)
>         at
> com.cramer.graphics.taglib.ViewHelperTag.createObject(ViewHelp
> erTag.java:86)
>         at
> com.cramer.graphics.taglib.ViewHelperTag.doInitBody(ViewHelper
> Tag.java:52)
>         at
> org.apache.jsp.networkViewGenerator_jsp._jspService(networkVie
> wGenerator_jsp
> .java:105)
>         at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
>         at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServlet
> Wrapper.java:2
> 10)
>         at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet
> .java:295)
>         at 
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
>         at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilt
> er(Application
> FilterChain.java:247)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(Appli
> cationFilterCh
> ain.java:193)
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardW
> rapperValve.ja
> va:256)
>         at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invok
> eNext(StandardPipeline.java:643)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:480)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>         at
> org.apache.catalina.core.StandardContextValve.invoke(StandardC
> ontextValve.ja
> va:191)
>         at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invok
> eNext(StandardPipeline.java:643)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:480)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>         at
> org.apache.catalina.core.StandardContext.invoke(StandardContex
> t.java:2415)
>         at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHost
> Valve.java:180
> )
>         at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invok
> eNext(StandardPipeline.java:643)
>         at
> org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDi
> spatcherValve.
> java:171)
>         at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invok
> eNext(StandardPipeline.java:641)
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReport
> Valve.java:172
> )
>         at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invok
> eNext(StandardPipeline.java:641)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:480)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>         at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEn
> gineValve.java
> :174)
>         at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invok
> eNext(StandardPipeline.java:643)
>         at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipel
> ine.java:480)
>         at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
>         at
> org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.
> java:223)
>         at
> org.apache.coyote.http11.Http11Processor.process(Http11Process
> or.java:594)
>         at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandle
> r.processConne
> ction(Http11Protocol.java:392)
>         at
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoi
> nt.java:565)
>         at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> ThreadPool.jav
> a:619)
>         at java.lang.Thread.run(Thread.java:536)
> java.lang.reflect.InvocationTargetException
>         at 
> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
>         at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeCo
> nstructorAcces
> sorImpl.java:39)
>         at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Dele
> gatingConstruc
> torAccessorImpl.java:27)
>         at 
> java.lang.reflect.Constructor.newInstance(Constructor.java:274)
>         at
> com.cramer.graphics.taglib.ViewHelperTag.createObject(ViewHelp
> erTag.java:86)
>         at
> com.cramer.graphics.taglib.ViewHelperTag.doInitBody(ViewHelper
> Tag.java:52)
>         at
> org.apache.jsp.networkViewGenerator_jsp._jspService(networkVie
> wGenerator_jsp
> .java:105)
>         at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
>         at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServlet
> Wrapper.java:2
> 10)
>         at 
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.
>         ... 42 more
>         
>  
> I suspect I don't need to fiddle with the tomcat classpath. 
> But how do I get
> tomcat to load the oc4j.jar from the WEB-INF/lib and use the
> com.evermind.server.rmi.RMIInitialContextFactory class?
>  
> Tomcat does its job when it tries to load the jar file, but 
> the verification
> fails and it is unable to load it. Any ideas what a 
> workaround could be?
>  
> Many Thanks,
> M
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message