Skip to Content
10
Former Member
Jun 25, 2015 at 05:06 PM

Intermittent NullPointerException on hmc login

709 Views

Hi, I am getting NullPointerException on the screen when I try to access localhost:9001/hmc/hybris and this happens intermittently.

For instance, I login to hmc, and after a while try to reload the hmc page, it gives null pointer exception. But if I reload the page again, the error is gone and login page is showing up correctly.

Hybris version: 5.5.1.1

I am trying to upgrade the system from 4.7.9 to 5.5.1.1. We have not seen this error on 4.7.9

Analysis: I tried to trace the log using the decompiled version of code and looks like it is failing because the context is null. I wasn't able to replicate this issue to confirm this though.

To replicate this issue I tried the following:

  • Tried session invalidate on hmc : This works fine and takes me to the login page, No error is shown.

  • Changed the timeout of the below porperties to 1 min, then reload the page: This also works fine and takes me to the login page, No error is shown. hmc.windowtimeout=60 default.session.timeout=60

Error Log: Jun 25, 2015 1:31:38 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [hmc] in context with path [/hmc] threw exception [Error while processing internal filterchain. Exception occurred at chain position: 4 of 8. Current filter: 'de.hybris.platform.servicelayer.web.SessionFilter@52bd3ac'!; nested exception is java.lang.NullPointerException] with root cause java.lang.NullPointerException at org.apache.catalina.connector.Request.getServletContext(Request.java:1648) at de.hybris.platform.core.Registry.getWebApplicationContextIfExists(Registry.java:969) at de.hybris.platform.core.Registry.getApplicationContext(Registry.java:952) at de.hybris.platform.jalo.JaloSession.createViaSpringIfBeanExists(JaloSession.java:268) at de.hybris.platform.jalo.JaloSession.createInstance(JaloSession.java:239) at de.hybris.platform.jalo.JaloConnection.createSession(JaloConnection.java:754) at de.hybris.platform.jalo.JaloConnection.createAnonymousCustomerSession(JaloConnection.java:666) at de.hybris.platform.jalo.JaloConnection.createAnonymousCustomerSession(JaloConnection.java:648) at de.hybris.platform.servicelayer.session.impl.DefaultSessionService.createNewSession(DefaultSessionService.java:76) at de.hybris.platform.servicelayer.web.SessionFilter.createNewJaloSession(SessionFilter.java:128) at de.hybris.platform.servicelayer.web.SessionFilter.activateSession(SessionFilter.java:115) at de.hybris.platform.servicelayer.web.SessionFilter.doFilter(SessionFilter.java:71) at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:226) at de.hybris.platform.servicelayer.web.RedirectWhenSystemIsNotInitializedFilter.doFilter(RedirectWhenSystemIsNotInitializedFilter.java:104) at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:226) at de.hybris.platform.servicelayer.web.DynamicTenantSwitchingFilter.doFilterInternal(DynamicTenantSwitchingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:226) at de.hybris.platform.servicelayer.web.Log4JFilter.doFilter(Log4JFilter.java:47) at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain$InternalFilterChain.doFilter(AbstractPlatformFilterChain.java:226) at de.hybris.platform.servicelayer.web.AbstractPlatformFilterChain.doFilterInternal(AbstractPlatformFilterChain.java:156) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at de.hybris.platform.servicelayer.web.XSSFilter.doFilter(XSSFilter.java:230) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314) 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:745)

Any suggestions on this will be really helpful.

Thanks, Karthik