tomcat无法连接到数据库,eclipse正常连接

wangpeifu 发布于 2016/06/10 21:31
阅读 664
收藏 0
六月 10, 2016 5:56:51 下午 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [aaaaa] in context with path [/netctoss] threw exception
java.lang.NullPointerException
at java.lang.String.<init>(Unknown Source)
at oracle.sql.CharacterSet.AL32UTF8ToString(CharacterSet.java:1518)
at oracle.jdbc.driver.DBConversion.CharBytesToString(DBConversion.java:610)
at oracle.jdbc.driver.DBConversion.CharBytesToString(DBConversion.java:555)
at oracle.jdbc.driver.T4CTTIoauthenticate.receiveOauth(T4CTTIoauthenticate.java:822)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:362)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:441)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at util.DBUtil.getConnection(DBUtil.java:58)
at dao.CostDao.findAll(CostDao.java:20)
at web.MainServlet.findCost(MainServlet.java:123)
at web.MainServlet.service(MainServlet.java:28)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
已经搜索过了没合适答案啊,大神们帮忙看看,分析下原因

加载中
0
qyan
qyan
是不是tomcat的 编码格式跟你jdbc指定的编码格式不一致啊
wangpeifu
wangpeifu
at java.lang.String.<init>(Unknown Source) 关键是没有找到初始化的数据 …………当我又不知道怎么操作啊
wangpeifu
wangpeifu
这个不是吧,编码不一致也是乱码啊
0
西夏一品堂
西夏一品堂
好像是 mysql jar的版本问题
wangpeifu
wangpeifu
用的oracle 11g
0
zcdnsz
zcdnsz
这个是空指针错误,有没有连接数据库?? 应该还有更多的日志吧
返回顶部
顶部