Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mysql connection problems

Status
Not open for further replies.

gwu

MIS
Dec 18, 2002
239
US
I followed this how-to ( to connect mysql to tomcat. I dont know much about java, yet. I an getting this error: I am able to connect to mysql through the command line on my RH9 install with no problem, just not through tomcat/apache.

thanks

*****
org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 7 in the jsp file: /index.jsp

Generated servlet error:
[javac] Compiling 1 source file

/usr/local/jakarta/work/Catalina/localhost/_/org/apache/jsp/index_jsp.java:48: cannot resolve symbol
symbol : class TestSQLLoad
location: class org.apache.jsp.index_jsp
TestSQLLoad tst = new TestSQLLoad();
^



An error occurred at line: 7 in the jsp file: /index.jsp

Generated servlet error:
/usr/local/jakarta/work/Catalina/localhost/_/org/apache/jsp/index_jsp.java:48: cannot resolve symbol
symbol : class TestSQLLoad
location: class org.apache.jsp.index_jsp
TestSQLLoad tst = new TestSQLLoad();
^
****
 
Tomcat can not find your class "TestSQLLoad". Put the compiled .class file in WEB-INF/classes.
 
I have just done what you suggested but I still get the same error. In the how-to, it says to jar it. Is this necessary? What else is wrong?

thanks in advance

Here is my setup:

*******************
location of TestSQLLoad.class:

/usr/local/apache2/htdocs/WEB-INF/classes/TestSQLLoad.class

and also in:

/usr/local/jakarta/common/classes

*******************
/usr/local/apache2/htdocs/WEB-INF/web.xml:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "<web-app>
<description>MySQL Test App</description>
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/TestDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
*******************
/usr/local/apache2/htdocs/index.jsp:
<html>
<body>
<%TestSQLLoad tst = new TestSQLLoad();
tst.init();%>
<h2>Results</h2>
User <%= tst.getUser() %><br/>
Pwd <%= tst.getPassword() %><br/>
Id <%= tst.getID() %>
</body>
</html>
*******************
I put this in /usr/local/jakarta/conf/web.xml:
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/TestDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
*******************

*******************
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top