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-howto.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\graphics\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;Ljava/lang/String; Ljava/lang/String;Ljava/lang/String;Ljavax/servlet/jsp/tagext/TagLibraryInfo ;Ljavax/servlet/jsp/tagext/TagExtraInfo;[Ljavax/servlet/jsp/tagext/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.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.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(Http11Processor.java:594) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne ction(Http11Protocol.java:392) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.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;Ljava/lang/String; Ljava/lang/String;Ljava/lang/String;Ljavax/servlet/jsp/tagext/TagLibraryInfo ;Ljavax/servlet/jsp/tagext/TagExtraInfo;[Ljavax/servlet/jsp/tagext/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(TagLibraryInfoIm 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
(trying to understand) Tomcat class loading mechanism
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-howto.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\graphics\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;Ljava/lang/String; Ljava/lang/String;Ljava/lang/String;Ljavax/servlet/jsp/tagext/TagLibraryInfo ;Ljavax/servlet/jsp/tagext/TagExtraInfo;[Ljavax/servlet/jsp/tagext/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.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.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(Http11Processor.java:594) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne ction(Http11Protocol.java:392) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.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;Ljava/lang/String; Ljava/lang/String;Ljava/lang/String;Ljavax/servlet/jsp/tagext/TagLibraryInfo ;Ljavax/servlet/jsp/tagext/TagExtraInfo;[Ljavax/servlet/jsp/tagext/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(TagLibraryInfoIm 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
RE: Setting up permissions for jsp directory
In essence, your jsp is 'separated' from your controller servlet. 1. You can either plug-in the validation mechanism on top of each jsp page such that each jsp page talks to the servlet before processing (but i presume you wouldn't want this). 2. You can use JDBC Authentication Realm. Check http://tomcat.mslinn.com/tomcat/realms.html and http://jakarta.apache.org/tomcat/tomcat-4.1-doc/realm-howto.html#JDBCRealm for more information. ?manav. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Nihita Goel Sent: Friday, March 21, 2003 12:59 PM To: Tomcat Users List Subject: Setting up permissions for jsp directory I have an application where I have a single controller servet receiving requests and then calling the appropriate jsp pages. I have Java classes to be used by both the servlet and jsp's. These Java Bean clasees are for database interaction. I also need to maintain session. I am using these Java Beans with application scope. The general flow is: 1. The controller servlet receives the request. 2. Checks for the session state using session object.// Basically validates if the user is logged -in 3. Instantiate the bean class and get setter methods of java Beans to fetch data from database.// application scope. 4. If user is logged -in calls the appropriate JSP Page 5. The JSP Page display the information using the Bean. The problem is - it seems to be working fine if the user follows the normal flow. However if he directly goes and access the jsp page thru the url he is still able to get it. How do I configure TomCat to disallow access to the directory where I am keeping the jsp pages. I am using Tomcat 4.1.18. Any other idea ?? Regards N-Goel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]