You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jon Shoberg <js...@cbd.net> on 2001/05/18 01:12:55 UTC
[Apa/TomC] Context switching in servers ???
How can I have a directory that serves JSP pages though Apache/Tomcat,
static .html files though apache, and imaged though apache. I don't want
EVERYTHING going though tomcat. Here is the directory structure ...
Any thoughts ???? Here is some imfo ....
http://myapp.localhost (same as http://localhost/myapp)
|
|- index.jsp (served by apache/tomcat.. this is working)
|- static.html (when requested served by apache only .. need to get
working)
|
+- images (sub-directory)
|
|- logo.gif (served by apache only .. need to get working)
# Blurb from tomcat.conf which gets included into httpd.conf
#
############################## Context mapping - all requests go to tomcat
ApJServMount /examples /root
# ApJServMount /myapp /root
<VirtualHost myapp.localhost>
ServerAdmin webmaster@localhost
DocumentRoot "C:/Program Files/Apache
Group/jakarta/tomcat/webapps/myapp"
ServerName myapp.localhost
ApJServMount / /root
ErrorLog logs/myapp.localhost-error_log
CustomLog logs/myapp.localhost-access_log common
</VirtualHost>
<!-- Blurb from server.xml to define a named host -->
<Host name="myapp.localhost" >
<Context path=""
docBase="webapps/myapp"
crossContext="false"
debug="0"
reloadable="true" >
</Context>
</Host>
Re: [Apa/TomC] Context switching in servers ???
Posted by Jeff Kilbride <je...@kilbride.com>.
With mod_jk, you can specify a wildcard in your mount points:
JkMount /*.jsp ajp13
I'm not sure how you do this with Jserv, though. Have you checked the docs?
http://jakarta.apache.org/tomcat/jakarta-tomcat/src/doc/tomcat-apache-howto.
html
--jeff
----- Original Message -----
From: "Jon Shoberg" <js...@cbd.net>
To: <JS...@JAVA.SUN.COM>; <to...@jakarta.apache.org>
Sent: Thursday, May 17, 2001 4:12 PM
Subject: [Apa/TomC] Context switching in servers ???
> How can I have a directory that serves JSP pages though Apache/Tomcat,
> static .html files though apache, and imaged though apache. I don't want
> EVERYTHING going though tomcat. Here is the directory structure ...
>
>
> Any thoughts ???? Here is some imfo ....
>
> http://myapp.localhost (same as http://localhost/myapp)
> |
> |- index.jsp (served by apache/tomcat.. this is working)
> |- static.html (when requested served by apache only .. need to get
> working)
> |
> +- images (sub-directory)
> |
> |- logo.gif (served by apache only .. need to get working)
>
>
>
>
>
> # Blurb from tomcat.conf which gets included into httpd.conf
> #
> ############################## Context mapping - all requests go to tomcat
>
> ApJServMount /examples /root
> # ApJServMount /myapp /root
>
>
> <VirtualHost myapp.localhost>
> ServerAdmin webmaster@localhost
> DocumentRoot "C:/Program Files/Apache
> Group/jakarta/tomcat/webapps/myapp"
> ServerName myapp.localhost
> ApJServMount / /root
> ErrorLog logs/myapp.localhost-error_log
> CustomLog logs/myapp.localhost-access_log common
> </VirtualHost>
>
>
>
>
>
>
> <!-- Blurb from server.xml to define a named host -->
>
>
> <Host name="myapp.localhost" >
> <Context path=""
> docBase="webapps/myapp"
> crossContext="false"
> debug="0"
> reloadable="true" >
> </Context>
> </Host>
>
Re: [ClassPath] JSP, JDBC, and mm.MySql
Posted by Matt Goss <mg...@rtci.com>.
Place your jar file in the WEB-INF/lib folder.
Matt
Jon Shoberg wrote:
>
> Its getting late but I'm not having too much luck at getting a sucessful
> JSP / mysql connection. Given the error message below can someone explain
> where I should be setting my class path and the actual mm.mysql files or the
> entire jar file? I am using jdk1.3 with the latest apache on win2K pro.
>
> My JSP page looks like and the error is below:
>
> <html>
> <head>
> <title>Login</title>
> </head>
> <%@ page import="java.sql.*, java.io.*" %>
> <%
> // Step 1: registering the MySQL JDBC driver
>
> try {
> // The newInstance() call is a work around for some
> // broken Java implementations
> Class.forName("org.gjt.mm.mysql.Driver").newInstance();
> }
> catch (Exception E) {
> out.println("<br><br>some crap<br><br>Unable to load
> driver.<br><br><br><br>");
> E.printStackTrace(new PrintWriter(out));
> }
>
> %>
>
> </html>
>
> error:
>
> java.lang.ClassNotFoundException: Unable to load class
> org.gjt.mm.mysql.Driver at
> org.apache.jasper.servlet.JasperLoader.findClass(JasperLoader.java:223) at
> org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:147) 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:120) at
> _0002fsql_0002ejspsql_jsp_7._jspService(_0002fsql_0002ejspsql_jsp_7.java:70)
> 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(JspServlet.ja
> va: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(ContextManager.java:79
> 7) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
> at
> org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
> (Ajp12ConnectionHandler.java:166) 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)
Re: [ClassPath] JSP, JDBC, and mm.MySql
Posted by Ivan Kougaenko <iv...@koogy.com>.
double check that everything is set up according to this doc
http://mmmysql.sourceforge.net/doc/mm.doc/x68.htm
I think you should have the entire jar file in the classpath
----- Original Message -----
From: "Jon Shoberg" <js...@CBD.NET>
To: <JS...@JAVA.SUN.COM>
Sent: Thursday, May 17, 2001 9:49 PM
Subject: [ClassPath] JSP, JDBC, and mm.MySql
> Its getting late but I'm not having too much luck at getting a
sucessful
> JSP / mysql connection. Given the error message below can someone explain
> where I should be setting my class path and the actual mm.mysql files or
the
> entire jar file? I am using jdk1.3 with the latest apache on win2K pro.
>
> My JSP page looks like and the error is below:
>
> <html>
> <head>
> <title>Login</title>
> </head>
> <%@ page import="java.sql.*, java.io.*" %>
> <%
> // Step 1: registering the MySQL JDBC driver
>
> try {
> // The newInstance() call is a work around for some
> // broken Java implementations
> Class.forName("org.gjt.mm.mysql.Driver").newInstance();
> }
> catch (Exception E) {
> out.println("<br><br>some crap<br><br>Unable to load
> driver.<br><br><br><br>");
> E.printStackTrace(new PrintWriter(out));
> }
>
>
> %>
>
> </html>
>
> error:
>
>
> java.lang.ClassNotFoundException: Unable to load class
> org.gjt.mm.mysql.Driver at
> org.apache.jasper.servlet.JasperLoader.findClass(JasperLoader.java:223) at
> org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:147) 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:120) at
>
_0002fsql_0002ejspsql_jsp_7._jspService(_0002fsql_0002ejspsql_jsp_7.java:70)
> 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(JspServlet.ja
> va: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(ContextManager.java:79
> 7) at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
> at
>
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
> (Ajp12ConnectionHandler.java:166) 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)
>
>
===========================================================================
> To unsubscribe: mailto listserv@java.sun.com with body: "signoff
JSP-INTEREST".
> For digest: mailto listserv@java.sun.com with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===========================================================================
> To unsubscribe: mailto listserv@java.sun.com with body: "signoff
JSP-INTEREST".
> For digest: mailto listserv@java.sun.com with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
[ClassPath] JSP, JDBC, and mm.MySql
Posted by Jon Shoberg <js...@cbd.net>.
Its getting late but I'm not having too much luck at getting a sucessful
JSP / mysql connection. Given the error message below can someone explain
where I should be setting my class path and the actual mm.mysql files or the
entire jar file? I am using jdk1.3 with the latest apache on win2K pro.
My JSP page looks like and the error is below:
<html>
<head>
<title>Login</title>
</head>
<%@ page import="java.sql.*, java.io.*" %>
<%
// Step 1: registering the MySQL JDBC driver
try {
// The newInstance() call is a work around for some
// broken Java implementations
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
}
catch (Exception E) {
out.println("<br><br>some crap<br><br>Unable to load
driver.<br><br><br><br>");
E.printStackTrace(new PrintWriter(out));
}
%>
</html>
error:
java.lang.ClassNotFoundException: Unable to load class
org.gjt.mm.mysql.Driver at
org.apache.jasper.servlet.JasperLoader.findClass(JasperLoader.java:223) at
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:147) 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:120) at
_0002fsql_0002ejspsql_jsp_7._jspService(_0002fsql_0002ejspsql_jsp_7.java:70)
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(JspServlet.ja
va: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(ContextManager.java:79
7) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection
(Ajp12ConnectionHandler.java:166) 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)