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.

  • For a prototype I'm developing I've set AnyHostnameVerifier to the Cas20ProxyReceivingTicketValidationFilter: <filter> <filter-name>CASValidationFilter</filter-name> <filter-class> org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter </filter-class> <init-param> .... </init-param> <init-param> <param-name>hostnameVerifier</param-name> <param-value>org.jasig.cas.client.ssl.AnyHostnameVerifier</param-value> </init-param> </filter> This lead to the following exception: Feb 11, 2011 8:59:51 AM org.apache.catalina.core.StandardContext filterStart SEVERE: Exception starting filter CASValidationFilter java.lang.NullPointerException at org.jasig.cas.client.util.ReflectUtils.newInstance(ReflectUtils.java:79) at org.jasig.cas.client.util.ReflectUtils.newInstance(ReflectUtils.java:66) at org.jasig.cas.client.validation.AbstractTicketValidationFilter.getHostnameVerifier(AbstractTicketValidationFilter.java:90) at org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter.getTicketValidator(Cas20ProxyReceivingTicketValidationFilter.java:154) at org.jasig.cas.client.validation.AbstractTicketValidationFilter.initInternal(AbstractTicketValidationFilter.java:102) at org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter.initInternal(Cas20ProxyReceivingTicketValidationFilter.java:99) at org.jasig.cas.client.util.AbstractCasFilter.init(AbstractCasFilter.java:82) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4038) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4692) at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1276) at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:625) at org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:136) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) 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.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:186) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:680) This is because in AbstractTicketValidationFilter.getHostnameVerifier does not check if config is null: if (className != null) { if (config != null) return ReflectUtils.newInstance(className, config); else return ReflectUtils.newInstance(className); } Or check if args is null on ReflectUtils, public static <T> T newInstance(final Class<T> clazz, final Object ... args)
    via by Andrea Chiodoni,
  • For a prototype I'm developing I've set AnyHostnameVerifier to the Cas20ProxyReceivingTicketValidationFilter: <filter> <filter-name>CASValidationFilter</filter-name> <filter-class> org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter </filter-class> <init-param> .... </init-param> <init-param> <param-name>hostnameVerifier</param-name> <param-value>org.jasig.cas.client.ssl.AnyHostnameVerifier</param-value> </init-param> </filter> This lead to the following exception: Feb 11, 2011 8:59:51 AM org.apache.catalina.core.StandardContext filterStart SEVERE: Exception starting filter CASValidationFilter java.lang.NullPointerException at org.jasig.cas.client.util.ReflectUtils.newInstance(ReflectUtils.java:79) at org.jasig.cas.client.util.ReflectUtils.newInstance(ReflectUtils.java:66) at org.jasig.cas.client.validation.AbstractTicketValidationFilter.getHostnameVerifier(AbstractTicketValidationFilter.java:90) at org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter.getTicketValidator(Cas20ProxyReceivingTicketValidationFilter.java:154) at org.jasig.cas.client.validation.AbstractTicketValidationFilter.initInternal(AbstractTicketValidationFilter.java:102) at org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter.initInternal(Cas20ProxyReceivingTicketValidationFilter.java:99) at org.jasig.cas.client.util.AbstractCasFilter.init(AbstractCasFilter.java:82) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4038) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4692) at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1276) at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:625) at org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:136) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) 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.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:186) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:680) This is because in AbstractTicketValidationFilter.getHostnameVerifier does not check if config is null: if (className != null) { if (config != null) return ReflectUtils.newInstance(className, config); else return ReflectUtils.newInstance(className); } Or check if args is null on ReflectUtils, public static <T> T newInstance(final Class<T> clazz, final Object ... args)
    via by Andrea Chiodoni,
    • java.lang.NullPointerException at org.jasig.cas.client.util.ReflectUtils.newInstance(ReflectUtils.java:79) at org.jasig.cas.client.util.ReflectUtils.newInstance(ReflectUtils.java:66) at org.jasig.cas.client.validation.AbstractTicketValidationFilter.getHostnameVerifier(AbstractTicketValidationFilter.java:90) at org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter.getTicketValidator(Cas20ProxyReceivingTicketValidationFilter.java:154) at org.jasig.cas.client.validation.AbstractTicketValidationFilter.initInternal(AbstractTicketValidationFilter.java:102) at org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter.initInternal(Cas20ProxyReceivingTicketValidationFilter.java:99) at org.jasig.cas.client.util.AbstractCasFilter.init(AbstractCasFilter.java:82) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4038) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4692) at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1276) at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:625) at org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:136) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) 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.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:186) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:563) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:680)
    No Bugmate found.