Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] NPE in MultiPartFilter

Just a note, but on many unix systems "/tmp" is often cleaned up by various other subsystems.
This behavior can cause problems for long running contexts on jetty, (if the content it is using in /tmp suddenly goes away).

Joakim Erdfelt
joakim@xxxxxxxxxxx |
(the people behind jetty and cometd)

On Thu, Jan 5, 2012 at 3:02 PM, Steven Arcangeli <arcangeli07@xxxxxxxxx> wrote:
I couldn't find much documentation on Configuration classes, but from what I found it seems like they're for use with a WebAppContext.  Unfortunately, I'm using a ServletContextHandler and couldn't figure out how to switch over and keep all the same functionality.  I'm sure it's possible, but I ended up just hacking it a little bit to work.  This line worked:

context.setAttribute("javax.servlet.context.tempdir", new File("/tmp"));

I'm certain this isn't the proper way to do it, but it was a lot easier than finding the proper way.  Thanks for the assistance!


On Mon, Dec 26, 2011 at 11:23 PM, Jan Bartel <janb@xxxxxxxxxxx> wrote:
Hi Steve,

Happy Holidays to you too.

jetty-7.0.2 is pretty old. Looking at the code for the
MultiPartFilter, it seems that perhaps the temp dir for the context
has not been set as a context attribute. That should be done by the
WebInfConfiguration class that is applied during deployment of the
webapp. Do you have the right set of configuration classes applied in
the correct order? As a minimum, they should be:

I would also check that your webapp includes the 8.1.0.RC2 version of
the jetty-servlets.jar.


On 25 December 2011 18:09, Steven Arcangeli <arcangeli07@xxxxxxxxx> wrote:
> I'm getting a NPE when I try to upload a file.  This happened right after
> upgrading to 8.1.0.RC2.  Previously I was on 7.0.2 with no problems.
>  Haven't tested it on any other versions.  It's possible I'm passing it the
> wrong set of DispatcherTypes?  I've included the stack trace and the final
> log statement.  I'm running it from an embedded server and can provide the
> server code if you like.  Any ideas?
> Merry Christmahanakwanzika!
> -Steve
> 2011-12-24 22:32:45,018 [qtp58472846-24] WARN
>  org.eclipse.jetty.servlet.ServletHandler  - /upload.html
> java.lang.NullPointerException
> at
> org.eclipse.jetty.servlets.MultiPartFilter.doFilter(
> at
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
> at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(
> at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(
> at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(
> at org.eclipse.jetty.servlet.ServletHandler.doScope(
> at
> org.eclipse.jetty.server.session.SessionHandler.doScope(
> at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(
> at org.eclipse.jetty.server.handler.HandlerList.handle(
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(
> at org.eclipse.jetty.server.Server.handle(
> at
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(
> at
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(
> at org.eclipse.jetty.http.HttpParser.parseNext(
> at org.eclipse.jetty.http.HttpParser.parseAvailable(
> at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(
> at
> at
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$
> at
> _______________________________________________
> jetty-users mailing list
> jetty-users@xxxxxxxxxxx
jetty-users mailing list

jetty-users mailing list

Back to the top