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

ClassNotFoundException during initialization

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.12, 2.3.3
    • 2.2.13, 2.3.4
    • None
    • None

    Description

      A ClassNotFoundException can occur during initialization when a servlet mapping is defined which cannot be loaded by MyFaces.  We should update WebXml.getFacesServletMappings() to not throw an exception when it can't load a class.

      javax.faces.FacesException: java.lang.ClassNotFoundException: <classname>
          at org.apache.myfaces.shared.util.ClassUtils.simpleClassForName(ClassUtils.java:239)
          at org.apache.myfaces.shared.util.ClassUtils.simpleClassForName(ClassUtils.java:215)
          at org.apache.myfaces.shared_impl.webapp.webxml.WebXml.getFacesServletMappings(WebXml.java:136)
          at org.apache.myfaces.spi.impl.DefaultWebConfigProvider.getFacesServletMappings(DefaultWebConfigProvider.java:46)
          at org.apache.myfaces.webapp.AbstractFacesInitializer.initFaces(AbstractFacesInitializer.java:161)

      This is related to the fix made in MYFACES-3629

      Any servlet defined in the web.xml that can't be loaded by at the time of JSF initialization will cause this problem.  As an example, this definition will cause MyFaces initialization to fail:
          <servlet>
              <servlet-name>unloadable</servlet-name>
              <servlet-class>does.not.Exist</servlet-class>
              <load-on-startup>1</load-on-startup>
          </servlet>

      Attachments

        Activity

          People

            wtlucy Bill Lucy
            wtlucy Bill Lucy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 40m
                40m