[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cobalt-developers] Re: Installing Tomcat 4 with Apache on Cobalt



Hi William,

JkLogFile  /var/log/httpd/mod_jk.log
JkLogLevel error
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13

Usually I enable java on a per site basis and not globally. You might
want to try it that way instead of globally. It's a pain but put the
JKMount stuff in each virtual site between the virtual tags.
I've removed the JkMount lines from mod_jk.log and added the following to within the Virtual Hosts tags of httpd.conf

JkMount examples/*.jsp ajp13
JkMount examples/servlet/* ajp13

Restarting gives the same result. .jsp pages in examples are still being correctly passed now to Tomcat but many of them have errors:

Here's my Apache log:


2003-03-28 19:43:53 Ajp13Processor[8009][4] Stopping background thread
2003-03-28 19:43:53 Ajp13Processor[8009][3] Stopping background thread
2003-03-28 19:43:53 Ajp13Processor[8009][2] Stopping background thread
2003-03-28 19:43:53 Ajp13Processor[8009][1] Stopping background thread
2003-03-28 19:43:53 Ajp13Processor[8009][0] Stopping background thread
2003-03-28 19:43:53 Ajp13Connector[8009] Stopping background thread
2003-03-28 19:43:58 StandardHost[www.r-hosts.com]: Removing web application at context path 2003-03-28 19:44:02 WebappLoader[]: Deploying class repositories to work directory /home/tomcat4/work/Apache/www.r-hosts.com/_ 2003-03-28 19:44:02 StandardManager[]: Seeding random number generator class java.security.SecureRandom 2003-03-28 19:44:03 StandardManager[]: Seeding of random number generator has been completed 2003-03-28 19:44:05 ContextConfig[]: Added certificates -> request attribute Valve 2003-03-28 19:44:05 StandardWrapper[:default]: Loading container servlet default 2003-03-28 19:44:05 StandardWrapper[:invoker]: Loading container servlet invoker 2003-03-28 19:44:06 Ajp13Connector[8009] Opening server socket on all host IP addresses
2003-03-28 19:44:06 Ajp13Connector[8009] Starting background thread
2003-03-28 19:44:07 Ajp13Processor[8009][0] Starting background thread
2003-03-28 19:44:07 Ajp13Processor[8009][1] Starting background thread
2003-03-28 19:44:07 Ajp13Processor[8009][2] Starting background thread
2003-03-28 19:44:07 Ajp13Processor[8009][3] Starting background thread
2003-03-28 19:44:07 Ajp13Processor[8009][4] Starting background thread
2003-03-28 19:52:50 WarpEngine[Apache]: Mapping request
2003-03-28 19:54:06 WarpEngine[Apache]: Mapping request
2003-03-28 19:54:15 WarpEngine[Apache]: Mapping request
2003-03-28 19:54:21 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.


An error occurred at line: 63 in the jsp file: /examples/jsp/colors/colrs.jsp

Generated servlet error:
/home/tomcat4/work/Apache/www.r-hosts.com/_/examples/jsp/colors/ colrs$jsp.java:60: Class colors.ColorGameBean not found.
                colors.ColorGameBean cb = null;
                      ^


An error occurred at line: 63 in the jsp file: /examples/jsp/colors/colrs.jsp

Generated servlet error:
/home/tomcat4/work/Apache/www.r-hosts.com/_/examples/jsp/colors/ colrs$jsp.java:63: Class colors.ColorGameBean not found.
                    cb= (colors.ColorGameBean)
                               ^


An error occurred at line: 63 in the jsp file: /examples/jsp/colors/colrs.jsp

Generated servlet error:
/home/tomcat4/work/Apache/www.r-hosts.com/_/examples/jsp/colors/ colrs$jsp.java:68: Class colors.ColorGameBean not found. cb = (colors.ColorGameBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "colors.ColorGameBean");
                                        ^
3 errors, 1 warning

at org.apache.jasper.compiler.Compiler.compile(Compiler.java:285) at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(J spServlet.java:176) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle t.java:188)
...
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:458) at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:551)
        at java.lang.Thread.run(Thread.java:536)

2003-03-28 19:55:41 WarpEngine[Apache]: Mapping request
2003-03-28 19:55:43 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.


An error occurred at line: 63 in the jsp file: /examples/jsp/colors/colrs.jsp

Generated servlet error:
/home/tomcat4/work/Apache/www.r-hosts.com/_/examples/jsp/colors/ colrs$jsp.java:60: Class colors.ColorGameBean not found.
                colors.ColorGameBean cb = null;
                      ^


An error occurred at line: 63 in the jsp file: /examples/jsp/colors/colrs.jsp

Generated servlet error:
/home/tomcat4/work/Apache/www.r-hosts.com/_/examples/jsp/colors/ colrs$jsp.java:63: Class colors.ColorGameBean not found.
                    cb= (colors.ColorGameBean)
                               ^


An error occurred at line: 63 in the jsp file: /examples/jsp/colors/colrs.jsp

Generated servlet error:
/home/tomcat4/work/Apache/www.r-hosts.com/_/examples/jsp/colors/ colrs$jsp.java:68: Class colors.ColorGameBean not found. cb = (colors.ColorGameBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "colors.ColorGameBean");
                                        ^
3 errors, 1 warning

at org.apache.jasper.compiler.Compiler.compile(Compiler.java:285) at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(J spServlet.java:176) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle t.java:188) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
...
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:458) at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:551)
        at java.lang.Thread.run(Thread.java:536)

2003-03-28 19:55:51 WarpEngine[Apache]: Mapping request
2003-03-28 19:55:52 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.


An error occurred at line: 10 in the jsp file: /examples/jsp/checkbox/checkresult.jsp

Generated servlet error:
/home/tomcat4/work/Apache/www.r-hosts.com/_/examples/jsp/checkbox/ checkresult$jsp.java:67: Class checkbox.CheckTest not found.
                checkbox.CheckTest foo = null;
                        ^


An error occurred at line: 10 in the jsp file: /examples/jsp/checkbox/checkresult.jsp

Generated servlet error:
/home/tomcat4/work/Apache/www.r-hosts.com/_/examples/jsp/checkbox/ checkresult$jsp.java:70: Class checkbox.CheckTest not found.
                    foo= (checkbox.CheckTest)
                                  ^


An error occurred at line: 10 in the jsp file: /examples/jsp/checkbox/checkresult.jsp

Generated servlet error:
/home/tomcat4/work/Apache/www.r-hosts.com/_/examples/jsp/checkbox/ checkresult$jsp.java:75: Class checkbox.CheckTest not found. foo = (checkbox.CheckTest) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "checkbox.CheckTest");
                                           ^
3 errors, 1 warning

at org.apache.jasper.compiler.Compiler.compile(Compiler.java:285) at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:548) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(J spServlet.java:176) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle t.java:188) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
...
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 72) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:458) at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:551)
        at java.lang.Thread.run(Thread.java:536)

2003-03-28 19:57:21 WarpEngine[Apache]: Mapping request
2003-03-28 19:57:21 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception org.apache.jasper.compiler.CompileException: /examples/jsp/sessions/carts.jsp(30,0) File "/jsp/sessions/carts.html" not found at org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspPars eEventListener.java:789) at org.apache.jasper.compiler.DelegatingListener.handleDirective(Delegating Listener.java:125) at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:255)
        at org.apache.jasper.compiler.Parser.parse(Parser.java:1145)
        at org.apache.jasper.compiler.Parser.parse(Parser.java:1103)
...
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:458) at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:551)
        at java.lang.Thread.run(Thread.java:536)

You will need to have a web.xml file, and in it should contain any
servlets that need to be started, and used.

It may still be required even outside of the one in the different apps.
Worse case just leave the one at the doc base empty. Include the basic
stuff, but leave out any servlet entries. Something like

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>

<web-app>

</web-app>
I've added this inside site1/web/WEB-INF; and the error in the log goes away. However errors on some .jsps are still given.

Works: http://www.r-hosts.com/examples/jsp/snp/snoop.jsp
Doesn't work: http://www.r-hosts.com/examples/jsp/simpletag/foo.jsp

Do you think perhaps it's not seeing the other web.xml within the site1/web/examples/WEB-INF directory and hence also not seeing all the classes within that directory, since the server.xml specifies site1/web as the web application home directory?

Indeed this would seem to fit. All the servlets are broken (since the new web.xml is empty) and any .jsp that relies on special classes that would be in site1/web/examples/WEB-INF/classes also breaks.

I could copy all the classes and web.xml from web/examples/WEB-INF into web/WEB-INF but my web applications are all quite self contained and I want to be able to run several from the site1/web directory.

I think I need to modify the docBase in server.xml to point directly to the web application folders rather than one level above. What do you think? If this is the case I'm not at all sure quite how to do this.

Thanks,


Peter