java.lang.NullPointerException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • The exception is thrown (line 54) when the user-agent is null. Fix proposition : line 52 : +if (userAgent == null) { + return getDefaultThemeName(); +} Stack trace : 2011-02-24 14:19:54,687 ERROR [org.springframework.web.servlet.tags.ThemeTag] - null java.lang.NullPointerException at java.util.regex.Matcher.getTextLength(Matcher.java:1140) at java.util.regex.Matcher.reset(Matcher.java:291) at java.util.regex.Matcher.<init>(Matcher.java:211) at java.util.regex.Pattern.matcher(Pattern.java:888) at org.jasig.cas.services.web.ServiceThemeResolver.resolveThemeName_aroundBody0(ServiceThemeResolver.java:54) at org.jasig.cas.services.web.ServiceThemeResolver.resolveThemeName_aroundBody1$advice(ServiceThemeResolver.java:44) at org.jasig.cas.services.web.ServiceThemeResolver.resolveThemeName(ServiceThemeResolver.java:1) at org.springframework.web.servlet.support.RequestContextUtils.getTheme(RequestContextUtils.java:147) at org.springframework.web.servlet.support.RequestContext.getTheme(RequestContext.java:328) at org.springframework.web.servlet.tags.ThemeTag.getMessageSource(ThemeTag.java:50) at org.springframework.web.servlet.tags.MessageTag.resolveMessage(MessageTag.java:193) at org.springframework.web.servlet.tags.MessageTag.doStartTagInternal(MessageTag.java:165) at org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:79) at org.apache.jsp.WEB_002dINF.view.jsp.errors_jsp._jspx_meth_spring_005ftheme_005f0(errors_jsp.java:159) at org.apache.jsp.WEB_002dINF.view.jsp.errors_jsp._jspService(errors_jsp.java:86) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:438) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302) at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:421) at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:342) at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:286) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:347) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:776) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:705) at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690) at java.lang.Thread.run(Thread.java:662)
    via by Cyrus Rezvani,
  • The exception is thrown (line 54) when the user-agent is null. Fix proposition : line 52 : +if (userAgent == null) { + return getDefaultThemeName(); +} Stack trace : 2011-02-24 14:19:54,687 ERROR [org.springframework.web.servlet.tags.ThemeTag] - null java.lang.NullPointerException at java.util.regex.Matcher.getTextLength(Matcher.java:1140) at java.util.regex.Matcher.reset(Matcher.java:291) at java.util.regex.Matcher.<init>(Matcher.java:211) at java.util.regex.Pattern.matcher(Pattern.java:888) at org.jasig.cas.services.web.ServiceThemeResolver.resolveThemeName_aroundBody0(ServiceThemeResolver.java:54) at org.jasig.cas.services.web.ServiceThemeResolver.resolveThemeName_aroundBody1$advice(ServiceThemeResolver.java:44) at org.jasig.cas.services.web.ServiceThemeResolver.resolveThemeName(ServiceThemeResolver.java:1) at org.springframework.web.servlet.support.RequestContextUtils.getTheme(RequestContextUtils.java:147) at org.springframework.web.servlet.support.RequestContext.getTheme(RequestContext.java:328) at org.springframework.web.servlet.tags.ThemeTag.getMessageSource(ThemeTag.java:50) at org.springframework.web.servlet.tags.MessageTag.resolveMessage(MessageTag.java:193) at org.springframework.web.servlet.tags.MessageTag.doStartTagInternal(MessageTag.java:165) at org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:79) at org.apache.jsp.WEB_002dINF.view.jsp.errors_jsp._jspx_meth_spring_005ftheme_005f0(errors_jsp.java:159) at org.apache.jsp.WEB_002dINF.view.jsp.errors_jsp._jspService(errors_jsp.java:86) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:438) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302) at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:421) at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:342) at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:286) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:347) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:776) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:705) at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690) at java.lang.Thread.run(Thread.java:662)
    via by Cyrus Rezvani,
  • containsIgnoreCase throws NPE
    via GitHub by larsrc
    ,
  • NPE in Verifier
    via GitHub by njbartlett
    ,
    • java.lang.NullPointerException at java.util.regex.Matcher.getTextLength(Matcher.java:1140) at java.util.regex.Matcher.reset(Matcher.java:291) at java.util.regex.Matcher.<init>(Matcher.java:211) at java.util.regex.Pattern.matcher(Pattern.java:888) at org.jasig.cas.services.web.ServiceThemeResolver.resolveThemeName_aroundBody0(ServiceThemeResolver.java:54) at org.jasig.cas.services.web.ServiceThemeResolver.resolveThemeName_aroundBody1$advice(ServiceThemeResolver.java:44) at org.jasig.cas.services.web.ServiceThemeResolver.resolveThemeName(ServiceThemeResolver.java:1) at org.springframework.web.servlet.support.RequestContextUtils.getTheme(RequestContextUtils.java:147) at org.springframework.web.servlet.support.RequestContext.getTheme(RequestContext.java:328) at org.springframework.web.servlet.tags.ThemeTag.getMessageSource(ThemeTag.java:50) at org.springframework.web.servlet.tags.MessageTag.resolveMessage(MessageTag.java:193) at org.springframework.web.servlet.tags.MessageTag.doStartTagInternal(MessageTag.java:165) at org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:79) at org.apache.jsp.WEB_002dINF.view.jsp.errors_jsp._jspx_meth_spring_005ftheme_005f0(errors_jsp.java:159) at org.apache.jsp.WEB_002dINF.view.jsp.errors_jsp._jspService(errors_jsp.java:86) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:438) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302) at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:421) at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:342) at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:286) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:347) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:776) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:705) at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690) at java.lang.Thread.run(Thread.java:662)

    Users with the same issue

    oddodd
    2 times, last one,
    stigkjstigkj
    6 times, last one,
    DunmerDunmer
    1 times, last one,
    Alireza MohamadiAlireza Mohamadi
    1 times, last one,
    tyson925tyson925
    4 times, last one,
    24 more bugmates