----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files.  Don't make us guess your problem!!!
----------------------------------------------------------------

Perhaps I can help.  I don't know of any specific documentation that deals
with the problem you mention, but I'm working on the exact same sort of
thing that you are, and I've found a solution to it.
   The solution:
       In the jserv.properties file (it should be located in someplace like
/etc/httpd/conf/jserv/jserv.properties), add the following line:
    wrapper.classpath="/your/path/to/mm.mysql.jdbc-1.2b"  Don't include the
quotes, and don't put a slash at the end.
    The jserv engine will automatically look down that directory for
included files, so when you use the line
Class.forName( "org.gjt.mm.mysql.Driver" );
It will look down the mm.mysql directory, and follow the path all the way
down.
If there's any other questions or problems, e-mail me, and I'll be happy to
help!
P.S.  How much work have you done with servlets?  Maybe you can help by
answering some of my problems :)
Thanks!
Michael


----- Original Message -----
From: Kate Dubiel <[EMAIL PROTECTED]>
To: Java Apache Users <[EMAIL PROTECTED]>
Sent: Tuesday, December 07, 1999 7:25 PM
Subject: Class Not Found With mm.mysql


> ----------------------------------------------------------------
> BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
> WHEN YOU POST, include all relevant version numbers, log files,
> and configuration files.  Don't make us guess your problem!!!
> ----------------------------------------------------------------
>
> I have found numerous posts in the newsgroup archives and FAQ's from
> people with a similar problem to the one I describe here, but so far
> have found no solutions, just a lot of follow-up questions and "try
> this, try that" responses.
>
> I want to develop servlets that access a MySQL database.  On my system,
> MySQL is up and running.  Apache, the JDK, the JSDK, JServe, and the
> JServe SSI module are all functioning nicely together (amazingly
> enough); I can run "normal" servlets on this setup with no problems.
>
>
> THE PROBLEM
>
> The problem is the JDBC driver, or more specifically, JServe's ability
> to locate the driver.  When I run a servlet which makes use of the JDBC
> driver, with the following from my Java code:
>
>   // Load the MySQL driver
>   Class.forName("org.gjt.mm.mysql.Driver").newInstance();
>
> I get a "Document contains no data" in my browser, and the following
> message in my /var/log/httpd/error_log file:
>
> Unable to find Driver.class.java.lang.ClassNotFoundException:
> org.gjt.mm.mysql.Driver.class
> at org.apache.java.lang.AdaptiveClassLoader.loadClass
> (AdaptiveClassLoader.java:437)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java)
> at RandomQuote.doGet(RandomQuote.java:19)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:270)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:309)
> at org.apache.jserv.JServConnection.processRequest
> (JServConnection.java:314)
> at org.apache.jserv.JServConnection.run
> (JServConnection.java:188)
> at java.lang.Thread.run(Thread.java)
>
>
> MY SETUP:
>
> Red Hat Linux 6.0
> Apache 1.3
> JDK 1.1.7 v 3 (I didn't get 1.2 because Blackdown only has that in
> pre-release)
> JSDK 2.0
> Apache JServ 1.1b2
> Apache JServ SSI 1.1.2
> MySQL 3.22.27
> mm.mysql JDBC Driver 1.2b
>
> mm.mysql is in a directory structure like this:
>
> <root>
>   mm.mysql.jdbc-1.2b
>     mysql_comp.jar   (compressed jar file)
>     mysql_uncomp.jar (uncompressed jar file)
>     org
>       gjt
>         mm
>           mysql
>             *.class files
>             *.java files
>
> My /etc/httpd/conf/jserv.properties file contains the following:
>
> wrapper.classpath=/usr/lib/apache/ApacheJServ.jar
> wrapper.classpath=/home/httpd/classes/servlet-2.0.jar
> wrapper.classpath=/mm.mysql.jdbc-1.2b/mysql_uncomp.jar
>
> There is currently nothing from the mm.mysql JDBC drivers included in
> any wrapper.path or repositories directive.  (Should there be???  I have
> seen posts suggesting trying this, and I have tried adding the path to
> this driver to those parameters, but with no success.)
>
>
> WHAT I'VE ALREADY TRIED
>
> To save time, here is a list of things I found in the FAQ's to try that
> I have already tried and have not solved the problem:
>
>  - I tried recompiling the mysql_uncomp.jar file (on the possibility it
> may be corrupt).
>
>  - I tried moving the .jar file into the Java class directory (and
> changing both the environment classpath and wrapper classpath
> accordingly), on the possibility there may be some attribute of the
> mm.mysql directory that was preventing JServe from "seeing" it.
>
>  - I tried (as mentioned above) adding the path to the jar file to the
> wrapper classpath.  (I left it that way, even when that didn't fix the
> problem because I still think it should be there.)
>
> - I tried adding the path to the jar file to the wrapper path, in
> addition to adding it to the classpath.
>
> - I tried adding the path to the JDBC class files to the servlet zone
> repositories, in addition to having the jar file in the wrapper
> classpath.  It was something to try, anyway.
>
> - I tried adding the path to the JDBC jar and class files to the wrapper
> file path.
>
>
> MY QUESTIONS (other than, "Why isn't it working?"):
>
> Does, or does not, JServ use the environment variables CLASSPATH, PATH,
> and/or JAVA_HOME?  I've seen one post that says JServ ignores the
> environment variables by default and uses its wrapper settings, and
> another one which says you must set the environment variables for JServ
> to be able to find all the classes and Java executables.  Can someone
> clarify this for me?
>
> Is there any document or Howto that deals comprehensively with all the
> things that must be done to get additional librarys to work with JServ
> (all the parameters that need to be set, etc.)?  The installation Howto
> that came with JServ is good, but it only deals with getting JServ to
> work.  What are some of the principals we need to be aware of when
> adding java libraries to work with it?
>
> Is there anyone "out there" who is using JServ with mm.mysql
> successfully?  I'd love to hear from you.
>
> Thanks,
> Kate
>
>
> --
> --------------------------------------------------------------
> Please read the FAQ! <http://java.apache.org/faq/>
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Archives and Other:  <http://java.apache.org/main/mail.html>
> Problems?:           [EMAIL PROTECTED]
>
>



--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to