-
Our application uses an embedded Jetty server (12.0.22 EE8), which occasionally gets restarted (when configuration changes are applied). I have observed the stack trace at the bottom of this post being logged when restarting Jetty (but not on the initial start). I suspect that the problem is triggered by how /* ensure scratch dir */
File scratch;
if (getInitParameter("scratchdir") == null) {
File tmp = (File) getServletHandler().getServletContext().getAttribute(ServletContext.TEMPDIR);
scratch = new File(tmp, "jsp");
setInitParameter("scratchdir", scratch.getAbsolutePath());
}
scratch = new File(getInitParameter("scratchdir"));
if (!scratch.exists() && !scratch.mkdir())
throw new IllegalStateException("Could not create JSP scratch directory"); Our application does not set the 'scratchdir' init parameter. Upon first start, this code creates a scratch dir relative to the I suspect that upon a _re_start, the init parameter now being defined, causes an issue. The This is the stack trace that is logged when restarting the embedded Jetty instance.
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 7 replies
-
Initial gut reaction ... the temp directory is being cleaned out between restarts, and that is breaking things. What is the value of your Anyway, the But since Jetty will ensure it is set, we have a problem. We can do some extra checks in |
Beta Was this translation helpful? Give feedback.
-
I think you're right. From within |
Beta Was this translation helpful? Give feedback.
-
I'm not sure if this has to do with anything, but while debugging, I noticed that a temp directory gets created, discarded and created under a different name a lot, |
Beta Was this translation helpful? Give feedback.
-
@guusdk I can't reproduce the problem with restarting an Looking at your stacktrace, it looks pretty unusual, particularly these lines:
It looks like you are in the middle of servicing a JSP request, and then somehow calling Moreover, you only need to restart a single context, if that's all that has changed. The usual ways to do that are either:
If you've changed the configuration of the jetty server itself, then you might need to do a full stop and then restart of the If the above analysis isn't helpful, then you'll need to explain how you are starting/restarting jetty or the webapp. |
Beta Was this translation helpful? Give feedback.
-
After upgrading to 12.0.24, this problem hasn't been reproduced yet. I assume that this is caused by the improvements referenced in #13362 (reply in thread) Thanks! |
Beta Was this translation helpful? Give feedback.
After upgrading to 12.0.24, this problem hasn't been reproduced yet. I assume that this is caused by the improvements referenced in #13362 (reply in thread)
Thanks!