站内搜索
发表回复
收藏 

安装后,访问首页就报空指针错误? 

安装后,访问首页就报空指针错误?

安装后执行报错,如下:
java.lang.NullPointerException
com.hongshee.ejforum.common.CacheManager.loadModerators(Unknown Source)
com.hongshee.ejforum.common.CacheManager.getModerators(Unknown Source)
com.hongshee.ejforum.util.PageUtils.getGroupVO(Unknown Source)
com.hongshee.ejforum.util.PageUtils.getHeaderMenu(Unknown Source)
org.apache.jsp.error_jsp._jspService(error_jsp.java:96)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:68)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:387)
,,,,,,,
tomcat 704,数据库是oracle,也修改WEB-INF/conf/下的配置,已经建了相应的数据库表等。

我是在webapps下直接建立一个目录 forum (把ejforum改了个名字),其它没有任务动作。

启动后,日志里没有错误,

Nov 24, 2010 8:57:42 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory forum
ContextListener: EasyJForum context initialized.
EasyJForum context initialized: /usr/apache-tomcat-7.0.4/webapps/forum/
EasyJForum: Image servlet initialized.
EasyJForum: Opml servlet initialized.
EasyJForum: Rss servlet initialized.
EasyJForum: Ajax servlet initialized.
EasyJForum: Attach servlet initialized.
Nov 24, 2010 8:57:43 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs
Nov 24, 2010 8:57:43 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory host-manager
Nov 24, 2010 8:57:43 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples
Nov 24, 2010 8:57:44 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-9880
Nov 24, 2010 8:57:44 PM org.apache.coyote.ajp.AjpProtocol start
INFO: Starting Coyote AJP/1.3 on ajp-9809
Nov 24, 2010 8:57:44 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2462 ms

又找到 WEB-INF/log/ 下的日志,看到这样的信息:

INFO: EasyJForum context initialized: /usr/apache-tomcat-7.0.4/webapps/forum/
Nov 24, 2010 9:23:57 PM com.hongshee.ejforum.common.CacheManager loadGroups
INFO: Succeeded to load groups to cache!
Nov 24, 2010 9:23:57 PM com.hongshee.ejforum.common.CacheManager loadSections
INFO: Succeeded to load sections to cache!
Nov 24, 2010 9:23:57 PM com.hongshee.ejforum.util.PageUtils log
WARNING: 服务端出现异常,请稍后再试 - null
java.lang.NullPointerException
at com.hongshee.ejforum.common.CacheManager.loadModerators(Unknown Source)
at com.hongshee.ejforum.common.CacheManager.getModerators(Unknown Source)
at com.hongshee.ejforum.util.PageUtils.getGroupVO(Unknown Source)
at com.hongshee.ejforum.util.PageUtils.getHeaderMenu(Unknown Source)
at org.apache.jsp.login_jsp._jspService(login_jsp.java:89)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:68)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:387)
将 Tomcat 的 work 目录下的文件删除后重新启动看看。
黑夜给了我黑色的眼睛,我却用它寻找光明。QQ: 980766123
关键错误在这里
警告: ActionLogDAO.addErrorLog - java.sql.SQLIntegrityConstraintViolationException: ORA-01400: 无法将 NULL 插入 ("GT"."EJF_ERROR_LOG"."USERID")

先改一下数据库就好了。

好像错误是系统未初始化的时候还没有论坛名
可能是你允许游客发帖导致的,Oracle 会将空串作为 null 处理,其它数据库不会有问题。避免这个错误的方法是将 userID 字段的 not null 约束去掉。
黑夜给了我黑色的眼睛,我却用它寻找光明。QQ: 980766123
发表回复
查看积分策略说明

快速回复主题

标题  (可选)
内容

恢复自动保存的数据