You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2015/02/03 14:20:47 UTC

[Bug 57528] New: Random NPE when sending multipart content

https://issues.apache.org/bugzilla/show_bug.cgi?id=57528

            Bug ID: 57528
           Summary: Random NPE when sending multipart content
           Product: Tomcat 8
           Version: 8.0.18
          Hardware: PC
            Status: NEW
          Severity: major
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: gdogaru@gmail.com

>From time to time I get a NPE when calling a rest api with
content-type=multipart/form-data
The request does not get to spring framework filters, it fails inside tomcat.
I am not using web sockets in my app
The same bug is reproducible both on linux and windows, with the zip version
and tomcat 8.0.18  (I think also with tomcat 7 and older versions of 8)

java.lang.NullPointerException
   
org.apache.catalina.webresources.AbstractArchiveResource.getContent(AbstractArchiveResource.java:177)
   
org.apache.catalina.loader.WebappClassLoaderBase.findResourceInternal(WebappClassLoaderBase.java:2579)
   
org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2405)
   
org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:854)
   
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1274)
   
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1157)
   
org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:998)
   
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:955)
   
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)
   
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)
   
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:868)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:644)
   
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
   
com.knod.core.logging.RequestLoggingFilter.doFilterInternal(RequestLoggingFilter.java:51)
   
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
   
com.codahale.metrics.servlet.AbstractInstrumentedFilter.doFilter(AbstractInstrumentedFilter.java:97)
    com.knod.core.cors.CorsKnodFilter.doFilterInternal(CorsKnodFilter.java:27)
   
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

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

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


[Bug 57528] Random NPE when sending multipart content

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57528

Gabriel Dogaru <gd...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gdogaru@gmail.com

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

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


[Bug 57528] Random NPE when sending multipart content

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57528

--- Comment #2 from Gabriel Dogaru <gd...@gmail.com> ---
I get these failures when running my integration tests. 
tomcat is started using the cargo maven plugin
that is a freshly downloaded tomcat 8, added jdbc libs in common/lib and cargo
app

spring version is 4.1.4 and usually all the rest are at the last version

I can not provide the project, but I will look to see if I can create one, just
no ETA
I don't get this when I run from the ide, it's just weird that it happens from
time to time on command line

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

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


[Bug 57528] Random NPE when sending multipart content

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57528

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

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

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


[Bug 57528] Random NPE when sending multipart content

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57528

Francisco A. Lozano <fl...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |flozano@gmail.com

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

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


[Bug 57528] Random NPE when sending multipart content

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57528

Konstantin Kolinko <kn...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #1 from Konstantin Kolinko <kn...@gmail.com> ---


> ...
> org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1157)
> org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:998)
> ...

I wonder why DispatcherServlet loads a class here. I wonder what class it tries
to load.

Generally DispatcherServlet is a frequently executed piece of code. Maybe you
are hitting a rare path that does not have the necessary classes loaded.

Looking into Spring 4.1.4 (I do not know your Spring version, line numbers do
not match), there are no explicit loadClass() calls in DispatcherServlet. Thus
this class loading is implicit one.


Look into Tomcat log files for the information on when your web application
started and whether it was stopped or reloaded recently.

If a web application has been stopped, class loading should fail, though I
would expect it to fail in a different way.


Can you provide a simple web application reproducing the issue?


> I think also with tomcat 7

Resources implementation with Tomcat 7 is rather different. There is no
"org.apache.catalina.webresources.AbstractArchiveResource" in Tomcat 7.

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

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


[Bug 57528] Random NPE when sending multipart content

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57528

--- Comment #3 from Mark Thomas <ma...@apache.org> ---
Enable debug logging for org.apache.catalina.webresources.JarResource  and
org.apache.catalina.webresources.JarWarResource

That will tell you if there is an IOException causing the null.

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

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