Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-4657

servletRegistration.getClassName() may be null and cause an NPE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 4.1.0-RC1
    • 5.0.0, 4.1.0-RC2
    • None
    • None

    Description

      Exception:

      Stack Dump = java.lang.NullPointerException: type is null.
      at org.apache.myfaces.core.api.shared.lang.Assert.notNull(Assert.java:35)
      at org.apache.myfaces.util.lang.ClassUtils.classForName(ClassUtils.java:207)
      at org.apache.myfaces.util.lang.ClassUtils.simpleClassForName(ClassUtils.java:258)
      at org.apache.myfaces.application.FacesServletMappingUtils.isFacesServlet(FacesServletMappingUtils.java:177)
      at org.apache.myfaces.webapp.MyFacesContainerInitializer.checkForFacesServlet(MyFacesContainerInitializer.java:326)
      at org.apache.myfaces.webapp.MyFacesContainerInitializer.onStartup(MyFacesContainerInitializer.java:143)

      Introduced via https://github.com/apache/myfaces/commit/e7d8521ee9214ff1dce24ed6fc2b8627e6461213

      Web.xml Snippet to reproduce:

         <servlet>
              <servlet-name>test.jsp</servlet-name>
              <jsp-file>/test.jsp</jsp-file>
          </servlet>
          <servlet-mapping>
              <servlet-name>test.jsp</servlet-name>
              <url-pattern>/test.jsp</url-pattern>
          </servlet-mapping>


      There is no servlet class in this scenario, so the code tries to search for a null class name.

      Attachments

        Activity

          People

            volosied Volodymyr Siedlecki
            volosied Volodymyr Siedlecki
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: