2 lonecx lonecx 于 2016.09.27 09:21 提问

Tomcat部署后报空指针异常!

java.lang.NullPointerException
at com.fh.util.Jurisdiction.readMenu(Jurisdiction.java:44)
at com.fh.util.Jurisdiction.hasJurisdiction(Jurisdiction.java:33)
at com.fh.interceptor.LoginHandlerInterceptor.preHandle(LoginHandlerInterceptor.java:31)
at org.springframework.web.servlet.HandlerExecutionChain.applyPreHandle(HandlerExecutionChain.java:134)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:954)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:968)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:859)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:844)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:83)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:784)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:802)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1452)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
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)
之前部署好使过,后来把项目部署到另一个tomcat版本后就这样了。其他机器部署都没有问题。不知道原因在哪,求大神指点。

4个回答

lonecx
lonecx   2016.09.27 09:33
已采纳

修改了代码加了一个判断解决了,之前都好使,突然报错。一直没把重心放在代码上。

u013076997
u013076997   2016.09.27 09:28

java.lang.NullPointerException
at com.fh.util.Jurisdiction.readMenu(Jurisdiction.java:44)
at com.fh.util.Jurisdiction.hasJurisdiction(Jurisdiction.java:33)
at com.fh.interceptor.LoginHandlerInterceptor.preHandle(LoginHandlerInterceptor.java:31)

LoginHandlerInterceptor应该是你的拦截器吧?找到相应代码,看一下,看是哪里报的空指针

diaoliwei2
diaoliwei2   Rxr 2016.09.27 09:34

目前的tomcat和之前好使的tomcat配置有什么不同吗?

Veggiel
Veggiel   2016.09.27 09:34

com.fh.util.Jurisdiction.readMenu(Jurisdiction.java:44)看看你这个44行有什么问题

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!
其他相关推荐
启动tomcat——空指针异常
java.lang.NullPointerException at org.apache.jsp.index_jsp._jspInit(index_jsp.java:22) //参考一: 查询资料,原因是项目jar包和tomcat的jar包冲突了。不兼容。 删除工程里的jsp-api.jar和servlet-api.jar两个jar包,这种解决方案是对的,但是删除完这
myeclipse下部署项目到web服务器时报空指针异常的问题
myeclipse下部署项目到web服务器时报空指针异常的问题 Undefined exploded archive location An internal error occurred during: "Launching portal on Tomcat  7.x". java.lang.NullPointerException 部署一个web项目和若干ej
MyEclipse 部署报错,抛空指针异常的解决办法
某些情况下MyEclipse 可能无法打开 MyEclipse Servers视图, 试图打开视图将导致NPE将被记录。 Could not create the view: An unexpected exception was thrown.  java.lang.NullPointerException  at com.genuitec.eclipse.ast.deploy
什么时候报空指针异常?
空指针异常是我们开发当中经常遇到的一种程序异常情况,也是最简单的一种异常,这是一个运行级别异常,也就是在运行时才会抛出该异常。空指针异常就是我们在对空对象进行的任何操作都会报空指针异常。因此当程序报该异常时找到报错的位置,先进行判断该对象是否为空再进行操作处理。...
自定义控件获取报空指针异常
1、检查findviewbyid的view 2、检查构造方法。
Butterknife7.0.1混淆后报空指针问题
1.在工程的gradle中添加------------------------- Butterknife7.0.1代码混淆 -keep class butterknife.** { *; } -dontwarn butterknife.internal.** -keep class **$$ViewBinder { *; } -keepclasseswithmembern
项目启动就报空指针异常
在使用idea开发时,启动项目后直接报出空指针异常
hibernate 空指针异常
<br />这次写的是hibernate 和spring ,flex工程,在执行hql语句查询时报空指针异常,这个错误找了好几天,到后来才发现是在员工dao里new了部门的dao,原来这样new dao是不行的.
struts2与spring整合时,报空指针NullPointerException异常的解决
下午写了ssh的测试程序,但是最后在运行时,Action里面的service总是注入不进来,提示NullPointerException异常。仔细一看错误提示,肯定是没有注入进来。就比较郁闷了。花了一个下午时间,终于解决了。 原来是: 在spring配置文件中对于action的配置,假设id是useraction,那么在struts.xml中,不应该还是像以前单独用struts时那样,而是将在
为什么我的控件实例化后还是报空指针异常?
我的TextView明明实例化了,为啥setText时候还是给我报空指针异常啊!?