[
https://issues.apache.org/jira/browse/MYFACES-4284?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16793900#comment-16793900
]
Bill Lucy commented on MYFACES-4284:
------------------------------------
Interestingly, with this fix Tomcat inits the JSF app and doesn't log any
errors. On Open Liberty, the JSF app is initialized and an error message is
logged for the bad servlet. Regardless, I'll go ahead and work on merging the
PRs.
> ClassNotFoundException during initialization
> --------------------------------------------
>
> Key: MYFACES-4284
> URL: https://issues.apache.org/jira/browse/MYFACES-4284
> Project: MyFaces Core
> Issue Type: Bug
> Affects Versions: 2.3.3
> Reporter: Bill Lucy
> Assignee: Bill Lucy
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> 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>_
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)