Upgrade problem (useBean)
I have tried to upgrade from apache-2.0.54/tomcat-5.5.9 to apache-2.2.3/apache-5.5.17 (also tried with apache-2.0.59). When I use this UseBean at index.jsp (root of webapplication): class="internet.database.SimpleUseOfConnectionPool" /> I have no problems at all. When I use the exact same UseBean in webapproot/dir/page.jsp I get the following output: org.apache.jasper.JasperException: /index.jsp(5,0) The value for the useBean class attribute internet.database.SimpleUseOfConnectionPool is invalid. org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) All my webapps and contents (including WEB-INF and components) are copied from an existing running solution with no problems. Anyone that know how to solve this? Thanks, Lars Nielsen Lind - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Upgrade problem (useBean)
Mark Thomas skrev: Lars Nielsen Lind wrote: All my webapps and contents (including WEB-INF and components) are copied from an existing running solution with no problems. Anyone that know how to solve this? Is there a more complete stack trace and/or exception in the logs? Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Yes, but first this addidtional info. I am using Fedora Core 5 OS and as mentioned above I have tried with: apache-2.2.2/tomcat-5.5.17 apache-2.2.3/tomcat-5.5.17 apache-2.0.59/tomcat-5.5.17 Finally I have copied the whole /opt/apache-2.0.54 and /opt/tomcat-5.5.9 from my backups and when running them with the same webapps as in the setups mentioned above it all works the way it should. When I am running apache-2.2.2/tomcat-5.5.17 I do not get any error when showing index.jsp. But when I use the same bean in subfolders in webapplication: /opt/tomcat-5.5.17/webapps/application1 index.jsp OK /opt/tomcat-5.5.17/webapps/application1/contact/ contactform.jsp ERROR I get an error. I have tried to change name and after searching the net one mentioned that it is a missing default constructor in my javabean that is the problem (I have default constructors in my beans) anothe mentioned to shift with type="xx.yy.zz" ... />. It did not solve the problem shifting form class to type. Here is the error-report shown in the browser: *type* Exception report *message* *description* _The server encountered an internal error () that prevented it from fulfilling this request._ *exception* org.apache.jasper.JasperException: /index.jsp(5,0) The value for the useBean class attribute internet.database.SimpleUseOfConnectionPool is invalid. org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) *root cause* org.apache.jasper.JasperException: /index.jsp(5,0) The value for the useBean class attribute internet.database.SimpleUseOfConnectionPool is invalid. org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:146) org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1174) org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213) org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219) org.apache.jasper.compiler.Node$Root.accept(Node.java:456) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) org.apache.jasper.compiler.Generator.generate(Generator.java:3305) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198) org.apache.jasper.compiler.Compiler.compile(Compiler.java:295) org.apache.jasper.compiler.Compiler.compile(Compiler.java:276) org.apache.jasper.compiler.Compiler.compile(Compiler.java:264) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) *note* _The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs._ And here is the output from tomcat-logs: 2006-08-08 08:51:45 org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: /index.jsp(5,0) The value for the useBean class attribute internet.database.SimpleUseOfConnectionPool is invalid. at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39) at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405) at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:146) at org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1174) at org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.jav
Re: Upgrade problem (useBean)
David Smith skrev: This may be something for a bugzilla report, but I looked at the source of org.apache.jasper.compiler.Generator. The real exception generated is eaten in favor of the very unhelpful message you received. The possible original exceptions may have been one of: java.lang.ClassNotFoundException - the class is not in WEB-INF/classes/internet/database or a jar in WEB-INF/lib probably not your issue since it works from jsps located in the webapp's root directory. java.lang.NoSuchMethodException - if no default constructor was found, I think you've already said one was present. java.lang.SecurityException - if the security manager is active and denying access. Hmmm. is tomcat running under a security manager? --David Mark Thomas wrote: Lars Nielsen Lind wrote: Here is the error-report shown in the browser: The stack trace suggests the class cannot be instantiated. Hmm. Odd. Can you create a simple test case that reproduces this? You won't be able to post a war to the list so feel free to send it to me directly. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] How do I check if Tomcat is running under a security manager? Lars Nielsen Lind - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Upgrade problem (useBean)
David Smith skrev: Usually you'd know it if it was. By default it isn't and has to be explicitly turned on. See http://tomcat.apache.org/tomcat-5.5-doc/security-manager-howto.html for more information. Here's a quick and dirty test -- insert a scriptlet in your jsp code something like: <% internet.database.SimpleUseOfConnectionPool myBean = new internet.database.SimpleUseOfConnectionPool() ; %> If that works, then I would say jasper is at fault somehow. If not, take a look at the generated exception for the real cause of your problem. --David Lars Nielsen Lind wrote: David Smith skrev: This may be something for a bugzilla report, but I looked at the source of org.apache.jasper.compiler.Generator. The real exception generated is eaten in favor of the very unhelpful message you received. The possible original exceptions may have been one of: java.lang.ClassNotFoundException - the class is not in WEB-INF/classes/internet/database or a jar in WEB-INF/lib probably not your issue since it works from jsps located in the webapp's root directory. java.lang.NoSuchMethodException - if no default constructor was found, I think you've already said one was present. java.lang.SecurityException - if the security manager is active and denying access. Hmmm. is tomcat running under a security manager? --David Mark Thomas wrote: Lars Nielsen Lind wrote: Here is the error-report shown in the browser: The stack trace suggests the class cannot be instantiated. Hmm. Odd. Can you create a simple test case that reproduces this? You won't be able to post a war to the list so feel free to send it to me directly. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] How do I check if Tomcat is running under a security manager? Lars Nielsen Lind - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Ok I have tried to do as you said (/webapps/application1/kontakt/kontakt.jsp): <%@ page language="java" contentType="text/html;charset=ISO-8859-1" pageEncoding="ISO-8859-1" import="java.sql.*, java.io.*, java.util.*, internet.database.*, internet.log.*" %> <% internet.database.SimpleUseOfConnectionPool myBean = new internet.database.SimpleUseOfConnectionPool() ; %> And the result is: *type* Exception report *message* *description* _The server encountered an internal error () that prevented it from fulfilling this request._ *exception* org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 5 in the jsp file: /kontakt.jsp Generated servlet error: internet.database.SimpleUseOfConnectionPool cannot be resolved to a type An error occurred at line: 5 in the jsp file: /kontakt.jsp Generated servlet error: internet.database.SimpleUseOfConnectionPool cannot be resolved to a type org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) *root cause* org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 5 in the jsp file: /kontakt.jsp Generated servlet error: internet.database.SimpleUseOfConnectionPool cannot be resolved to a type An error occurred at line: 5 in the jsp file: /kontakt.jsp Generated servlet error: internet.database.SimpleUseOfConnectionPool cannot be resolved to a type org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84) org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328) org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:414) org.apache.jasper.compiler.Compiler.compile(Compiler.java:297) org.apache.jasper.compiler.Compiler.compile(Compiler.java:276) org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
Re: Upgrade problem (useBean)
David Smith skrev: Lars Nielsen Lind wrote: David Smith skrev: Usually you'd know it if it was. By default it isn't and has to be explicitly turned on. See http://tomcat.apache.org/tomcat-5.5-doc/security-manager-howto.html for more information. Here's a quick and dirty test -- insert a scriptlet in your jsp code something like: <% internet.database.SimpleUseOfConnectionPool myBean = new internet.database.SimpleUseOfConnectionPool() ; %> If that works, then I would say jasper is at fault somehow. If not, take a look at the generated exception for the real cause of your problem. --David Lars Nielsen Lind wrote: David Smith skrev: This may be something for a bugzilla report, but I looked at the source of org.apache.jasper.compiler.Generator. The real exception generated is eaten in favor of the very unhelpful message you received. The possible original exceptions may have been one of: java.lang.ClassNotFoundException - the class is not in WEB-INF/classes/internet/database or a jar in WEB-INF/lib probably not your issue since it works from jsps located in the webapp's root directory. java.lang.NoSuchMethodException - if no default constructor was found, I think you've already said one was present. java.lang.SecurityException - if the security manager is active and denying access. Hmmm. is tomcat running under a security manager? --David Mark Thomas wrote: Lars Nielsen Lind wrote: Here is the error-report shown in the browser: The stack trace suggests the class cannot be instantiated. Hmm. Odd. Can you create a simple test case that reproduces this? You won't be able to post a war to the list so feel free to send it to me directly. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] How do I check if Tomcat is running under a security manager? Lars Nielsen Lind - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Ok I have tried to do as you said (/webapps/application1/kontakt/kontakt.jsp): <%@ page language="java" contentType="text/html;charset=ISO-8859-1" pageEncoding="ISO-8859-1" import="java.sql.*, java.io.*, java.util.*, internet.database.*, internet.log.*" %> <% internet.database.SimpleUseOfConnectionPool myBean = new internet.database.SimpleUseOfConnectionPool() ; %> And the result is: *type* Exception report *message* *description* _The server encountered an internal error () that prevented it from fulfilling this request._ *exception* org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 5 in the jsp file: /kontakt.jsp Generated servlet error: internet.database.SimpleUseOfConnectionPool cannot be resolved to a type An error occurred at line: 5 in the jsp file: /kontakt.jsp Generated servlet error: internet.database.SimpleUseOfConnectionPool cannot be resolved to a type org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) *root cause* org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 5 in the jsp file: /kontakt.jsp Generated servlet error: internet.database.SimpleUseOfConnectionPool cannot be resolved to a type An error occurred at line: 5 in the jsp file: /kontakt.jsp Generated servlet error: internet.database.SimpleUseOfConnectionPool cannot be resolved to a type org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84) org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328) org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:414) org.apache.jasper.compiler.Compiler.compile(Compiler.java:297) org.apache.jasper.compiler.Compiler.compile(Compiler.java:276) org.apache.jasper.compiler.Compiler.compile(Compiler.j
Re: Upgrade problem (useBean)
Lars Nielsen Lind skrev: David Smith skrev: Lars Nielsen Lind wrote: David Smith skrev: Usually you'd know it if it was. By default it isn't and has to be explicitly turned on. See http://tomcat.apache.org/tomcat-5.5-doc/security-manager-howto.html for more information. Here's a quick and dirty test -- insert a scriptlet in your jsp code something like: <% internet.database.SimpleUseOfConnectionPool myBean = new internet.database.SimpleUseOfConnectionPool() ; %> If that works, then I would say jasper is at fault somehow. If not, take a look at the generated exception for the real cause of your problem. --David Lars Nielsen Lind wrote: David Smith skrev: This may be something for a bugzilla report, but I looked at the source of org.apache.jasper.compiler.Generator. The real exception generated is eaten in favor of the very unhelpful message you received. The possible original exceptions may have been one of: java.lang.ClassNotFoundException - the class is not in WEB-INF/classes/internet/database or a jar in WEB-INF/lib probably not your issue since it works from jsps located in the webapp's root directory. java.lang.NoSuchMethodException - if no default constructor was found, I think you've already said one was present. java.lang.SecurityException - if the security manager is active and denying access. Hmmm. is tomcat running under a security manager? --David Mark Thomas wrote: Lars Nielsen Lind wrote: Here is the error-report shown in the browser: The stack trace suggests the class cannot be instantiated. Hmm. Odd. Can you create a simple test case that reproduces this? You won't be able to post a war to the list so feel free to send it to me directly. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] How do I check if Tomcat is running under a security manager? Lars Nielsen Lind - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Ok I have tried to do as you said (/webapps/application1/kontakt/kontakt.jsp): <%@ page language="java" contentType="text/html;charset=ISO-8859-1" pageEncoding="ISO-8859-1" import="java.sql.*, java.io.*, java.util.*, internet.database.*, internet.log.*" %> <% internet.database.SimpleUseOfConnectionPool myBean = new internet.database.SimpleUseOfConnectionPool() ; %> And the result is: *type* Exception report *message* *description* _The server encountered an internal error () that prevented it from fulfilling this request._ *exception* org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 5 in the jsp file: /kontakt.jsp Generated servlet error: internet.database.SimpleUseOfConnectionPool cannot be resolved to a type An error occurred at line: 5 in the jsp file: /kontakt.jsp Generated servlet error: internet.database.SimpleUseOfConnectionPool cannot be resolved to a type org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) *root cause* org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: 5 in the jsp file: /kontakt.jsp Generated servlet error: internet.database.SimpleUseOfConnectionPool cannot be resolved to a type An error occurred at line: 5 in the jsp file: /kontakt.jsp Generated servlet error: internet.database.SimpleUseOfConnectionPool cannot be resolved to a type org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84) org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328) org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:414) org.apache.jasper.compiler.Compiler.compile(Compiler.java:297) org.apache.jasper.compiler.Compiler.comp
Re: Upgrade problem (useBean)
David Smith skrev: Lars Nielsen Lind wrote: I also now have tried to move the file kontakt.jsp with: <%@ page language="java" contentType="text/html;charset=ISO-8859-1" pageEncoding="ISO-8859-1" import="java.sql.*, java.io.*, java.util.*, internet.database.*, internet.log.*" %> <% internet.database.SimpleUseOfConnectionPool myBean = new internet.database.SimpleUseOfConnectionPool() ; %> to the root of the webapplication - and now there is no error messages? I then created a new folder abcdefg and placed kontakt.jsp in it - and again, as above, there are errors. Lars Nielsen Lind - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Got me stumped. I've used beans in jsps in subfolders before with no issue. I'd advise you open a bugzilla issue on this and submit a war file that reliably reproduces the issue. --David - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] I will try and do a systematic test from scratch starting with a fresh installation of the server and the other components. If i still can't make it work I will send the *.war to Mark Thomas as he suggested ealier. Lars Nielsen Lind - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Measuring traffic pr. virtualhost
Hi. I need to measure the traffic pr. month/year for each virtualhost. How can I do that with Apache/Tomcat? Lars Nielsen Lind - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Urgent! Compile JSP Problem
Sounds great - Tomorrow I will try to do what you have done and send feedback to the list. Thanks, Lars Nielsen Lind chavalitt skrev: I've just fixed this problem on my server. It's about the different context between tomcat 5.0.x and 5.5.x in server.xml of tomcat 5.5.x, you should not input appBase="...", delete this attribute out. Then in /conf/Catalina/[Host]/ROOT.xml , put the docBase="..." here. Then everything should work fine. David Smith-2 wrote: Another on this list had the same problem. I'm starting to wonder if Jasper has a problem loading non-traditional package names (ie those not starting in java, javax, org, edu, com, etc., ...). --David Kathy Lo wrote: Dear, I encounter a strange problem. I developed a web application using tomcat 5.5.17 and jdk-1.5.0_06 in Linux Fedora Core 4. I wrote some JSP files in the following directory structure /usr/apache-tomcat-5.5.17/webapps/test/index.jsp /usr/apache-tomcat-5.5.17/webapps/test/error/get_ref_fail.jsp /usr/apache-tomcat-5.5.17/webapps/test/ok/gen_file_ok.jsp In all of these JSP file, i imported "utils.*" package and use "UserSession" class inside this package. "utils" package is located in the following directory /usr/apache-tomcat-5.5.17/webapps/test/WEB-INF/classes/utils/UserSession.class And, i edit server.xml to set the URL of this web application as following When I load the web application, index.jsp can be compiled and loaded correctly. When I load get_ref_fail.jsp using the following URL www.abc.org/error/get_ref_fail.jsp, or, www.abc.org/ok/gen_file_ok.jsp "Unable to compile JSP" error occurred and the server reported that it cannot resolve "UserSession" class. This problem is only occurred when I load JSP from /error or /ok subdirectory. When I load JSP from root directory (i.e. /usr/apache-tomcat-5.5.17/webapps/test), this problem disappear. How I can solve this problem? Please help me! - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Apache 2.2.3 Tomcat 5.5.20 - mod_jk or proxy?
Hi! Which connector is the most relevant to use with Apache 2.2.3 and Tomcat 5.5.20? Is it mod_jk or is it proxy? And how do I use the most relevant with Apache 2.2.3 and Tomcat 5.5.20? (compile and implementation samples wanted if possible). Thanks, Lars Nielsen Lind - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Apache 2.2.3 Tomcat 5.5.20 - mod_jk or proxy?
I have tried with mod_jk but can't make it work. I get this err msg in mod_jk.log: [Wed Nov 15 00:32:34 2006] [16667:10448] [error] ajp_validate::jk_ajp_common.c (1931): can't resolve tomcat address localhost [Wed Nov 15 00:32:34 2006] [16667:10448] [error] ajp_validate::jk_ajp_common.c (1934): invalid host and port localhost 8009 [Wed Nov 15 00:32:34 2006] [16667:10448] [error] wc_create_worker::jk_worker.c (158): validate failed for default [Wed Nov 15 00:32:34 2006] [16667:10448] [error] build_worker_map::jk_worker.c (256): failed to create worker default [Wed Nov 15 00:32:35 2006] [16668:10448] [error] ajp_validate::jk_ajp_common.c (1931): can't resolve tomcat address localhost [Wed Nov 15 00:32:35 2006] [16668:10448] [error] ajp_validate::jk_ajp_common.c (1934): invalid host and port localhost 8009 [Wed Nov 15 00:32:35 2006] [16668:10448] [error] wc_create_worker::jk_worker.c (158): validate failed for default [Wed Nov 15 00:32:35 2006] [16668:10448] [error] build_worker_map::jk_worker.c (256): failed to create worker default [Wed Nov 15 00:34:14 2006] [16707:13840] [error] ajp_validate::jk_ajp_common.c (1931): can't resolve tomcat address localhost [Wed Nov 15 00:34:14 2006] [16707:13840] [error] ajp_validate::jk_ajp_common.c (1934): invalid host and port localhost 8009 [Wed Nov 15 00:34:14 2006] [16707:13840] [error] wc_create_worker::jk_worker.c (158): validate failed for default [Wed Nov 15 00:34:14 2006] [16707:13840] [error] build_worker_map::jk_worker.c (256): failed to create worker default [Wed Nov 15 00:34:14 2006] [16708:13840] [error] ajp_validate::jk_ajp_common.c (1931): can't resolve tomcat address localhost [Wed Nov 15 00:34:14 2006] [16708:13840] [error] ajp_validate::jk_ajp_common.c (1934): invalid host and port localhost 8009 [Wed Nov 15 00:34:14 2006] [16708:13840] [error] wc_create_worker::jk_worker.c (158): validate failed for default [Wed Nov 15 00:34:14 2006] [16708:13840] [error] build_worker_map::jk_worker.c (256): failed to create worker default [Wed Nov 15 00:35:10 2006] [16709:13840] [info] jk_handler::mod_jk.c (2071): Could not find a worker for worker name=default [Wed Nov 15 00:35:14 2006] [16710:13840] [info] jk_handler::mod_jk.c (2071): Could not find a worker for worker name=default [Wed Nov 15 00:35:16 2006] [16711:13840] [info] jk_handler::mod_jk.c (2071): Could not find a worker for worker name=default I have compiled Apache this way: ./configure --prefix=/opt/apache-2.2.3 --enable-ssl --with-ssl=/opt/openssl-0.9.8d --enable-proxy --enable-proxy-connect --enable-proxy-ajp --enable-so make make install And mod_jk this way: ./buildconf.sh ./configure --with-apxs=/opt/apache-2.2.3/bin/apxs --with-java-home=/opt/jdk1.5.0_09 --enable-jni make make install And in my httpd.conf: LoadModule jk_module modules/mod_jk.so AddModule mod_jk.c JkWorkerPropertyworker.list=default JkWorkerPropertyworker.default.port=8009 JkWorkerPropertyworker.default.host=localhost JkWorkerPropertyworker.default.type=ajp13 JkLogFile/opt/apache-2.2.3/logs/mod_jk.log JkLogLevelinfo JkLogStampFormat"[%a %b %d %H:%M:%S %Y] " JkRequestLogFormat"%w %V %T" JkOptions+ForwardKeySize +ForwardURICompat +ForwardDirectories (sample) JkAutoAlias/opt/apache-tomcat-5.5.20/webapps/application JkMount/*.jsp default JkMount/servlet/* default JkMount/cewolf/* default JkMount/*.png default And I get an error saying something about AddModule mispelled etc. And my server.xml: unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> Maybe there is something wrong in the above? Thanks, Lars Nielsen Lind Christopher Schultz skrev: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Lars, Lars Nielsen Lind wrote: Which connector is the most relevant to use with Apache 2.2.3 and Tomcat 5.5.20? Is it mod_jk or is it proxy? It depends on who you are, really. You may use either mod_jk or mod_proxy_ajp to connect Apache httpd 2.2 to any version of Tomcat. There are several advantages of mod_proxy_ajp over mod_jk: 1. It comes bundled with Apache httpd. That means that you probably don't have to compile and install it yourself. 2. It has a simpler configuration syntax. mod_jk offers one big advantages IMO: Rich configuration syntax allows for more exotic configuration options. My experience has been that it's easy to get yourself into a configuration where mod_proxy_ajp simply can't do the job without resorting to running every URL through mod_rewrite just to get it to work. In these cases, mod_jk configuration is cleaner. Once you decide which connector to use, then the configuration examples will make more sense. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (MingW3
Re: Apache 2.2.3 Tomcat 5.5.20 - mod_jk or proxy?
I will reply later tonight. I need to sleep. Worked all night with the problems and have been working today also :-) Christopher Schultz skrev: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Lars, Lars Nielsen Lind wrote: I have tried with mod_jk but can't make it work. I get this err msg in mod_jk.log: [Wed Nov 15 00:32:34 2006] [16667:10448] [error] ajp_validate::jk_ajp_common.c (1931): can't resolve tomcat address localhost This suggests a name resolution problem. And mod_jk this way: ./buildconf.sh ./configure --with-apxs=/opt/apache-2.2.3/bin/apxs --with-java-home=/opt/jdk1.5.0_09 --enable-jni I believe that the JNI connector is deprecated. Are you intending to run mod_jk with JNI? I'd like to see what the rest of the list thinks about that. mod_jk is telling you that it cannot resolve "localhost". What do you have in your /etc/resolv.conf? What about /etc/hosts? What happens if you "ping localhost"? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFWxg59CaO5/Lv0PARAq4GAKC7cA94sm//4gFeQXYEGVCfjaKeWwCcCyeB 7r6GVV76ukecB3iww2jisHo= =wwWl -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Apache 2.2.3 Tomcat 5.5.20 - mod_jk or proxy?
Solved with mod_jk without JNI, and thanks for all the tips. In my /etc/hosts there was this line: ::1 localhost.localdomain localhost And I added this line: 127.0.0.1 localhost.localdomain localhost and now I can ping localhost. Christopher Schultz skrev: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Lars, Lars Nielsen Lind wrote: I have tried with mod_jk but can't make it work. I get this err msg in mod_jk.log: [Wed Nov 15 00:32:34 2006] [16667:10448] [error] ajp_validate::jk_ajp_common.c (1931): can't resolve tomcat address localhost This suggests a name resolution problem. And mod_jk this way: ./buildconf.sh ./configure --with-apxs=/opt/apache-2.2.3/bin/apxs --with-java-home=/opt/jdk1.5.0_09 --enable-jni I believe that the JNI connector is deprecated. Are you intending to run mod_jk with JNI? I'd like to see what the rest of the list thinks about that. mod_jk is telling you that it cannot resolve "localhost". What do you have in your /etc/resolv.conf? What about /etc/hosts? What happens if you "ping localhost"? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFWxg59CaO5/Lv0PARAq4GAKC7cA94sm//4gFeQXYEGVCfjaKeWwCcCyeB 7r6GVV76ukecB3iww2jisHo= =wwWl -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SEVERE: Error loading WebappClassLoader
I get this err msg when I am starting tomcat 5.5.20: 2006-11-16 09:22:02 org.apache.catalina.core.ApplicationContext log INFO: Marking servlet CewolfServlet as unavailable 2006-11-16 09:22:02 org.apache.catalina.core.ApplicationContext log SEVERE: Error loading WebappClassLoader delegate: false repositories: /WEB-INF/classes/ --> Parent Classloader: [EMAIL PROTECTED] de.laures.cewolf.CewolfRenderer java.lang.ClassNotFoundException: de.laures.cewolf.CewolfRenderer at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1355) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1201) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1034) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3951) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4225) ... My server.xml: autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> I have tried with path="" and with appBase="/opt/apache-tomcat-5.5.20/webapps/application1" and with docBase="/opt/apache-tomcat-5.5.20/webapps/application1". Any solutions? Thanks, Lars Nielsen Lind - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 5.5.20 Apache 2.2.3 server.xml
Hi, as mentioned by chavalitt in a former thread: Re: Urgent! Compile JSP Problem, I have removed appBase="" from my in server.xml. The only reference to the webapplication is now docBase="/opt/apache-tomcat-5.5.20/webapps/application1" in my /> in server.xml, and this seems to work just fine..! But is this the right way to do it? I have tried with: - appBase="webapps" and docBase="/opt/apache-tomcat-5.5.20/webapps/application1" and - appBase="webapps" and docBase="application1" and - appBase="/opt/apache-tomcat-5.5.20/webapps" and docBase="application1" and - appBase="/opt/apache-tomcat-5.5.20/webapps/application1" and docBase="/opt/apache-tomcat-5.5.20/webapps/application1" but it did not work. I was simply not able to use JSP if the jsp file not was placed in the applications root. In the documention it is not mentioned that appBase not must be used when using tomcat 5.5 and Apache 2.2. How do you do it? Thanks, Lars Nielsen Lind - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is jsp designed for use by large websites
In regards to the aspects about the architecture I believe that the choice of using JSP and Java technology is a good one for you and your customers. The reason is the possibility for using Web services, services and in the hopefully near future Semantic Web technologies. Its a fact that it is a scaleable solution with perspective for further development of the site/sites. And what about portals/portlets? I have no experience with PHP - so is the above possible with PHP? Lars Nielsen Lind Andrew Miehs skrev: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dear List, JSP is designed to be used for Websites. Depending what you do with it, changes where it can be used for a Large Web Site. As for the questions. 1a. Who cares if JSP is not supported by web hosting companies - Large web sites have their own infrastructure. 1b. Both are programming languages - both have strengths and weaknesses - you can do the same thing with both - you could even use plain 'c' if you feel like it. Use which ever you are most comfortable with. 2. How many users a 'language' has is irrelevant. Glad to see you are quoting informative sources. :-) Architecture is the issue - not language. Andrew On 30/11/2006, at 3:11 PM, John Mok wrote: 1a. JSP is not supported by many web hosting companies or is only supported in more expensive dedicated server plans. In contrast, open source alternatives such as php is well-supported by web hosting companies. -> Result: most small and medium sized websites/webapps that do not need a dedicated server use php. 1b. JSP has many great features. But php is also very powerful and has some capabilities that jsp doesn't have. -> Result: some heavy-traffic websites/webapps that require dedicated servers use jsp. Some others use php (eg. yahoo [http://news.com.com/2100-1023-963937.html]). -> 2. There are more php users than jsp users. -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.1 (Darwin) iD8DBQFFbuqNW126qUNSzvURAmPTAJ9p2ShOSlLfLZXIbxRAzdNNEmuRJQCdG6i0 X6KSGAP8rAUERmUS7mpgVKg= =Qlh7 -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
mod_watch
Hi, I have tried to download mod_watch from Snert but it seems to be closed. If you want to graph traffic with MRTG pr. virtual host (incl. namebased) are there any other modules available - or other tools for Apache/Tomcat. Thanks, Lars Nielsen Lind - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: URL rewriting and mod_jk
Hi Rainer, and thanks for your reply. The [PT] at the end of the line seems to be the 'trick'. I have another question: If the user enters: http://www.domainname.dk/news/news.jsp?id=5, is there then any way to force the url to change to: http://www.domainname.dk/news/news/5/ ? thanks, Lars Rainer Jung skrev: Hi Lars, most liekly you need to set the pass through flag "PT" for the rewrite rules. See also "pass through" in http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html Also: if you are using VirtualHosts, you need to put the JkMount into the VirtualHosts. Let us know, if that works. Regards, Rainer [EMAIL PROTECTED] wrote: Hi, when I use the following: Options +FollowSymLinks RewriteEngine on RewriteRule ^/news/([0-9]+)$ /news/$1/ [R] RewriteRule ^/news/([0-9]+)/$ /news.jsp?id=$1 and I use this URL: http://localhost/news/1 apache-tomcat displays the jsp-page - with source code (html and jsp code). I am using apache-2.2.8 and apache-tomcat-6.0.14 and mod_jk. JkAutoAlias/opt/apache-tomcat-6.0.14/webapps/domainname JkMount/*.jsp default JkMount/*.* default JkMount/servlet/* default As mentioned on several web sites I have loaded mod_jk before mod_rewrite. What is wrong? Thanks, Lars - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: displaying an image from outside the webapps directory
Kimberly Begley skrev: Hi, I'm trying to make a jsp display a plot that is a jpeg in a directory outside the catalina_home directory - I do not have the option of putting it in the webapp directory (there's 1000's of them - my page will just display one of them as selected by the user - along with some other info) - how do I go about displaying it? Thanks - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] You can do that with a Servlet. Here are some sample code. Replace content of <> with your own data. package ; import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; public class OpenFile extends HttpServlet { private String documentHome = "."; private String page = ""; private String version = ""; private String remotehost = ""; private String remoteaddress = ""; protected File findFile(HttpServletRequest request) throws IOException { File file = new File(); return file; } protected void sendFile(File file, HttpServletResponse response) throws IOException { int c = 0; FileInputStream fis = null; try { ServletOutputStream sos = response.getOutputStream(); fis = new FileInputStream(file); while ((c = fis.read()) != -1) { sos.write(c); } sos.flush(); } finally { if (fis != null) { fis.close(); } } } public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ServletConfig config = getServletConfig(); ServletContext application = config.getServletContext(); File file = findFile(request); if (file == null) { } else { response.setContentType(application.getMimeType("application/" + file.getName())); response.setContentLength((int)file.length()); response.setHeader("Content-Disposition", "attachment; filename = " + file.getName()); sendFile(file, response); } } } Hope that this is useful. regards, Lars Lind - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FileUpload problem (HTTPS)
Hi, I have some problems with FileUpload. When I use it in my development environment with SSL and from the same network, there are no problems. But when I use it in my production environment from another network, I get this error message: FileUploadBase$InvalidContentTypeException: the > request doesn't contain a multipart/form-data or multipart/mixed stream, > content type header is null Are there any known solutions to this problem? thanks, Lars - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FileUpload problem (HTTPS)
Lars Nielsen Lind skrev: Hi, I have some problems with FileUpload. When I use it in my development environment with SSL and from the same network, there are no problems. But when I use it in my production environment from another network, I get this error message: FileUploadBase$InvalidContentTypeException: the > request doesn't contain a multipart/form-data or multipart/mixed stream, > content type header is null Are there any known solutions to this problem? thanks, Lars - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Problem solved - in the 5.x version the commons.io jar need to be copied to tomcat /Lars - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]