mysql+eclipse+tomcat问题

ianley 2009-05-29 11:14:19
tomcat、MYSQL安装正常,mysql_connector配置正常,eclipse下运行jsp页面,却出现如下报错,请仁兄指点,谢谢!


信息: Server startup in 505 ms
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

Last packet sent to the server was 0 ms ago.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:506)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2104)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:729)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
……
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
……
严重: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at org.apache.jsp.index_jsp._jspService(index_jsp.java:148)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

...全文
136 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
ytsmtxxi 2009-06-08
  • 打赏
  • 举报
回复
哦。对了,还有Mysql的服务有没有启动。没有的话,也会报这个错误的。
ytsmtxxi 2009-06-08
  • 打赏
  • 举报
回复
连接mysql的问题。你现在是没有连接上。检查你的mysql的JDBC驱动能不能。如果可以用的话,那就看一下你的连接的时候的用户名跟密码会不会有错误。应该就是这两个的问题了。
lvfeng19806001 2009-06-01
  • 打赏
  • 举报
回复
没有正确连接数据库,看数据库服务是否启动,连接字符串,uid,pwd等是否正确!
gengwanshanreally 2009-05-31
  • 打赏
  • 举报
回复
解决了连接问题就不空指针了
lgq_0714 2009-05-30
  • 打赏
  • 举报
回复

Caused by: java.net.ConnectException: Connection refused: connect

检查数据库连接密码是否正确、mysql服务是否启动

java.lang.NullPointerException

index.jsp中空指向异常
zharrisl 2009-05-29
  • 打赏
  • 举报
回复
Caused by: java.net.ConnectException: Connection refused: connect
还是连接数据库的问题

58,454

社区成员

发帖
与我相关
我的任务
社区描述
Java Eclipse
社区管理员
  • Eclipse
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧