https://bz.apache.org/bugzilla/show_bug.cgi?id=59255

            Bug ID: 59255
           Summary: 404 due to NullPointer in Mapper.java
           Product: Tomcat 8
           Version: 8.0.29
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: mmikolajc...@xtm-intl.com

Since update to Tomcat 8.0.29 we noticed problems in our Struts based
application. Some actions in random moments returned 404 errors without any
log. The same problem appeared in 8.0.30-33. We analyzed changes made between
versions 8.0.28 and 8.0.29 and by adding them one by one we found that the
problem is caused by org.apache.catalina.mapper.Mapper and new properties in
Context: mapperContextRootRedirectEnabled and mapperDirectoryRedirectEnabled.
mappingData.context.getMapper...RedirectEnabled() throws in some situations
null pointer exception because mappingData.context in null. 

After changing code of Mapper.java in Tomcat 8.0.33 and recompiling we
confirmed that
changes:879c879,883
<         if(mappingData.wrapper == null && noServletPath) {
---
>       if (mappingData.wrapper == null && noServletPath && mappingData.context 
> == null){
>               log.error("Kaboom:  " + mappingData.toString());
>       } else {
>         if(mappingData.wrapper == null && noServletPath &&
>                 mappingData.context.getMapperContextRootRedirectEnabled()) {
887a892
>       }
1006c1011,1015
<                 if (file != null && file.isDirectory()) {
---
>               if (file != null && file.isDirectory() && mappingData.context 
> == null){
>                       log.error("Kaboom:   " + mappingData.toString());
>               } else {
>                 if (file != null && file.isDirectory() &&
>                         
> mappingData.context.getMapperDirectoryRedirectEnabled()) {
1017a1027
>               }

logs in catalina.out:
31-Mar-2016 10:23:28.633 SEVERE [ajp-nio-0.0.0.0-8009-exec-1]
org.apache.catalina.mapper.Mapper.internalMapWrapper Kaboom:  
org.apache.catalina.mapper.MappingData@6443d97d
31-Mar-2016 10:24:40.946 SEVERE [ajp-nio-0.0.0.0-8009-exec-1]
org.apache.catalina.mapper.Mapper.internalMapWrapper Kaboom:  
org.apache.catalina.mapper.MappingData@6443d97d
31-Mar-2016 10:25:26.272 SEVERE [ajp-nio-0.0.0.0-8009-exec-3]
org.apache.catalina.mapper.Mapper.internalMapWrapper Kaboom:  
org.apache.catalina.mapper.MappingData@14a421a8

If there is anything that we can do to help you solve this problem please send
us information how we can help.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to