问题描述
在公司的时候一切正常,由于公司装修,我们都在家用vpn连公司内网,我的项目却在每次添加记录的时候报空指针,所有添加记录的时候都有这个错误了,很郁闷啊!代码如下:(求各位神人帮忙解答)java.lang.NullPointerExceptionatjava.util.concurrent.ConcurrentHashMap.hash(ConcurrentHashMap.java:157)atjava.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:730)atorg.apache.catalina.session.StandardSession.getAttribute(StandardSession.java:1035)atorg.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessionFacade.java:110)atcom.ite.oxhide.struts.action.AbstractAction.isTokenValid(AbstractAction.java:477)atcom.ite.oxhide.struts.actionEx.BaseSaveAction.repeatSubmit(BaseSaveAction.java:92)atcom.ite.oxhide.struts.actionEx.BaseSaveAction.add(BaseSaveAction.java:118)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava.lang.reflect.Method.invoke(Method.java:585)atorg.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)atorg.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)atcom.ite.oxhide.struts.action.AbstractAction.execute(AbstractAction.java:142)atorg.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:106)atorg.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)atorg.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)atorg.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)atorg.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:710)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:803)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atcom.ite.jbpmex.fiter.JbpmContextHolder.doFilter(JbpmContextHolder.java:88)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atorg.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)atorg.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atcom.ite.sso.client.utils.SSOFilter.input(SSOFilter.java:258)atcom.ite.sso.client.utils.SSOFilter.doFilter(SSOFilter.java:210)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atorg.tdeccn.table.filter.TDExportFilter.doFilter(TDExportFilter.java:175)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atorg.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)atorg.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)atorg.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)atorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)atorg.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)atorg.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)atorg.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)atorg.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)atorg.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)atjava.lang.Thread.run(Thread.java:595)[framework]2009-12-0214:18:46,937-cn.com.ite.ghxt.organization.jfman.action.JfmanSaveAction-95781[http-8088-1]INFOcn.com.ite.ghxt.organization.jfman.action.JfmanSaveAction-===============请求结束===============before:java.lang.NullPointerExceptionatjava.util.concurrent.ConcurrentHashMap.hash(ConcurrentHashMap.java:157)atjava.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:730)atorg.apache.catalina.session.StandardSession.getAttribute(StandardSession.java:1035)atorg.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessionFacade.java:110)atcom.ite.oxhide.struts.action.AbstractAction.isTokenValid(AbstractAction.java:477)atcom.ite.oxhide.struts.actionEx.BaseSaveAction.repeatSubmit(BaseSaveAction.java:92)atcom.ite.oxhide.struts.actionEx.BaseSaveAction.add(BaseSaveAction.java:118)atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod)atsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)atsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)atjava.lang.reflect.Method.invoke(Method.java:585)atorg.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)atorg.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)atcom.ite.oxhide.struts.action.AbstractAction.execute(AbstractAction.java:142)atorg.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:106)atorg.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)atorg.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)atorg.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)atorg.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:710)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:803)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atcom.ite.jbpmex.fiter.JbpmContextHolder.doFilter(JbpmContextHolder.java:88)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atorg.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)atorg.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atcom.ite.sso.client.utils.SSOFilter.input(SSOFilter.java:258)atcom.ite.sso.client.utils.SSOFilter.doFilter(SSOFilter.java:210)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atorg.tdeccn.table.filter.TDExportFilter.doFilter(TDExportFilter.java:175)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)atorg.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)atorg.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)atorg.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)atorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)atorg.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)atorg.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)atorg.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)atorg.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)atorg.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)atjava.lang.Thread.run(Thread.java:595)
解决方案
解决方案二:
程序的问题,和vpdn有啥子关系哟
解决方案三:
空指针,就是用某个东西的时候,这个东西是null。楼主不是做java的吧。
解决方案四:
你得先去程序里找找,看看那个对象为空了。然后,才好解决。
解决方案五:
问题是,我公司的时候是正常的,家里就错误了,怎么回事呢?
解决方案六:
传了一个null的key给ConcurrentHashMap
解决方案七:
楼主,检查下你某个变量是不是为空!
解决方案八:
atcom.ite.oxhide.struts.action.AbstractAction.isTokenValid(AbstractAction.java:477)atcom.ite.oxhide.struts.actionEx.BaseSaveAction.repeatSubmit(BaseSaveAction.java:92)atcom.ite.oxhide.struts.actionEx.BaseSaveAction.add(BaseSaveAction.java:118)lz看看这个BaseSaveAction.add类有没有出错?
解决方案九:
ConcurrentHashMap使用时要加lock,大并发量会出空指针
解决方案十:
应该是程序的问题,debug看一下哪出了问题
解决方案十一:
atcom.ite.oxhide.struts.actionEx.BaseSaveAction.repeatSubmit(BaseSaveAction.java:92)BaseSaveAction.java:92看看是不是这里啊!
解决方案十二:
atcom.ite.oxhide.struts.action.AbstractAction.isTokenValid(AbstractAction.java:477)debugger跑一下
解决方案十三:
com.ite.oxhide.struts.action.AbstractAction.isTokenValid(AbstractAction.java:477)在这里抛出来的,你debug看哪个对象是空的,你操作了null对象,所以抛出了异常!
解决方案十四:
你设置一个断点试试啊,慢慢来,跟那个东西没关系的,估计是程序不够稳健才会造成这种后果