新闻页面 服务器出现错误
发表在JavaWeb图书答疑 2020-05-20 悬赏:5 学分 《JavaWeb项目开发实战入门》第1章 企业门户网
是否精华
版块置顶:

 

微信截图_20200520120907.png

2020-05-20 12:09:41编辑
分享到:
精彩评论 6
根号申
学分:4736 LV12
TA的每日心情
2021-07-16 23:48:46
2020-05-20
沙发

在代码里所有异常处理中添加打印异常日志的代码:

catch (Exception e) {

e.printStackTrace();

}

然后再运行,把异常日志发出来


wujiangjun
学分:49 LV2
2020-05-20
板凳

根号申 发表于2020-05-20 13:13

在代码里所有异常处理中添加打印异常日志的代码:

catch (Exception e) {

e.printStackTrace();

}

然后再运行,把异常日志发出来


java.lang.NullPointerException
 at java.util.Properties$LineReader.readLine(Properties.java:434)
 at java.util.Properties.load0(Properties.java:353)
 at java.util.Properties.load(Properties.java:341)
 at com.mingrisoft.DBConnection.getPara(DBConnection.java:44)
 at com.mingrisoft.DBConnection.getConn(DBConnection.java:27)
 at com.mingrisoft.News.ListNewsFront(News.java:26)
 at org.apache.jsp.front.newsFrontList_jsp._jspService(newsFrontList_jsp.java:236)
 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:71)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
 at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:476)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:543)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
 at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
 at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:615)
 at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
 at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:818)
 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1627)
 at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
 at java.lang.Thread.run(Thread.java:748)
java.lang.NumberFormatException: For input string: "Error!"
 at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
 at java.lang.Integer.parseInt(Integer.java:580)
 at java.lang.Integer.parseInt(Integer.java:615)
 at com.mingrisoft.Function.StrToInt(Function.java:107)
 at com.mingrisoft.DBConnection.getConn(DBConnection.java:27)
 at com.mingrisoft.News.ListNewsFront(News.java:26)
 at org.apache.jsp.front.newsFrontList_jsp._jspService(newsFrontList_jsp.java:236)
 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:71)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
 at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:476)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:543)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
 at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
 at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:615)
 at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
 at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:818)
 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1627)
 at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
 at java.lang.Thread.run(Thread.java:748)
java.lang.NullPointerException
 at com.mingrisoft.News.ListNewsFront(News.java:27)
 at org.apache.jsp.front.newsFrontList_jsp._jspService(newsFrontList_jsp.java:236)
 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:71)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
 at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:476)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:543)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
 at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
 at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:615)
 at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
 at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:818)
 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1627)
 at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
 at java.lang.Thread.run(Thread.java:748)

根号申
学分:4736 LV12
TA的每日心情
2021-07-16 23:48:46
2020-05-20
地板

读不到配置文件,检查配置文件地址写没写错

wujiangjun
学分:49 LV2
2020-05-20
4L

根号申 发表于2020-05-20 13:46

读不到配置文件,检查配置文件地址写没写错

#数据库类型:1为MYSQL,默认为1。
DBType=1

#MySQL 数据库连接信息
#MySQL 数据库驱动程序
MySQLDriver=org.gjt.mm.mysql.Driver

# MySQL数据库连接字符串。
# 127.0.0.1:3306 为数据库地址和端口
# webDB 为数据库名,user 为登录用户名,password 为登录密码。请自行更改。
MySQLURL=jdbc:mysql://127.0.0.1:3306/webDB?user=root&password=123456&useUnicode=true&characterEncoding=UTF-8

#您还可以继续添加其它的数据库。

wujiangjun
学分:49 LV2
2020-05-20
5L

根号申 发表于2020-05-20 13:46

读不到配置文件,检查配置文件地址写没写错

老师  ,已经找到问题所在了   谢谢

indarsy
学分:33 LV2
2020-06-11
6L

wujiangjun 发表于2020-05-20 13:52

老师  ,已经找到问题所在了   谢谢

请问怎么解决的啊,我也遇到了这个问题

首页上一页 1 下一页尾页 6 条记录 1/1页
手机同步功能介绍
友情提示:以下图书配套资源能够实现手机同步功能
明日微信公众号
明日之星 明日之星编程特训营
客服热线(每日9:00-17:00)
400 675 1066
mingrisoft@mingrisoft.com
吉林省明日科技有限公司Copyright ©2007-2022,mingrisoft.com, All Rights Reserved长春市北湖科技开发区盛北大街3333号长春北湖科技园项目一期A10号楼四、五层
吉ICP备10002740号-2吉公网安备22010202000132经营性网站备案信息 营业执照