summaryrefslogtreecommitdiffstats
path: root/java/sca
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-05-23 08:09:07 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2009-05-23 08:09:07 +0000
commit37ab6c658ab868681e7d7a2ecb975c6dddedc897 (patch)
tree821aeeb805955f880781054a5900f5206eef3daf /java/sca
parent15b761091bb28e231cb6e7b661b4d00fddddac5e (diff)
Fix NPE when using jetty:run plugin with webapps, change contribution to be entire webapp instead of just web-inf/classes, change to use getrealpath instead of getContextName for the nodeURI to be compatable with Tomcat 5.x
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@777830 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca')
-rw-r--r--java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/ServletHostHelper.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/ServletHostHelper.java b/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/ServletHostHelper.java
index 6b36821244..c3aaf02e3a 100644
--- a/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/ServletHostHelper.java
+++ b/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/ServletHostHelper.java
@@ -66,7 +66,7 @@ public class ServletHostHelper {
path = "/" + path;
}
URL url = servletContext.getResource(path);
- if (url.getProtocol().equals("jndi")) {
+ if (url != null && url.getProtocol().equals("jndi")) {
//this is Tomcat case, we should use getRealPath
File warRootFile = new File(servletContext.getRealPath(path));
return warRootFile.toURI().toURL();
@@ -97,7 +97,7 @@ public class ServletHostHelper {
}
if (configuration.getContributions().isEmpty()) {
// TODO: Which path should be the default root
- configuration.addContribution(getResource(servletContext, "/WEB-INF/classes"));
+ configuration.addContribution(getResource(servletContext, "/"));
}
URL composite = getResource(servletContext, "/WEB-INF/web.composite");
if (composite != null) {
@@ -105,7 +105,7 @@ public class ServletHostHelper {
}
String nodeURI = servletContext.getInitParameter("node.uri");
if (nodeURI == null) {
- nodeURI = servletContext.getContextPath();
+ nodeURI = new File(servletContext.getRealPath("/")).getName();
}
configuration.setURI(nodeURI);
String domainURI = servletContext.getInitParameter("domain.uri");