diff options
author | ramkumar <ramkumar@13f79535-47bb-0310-9956-ffa450edef68> | 2009-07-16 08:28:24 +0000 |
---|---|---|
committer | ramkumar <ramkumar@13f79535-47bb-0310-9956-ffa450edef68> | 2009-07-16 08:28:24 +0000 |
commit | 58bd56d4726df4f33c9db9b7bc8e5e7a64064b6c (patch) | |
tree | 0ba961db11e26d54e406fd1ec937076984453527 /branches/sca-java-1.5.1/modules/implementation-spring/src/main | |
parent | b264fae6da998eb032462b7287711d891498cd3e (diff) |
Fixes for TUSCANY-3155
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@794589 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.5.1/modules/implementation-spring/src/main')
-rw-r--r-- | branches/sca-java-1.5.1/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/branches/sca-java-1.5.1/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java b/branches/sca-java-1.5.1/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java index d021d27dfc..6b67ba1eeb 100644 --- a/branches/sca-java-1.5.1/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java +++ b/branches/sca-java-1.5.1/modules/implementation-spring/src/main/java/org/apache/tuscany/sca/implementation/spring/introspect/SpringXMLComponentTypeLoader.java @@ -692,12 +692,13 @@ public class SpringXMLComponentTypeLoader { }
}
}
+ // Look for the default applicaiton-context.xml file, when MANIFEST.MF is absent.
je = jf.getJarEntry("META-INF" + "/" + "spring" + "/" + SpringImplementationConstants.APPLICATION_CONTEXT);
if (je != null) {
- return new URL("jar:" + locationFile.toURI().toURL() + "!/" + SpringImplementationConstants.APPLICATION_CONTEXT);
+ return new URL("jar:" + locationFile.toURI().toURL() + "!/" +
+ "META-INF" + "/" + "spring" + "/" + SpringImplementationConstants.APPLICATION_CONTEXT);
}
} catch (IOException e) {
- // bad archive
// TODO: create a more appropriate exception type
throw new ContributionReadException("SpringXMLLoader getApplicationContextResource: "
+ " IO exception reading context file.", e);
@@ -711,8 +712,8 @@ public class SpringXMLComponentTypeLoader { // Deal with the directory inside a jar file, in case the contribution itself is a JAR file.
try {
if (locationFile.getPath().indexOf(".jar") > 0) {
- String jarEntry = url.getPath().substring(6, url.getPath().indexOf("!"));
- JarFile jf = new JarFile(jarEntry);
+ String jarPath = url.getPath().substring(6, url.getPath().indexOf("!"));
+ JarFile jf = new JarFile(jarPath);
JarEntry je = jf.getJarEntry(url.getPath().substring(url.getPath().indexOf("!/")+2)
+ "/" + "META-INF" + "/" + "MANIFEST.MF");
if (je != null) {
@@ -726,6 +727,13 @@ public class SpringXMLComponentTypeLoader { }
}
}
+ // Look for the default applicaiton-context.xml file, when MANIFEST.MF is absent.
+ je = jf.getJarEntry(url.getPath().substring(url.getPath().indexOf("!/")+2) + "/" +
+ "META-INF" + "/" + "spring" + "/" + SpringImplementationConstants.APPLICATION_CONTEXT);
+ if (je != null) {
+ return new URL("jar:" + url.getPath() + "/" +
+ "META-INF" + "/" + "spring" + "/" + SpringImplementationConstants.APPLICATION_CONTEXT);
+ }
}
} catch (IOException e) {
throw new ContributionReadException("Error reading manifest " + manifestFile);
|