LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1113|回复: 2

求助新手问题:Tomcat/5.0.28无法连接MYSQL.(JDBC)

[复制链接]
发表于 2004-11-24 15:07:20 | 显示全部楼层 |阅读模式
已经将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


请大家帮忙.
 楼主| 发表于 2004-11-24 15:37:54 | 显示全部楼层
谁来帮帮我啊?
现在连普通的JSP页面都执行不来了!
难道这于整合了apache有关?
发表于 2004-11-24 19:42:10 | 显示全部楼层
错误和你的sql没有关系,主要是错在xml解析上面,看看你的web.xml有没有问题,或者你使用了其他什么xml配置脚本!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表