Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.0
-
None
-
None
Description
As described here :
http://www.nabble.com/-S2--possible-NPE-in-Restful2--tf3022218.html
The actual error message is :
java.lang.NullPointerException
org.apache.struts2.dispatcher.mapper.Restful2ActionMapper.getMapping(Restful2ActionMapper.java:97)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:393)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:119)
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:55)
This occurs because restful2 doesn't check to see if the mapping returned by the super call in it's getMapping() method is not null before calling getName() on it.
The patch just adds a check for null, and returns immediately if that's the case.