You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by wt...@apache.org on 2019/03/18 17:30:51 UTC
[myfaces] branch 2.3.x updated: avoid CNFE in
getFacesServletMappings
This is an automated email from the ASF dual-hosted git repository.
wtlucy pushed a commit to branch 2.3.x
in repository https://gitbox.apache.org/repos/asf/myfaces.git
The following commit(s) were added to refs/heads/2.3.x by this push:
new 60bd9f6 avoid CNFE in getFacesServletMappings
new 4eef7e4 Merge pull request #47 from wtlucy/getFacesServletMappings_CNFE_2.3
60bd9f6 is described below
commit 60bd9f67d849dd81bb518615ef3c3dee38da2242
Author: Bill Lucy <wt...@gmail.com>
AuthorDate: Fri Mar 15 15:37:16 2019 -0400
avoid CNFE in getFacesServletMappings
---
.../apache/myfaces/shared_impl/webapp/webxml/WebXml.java | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/impl/src/main/java/org/apache/myfaces/shared_impl/webapp/webxml/WebXml.java b/impl/src/main/java/org/apache/myfaces/shared_impl/webapp/webxml/WebXml.java
index 914d467..84ce77a 100644
--- a/impl/src/main/java/org/apache/myfaces/shared_impl/webapp/webxml/WebXml.java
+++ b/impl/src/main/java/org/apache/myfaces/shared_impl/webapp/webxml/WebXml.java
@@ -30,6 +30,7 @@ import javax.faces.context.ExternalContext;
import javax.faces.webapp.FacesServlet;
import org.apache.myfaces.shared.config.MyfacesConfig;
+import org.apache.myfaces.shared.util.ClassUtils;
/**
* @author Manfred Geiler (latest modification by $Author$)
@@ -132,7 +133,17 @@ public class WebXml
// </servlet>
continue;
}
- Class servletClass = org.apache.myfaces.shared.util.ClassUtils.simpleClassForName((String)entry.getValue());
+
+ Class servletClass = ClassUtils.simpleClassForName((String) entry.getValue(), false);
+ if (servletClass == null)
+ {
+ if (log.isLoggable(Level.FINEST))
+ {
+ log.finest("ignoring servlet " + servletName + " because its class could not be loaded");
+ }
+ continue;
+ }
+
if (FacesServlet.class.isAssignableFrom(servletClass) ||
DelegatedFacesServlet.class.isAssignableFrom(servletClass) ||
servletClass.getName().equals(_delegateFacesServlet))