diff options
author | Jan Bartel | 2014-02-06 01:06:47 +0000 |
---|---|---|
committer | Jan Bartel | 2014-02-06 01:06:47 +0000 |
commit | 51aedd23937fd9a0d5227fc43e86af38ccc19f58 (patch) | |
tree | 48c6c681c3dfed533bd8bfa3877cffa133aa9f9f /jetty-webapp/src/main/java | |
parent | c5c553260ff6ec3192b5cd255d85fddea109ca0f (diff) | |
download | org.eclipse.jetty.project-51aedd23937fd9a0d5227fc43e86af38ccc19f58.tar.gz org.eclipse.jetty.project-51aedd23937fd9a0d5227fc43e86af38ccc19f58.tar.xz org.eclipse.jetty.project-51aedd23937fd9a0d5227fc43e86af38ccc19f58.zip |
426358 NPE generating temp dir name if no resourceBase or war
Diffstat (limited to 'jetty-webapp/src/main/java')
-rw-r--r-- | jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebInfConfiguration.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebInfConfiguration.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebInfConfiguration.java index 4e82ac133b..1dc3d12fd9 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebInfConfiguration.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebInfConfiguration.java @@ -397,6 +397,9 @@ public class WebInfConfiguration extends AbstractConfiguration web_app = context.newResource(war); else web_app=context.getBaseResource(); + + if (web_app == null) + throw new IllegalStateException("No resourceBase or war set for context"); // Accept aliases for WAR files if (web_app.getAlias() != null) @@ -603,7 +606,7 @@ public class WebInfConfiguration extends AbstractConfiguration if (resource == null) { if (context.getWar()==null || context.getWar().length()==0) - resource=context.newResource(context.getResourceBase()); + throw new IllegalStateException("No resourceBase or war set for context"); // Set dir or WAR resource = context.newResource(context.getWar()); @@ -621,7 +624,8 @@ public class WebInfConfiguration extends AbstractConfiguration } catch (Exception e) { - LOG.warn("Can't generate resourceBase as part of webapp tmp dir name", e); + LOG.warn("Can't generate resourceBase as part of webapp tmp dir name: " + e); + LOG.debug(e); } //Context name |