问题描述
- 关于安卓开发,连接tomcat抛出exception
-
初学者,自己写的安卓程序,用json连接tomcat,mysql数据库,结果运行时候抛出异常,求帮助!
下面是抛出的异常, 在控制台打印的结果显示除了方括号以外根本没有信息返回
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
at com.mysql.jdbc.ResultSetImpl.findColumn(ResultSetImpl.java:1093)
at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5488)
at utils.DBManager.getAdvertList(DBManager.java:155)
at dao.AdvertDao.getAdvertList(AdvertDao.java:25)
at action.UsersAction.doPost(UsersAction.java:65)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2500)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2489)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:744)
解决方案
是不是sql语句错误
解决方案二:
人家都把异常信息具体的告诉你了。
解决方案三:
看下你这个里面怎么写的呀
at utils.DBManager.getAdvertList(DBManager.java:155)
at dao.AdvertDao.getAdvertList(AdvertDao.java:25)
at action.UsersAction.doPost(UsersAction.java:65)
问题是在这个地方出现的,确认一下你调用sql语句的地方,你是使用什么连接mysql的呢?
解决方案四:
应该你异常没贴全吧
at utils.DBManager.getAdvertList(DBManager.java:155)
at dao.AdvertDao.getAdvertList(AdvertDao.java:25)
at action.UsersAction.doPost(UsersAction.java:65)
看看你的代码
解决方案五:
at utils.DBManager.getAdvertList(DBManager.java:155)
后台程序有错,是不是sql语句没对。你尝试下打印你的sql语句
解决方案六:
是程序执行中报错,还是启动程序就报错。。。但不管怎么说,你这应该就是sql有问题。
时间: 2024-10-22 17:04:04