Shale Remoting throws NPE when FacesServlet is not found
--------------------------------------------------------

                 Key: SHALE-434
                 URL: https://issues.apache.org/struts/browse/SHALE-434
             Project: Shale
          Issue Type: Bug
          Components: Remoting
    Affects Versions: 1.1.0-SNAPSHOT
         Environment: All
            Reporter: Ken Paulsen



Shale Remoting looks for the FacesServlet, if it can't find it and throws a NPE 
on line #429 of MappingsHelper.java b/c name is null:

    if (name.equals(servletName)) {

I see that I can work-a-round this issue by supplying a context-param, I tested 
this... it works.  However, since the SWDP may impose shale on all apps, shale 
should not require apps that do this sort of thing to implement work-a-rounds.  
So I tested a fix that avoids the NPE, it also works.  I also modified an 
existing log message in the Bundle.properies file to make it more clear (which 
interestingly did not seem to be used anywhere).

Please apply this patch to resolve this issue.

Thanks!

Ken

Index: MappingsHelper.java
===================================================================
--- MappingsHelper.java (revision 528551)
+++ MappingsHelper.java (working copy)
@@ -408,6 +408,12 @@
                     name = servletName;
                 }
             }
+           if (null == name) {
+               if (log().isInfoEnabled()) {
+                   log().info(bundle.getString("xhtml.noServletMapping"));
+               }
+               return new String[0];
+           }
         }

         // Identify the URL patterns to which this servlet is mapped



Index: Bundle_no.properties
===================================================================
--- Bundle_no.properties        (revision 528618)
+++ Bundle_no.properties        (working copy)
@@ -31,4 +31,4 @@
 xhtml.noMappings       = "Mappings" instansen for denne applikasjonen er ikke 
konfigurert enn\u00E5 - sjekk tjener loggene for \u00E5 forsikre deg om at det 
ikke var oppstarts unntak.
 xhtml.noMechanism      = Ressurs mekanismen du har spesifisert er tom
 xhtml.noResourceId     = Ressurs identifikatoren du spesifiserte er tom
-xhtml.noServletMapping = "Mappings" instansen er ikke konfigurert for servlet 
tilknyttning(er) for javax.facesl.webapp.FacesServlet -- sjekk web.xml filen 
for \u00E5 forsikre deg om at denne servlet er deklarert og tilknyttet.
+xhtml.noServletMapping = "Mappings" instansen er ikke konfigurert for servlet 
tilknyttning(er) for javax.faces.webapp.FacesServlet -- sjekk web.xml filen for 
\u00E5 forsikre deg om at denne servlet er deklarert og tilknyttet.
Index: Bundle.properties
===================================================================
--- Bundle.properties   (revision 528618)
+++ Bundle.properties   (working copy)
@@ -25,4 +25,4 @@
 xhtml.noMappings=The "Mappings" instance for this application has not yet been 
configured -- check your server logs to ensure there were no startup exceptions
 xhtml.noMechanism=The resource mechanism you have specified is null
 xhtml.noResourceId=The resource identifier you have specified is null
-xhtml.noServletMapping=The "Mappings" instance is not configured with the 
servlet mapping(s) for javax.facesl.webapp.FacesServlet -- check your web.xml 
file to make sure this servlet is declared and mapped
+xhtml.noServletMapping=The "Mappings" instance is not configured with the 
servlet mapping(s) for javax.faces.webapp.FacesServlet -- check your web.xml 
file to make sure this Servlet is declared and mapped, or that you have 
identified it with the "org.apache.shale.remoting.FACES_SERVLET_NAME" 
context-param.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to