|
已经将mysql-connector-java-3.1.1-alpha-bin.jar文件拷贝到 tomcat目录下的common/lib中,连接无效.
将mysql-connector-java-3.1.1-alpha-bin.jar文件拷贝到 java的安装目录下的/lib目录.在CLASSPATH中增加了这个jar文件,连接无效.
快疯掉了.
我的系统是RedHat AS 3
测试页代码为:
[PHP]<html>
<head>
<title>Test JDBC For MySQL</title>
</head>
<body>
<%@ page contentType="text/html;charset=gb2312" %>
<%
Class.forName("com.mysql.jdbc.Driver").newInstance();
java.sql.Connection conn;
conn = java.sql.DriverManager.getConnection("jdbc:mysql://localhost/mysql?user=root&password=zxcvbn");
%>
</body>
</html>[/PHP]
将
[PHP]Class.forName("com.mysql.jdbc.Driver").newInstance();
#换成
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
[/PHP]
依旧无效, "涛声依旧啊"!!!!!!!!!!!
错误提示如下 :
HTTP Status 500 -
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
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:520)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.io.UTFDataFormatException: Invalid byte 1 of 1-byte UTF-8 sequence.
org.apache.jasper.xmlparser.UTF8Reader.invalidByte(UTF8Reader.java:615)
org.apache.jasper.xmlparser.UTF8Reader.read(UTF8Reader.java:487)
org.apache.jasper.xmlparser.XercesEncodingDetector.load(XercesEncodingDetector.java:1000)
org.apache.jasper.xmlparser.XercesEncodingDetector.skipString(XercesEncodingDetector.java:951)
org.apache.jasper.xmlparser.XercesEncodingDetector.scanXMLDecl(XercesEncodingDetector.java:1209)
org.apache.jasper.xmlparser.XercesEncodingDetector.getEncoding(XercesEncodingDetector.java:108)
org.apache.jasper.xmlparser.XercesEncodingDetector.getEncodingMethod(XercesEncodingDetector.java:121)
org.apache.jasper.xmlparser.XMLEncodingDetector.getEncoding(XMLEncodingDetector.java:57)
org.apache.jasper.compiler.ParserController.determineSyntaxAndEncoding(ParserController.java:313)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:170)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
Apache Tomcat/5.0.28
请大家帮忙. |
|