[374337] Fix Serve modules without publishing for
ClassLoader.getResources(). Also version bump tomcat.core and related
features and add a .gitignore file.
diff --git a/features/org.eclipse.jst.server_adapters.ext.feature/feature.xml b/features/org.eclipse.jst.server_adapters.ext.feature/feature.xml
index 82750ea..790d621 100644
--- a/features/org.eclipse.jst.server_adapters.ext.feature/feature.xml
+++ b/features/org.eclipse.jst.server_adapters.ext.feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.jst.server_adapters.ext.feature"
label="%featureName"
- version="3.3.103.qualifier"
+ version="3.3.104.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="1.0.0.qualifier">
diff --git a/features/org.eclipse.jst.server_adapters.ext.sdk.feature/feature.xml b/features/org.eclipse.jst.server_adapters.ext.sdk.feature/feature.xml
index b2734fa..8f3437c 100644
--- a/features/org.eclipse.jst.server_adapters.ext.sdk.feature/feature.xml
+++ b/features/org.eclipse.jst.server_adapters.ext.sdk.feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.jst.server_adapters.ext.sdk.feature"
label="%featureName"
- version="3.3.202.qualifier"
+ version="3.3.203.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.license"
license-feature-version="1.0.0.qualifier">
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/.gitignore b/plugins/org.eclipse.jst.server.tomcat.core/.gitignore
new file mode 100644
index 0000000..5e56e04
--- /dev/null
+++ b/plugins/org.eclipse.jst.server.tomcat.core/.gitignore
@@ -0,0 +1 @@
+/bin
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.jst.server.tomcat.core/META-INF/MANIFEST.MF
index 6722055..dd8e612 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.jst.server.tomcat.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jst.server.tomcat.core; singleton:=true
-Bundle-Version: 1.1.403.qualifier
+Bundle-Version: 1.1.404.qualifier
Bundle-Activator: org.eclipse.jst.server.tomcat.core.internal.TomcatPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/org.eclipse.jst.server.tomcat.runtime.70.loader-src.zip b/plugins/org.eclipse.jst.server.tomcat.core/org.eclipse.jst.server.tomcat.runtime.70.loader-src.zip
index 932605d..1ea9606 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/org.eclipse.jst.server.tomcat.runtime.70.loader-src.zip
+++ b/plugins/org.eclipse.jst.server.tomcat.core/org.eclipse.jst.server.tomcat.runtime.70.loader-src.zip
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/org.eclipse.jst.server.tomcat.runtime.70.loader.jar b/plugins/org.eclipse.jst.server.tomcat.core/org.eclipse.jst.server.tomcat.runtime.70.loader.jar
index 940ff89..5ad20e3 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/org.eclipse.jst.server.tomcat.runtime.70.loader.jar
+++ b/plugins/org.eclipse.jst.server.tomcat.core/org.eclipse.jst.server.tomcat.runtime.70.loader.jar
Binary files differ
diff --git a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatPublishModuleVisitor.java b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatPublishModuleVisitor.java
index 4e161cf..45adcac 100644
--- a/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatPublishModuleVisitor.java
+++ b/plugins/org.eclipse.jst.server.tomcat.core/tomcatcore/org/eclipse/jst/server/tomcat/core/internal/TomcatPublishModuleVisitor.java
@@ -275,7 +275,8 @@
loader.setUseSystemClassLoaderAsParent(Boolean.FALSE.toString());
// Build the virtual classPath setting
- StringBuffer vcBuffer = new StringBuffer();
+ StringBuffer vcBuffer = new StringBuffer(); // Filled with classes entries first, then jar entries added
+ StringBuffer vcJarBuffer = new StringBuffer(); // Filled with jar enteries only
// Build list of additional resource paths and check for additional jars
StringBuffer rpBuffer = new StringBuffer();
@@ -296,14 +297,11 @@
rpBuffer.append("/WEB-INF/classes").append("|").append(element);
}
}
- if (vcBuffer.length() > 0 && virtualJarClasspathElements.size() > 0) {
- vcBuffer.append(";");
- }
for (Iterator iterator = virtualJarClasspathElements.iterator();
iterator.hasNext();) {
- vcBuffer.append(iterator.next());
+ vcJarBuffer.append(iterator.next());
if (iterator.hasNext()) {
- vcBuffer.append(";");
+ vcJarBuffer.append(";");
}
}
virtualClassClasspathElements.clear();
@@ -345,9 +343,17 @@
rpBuffer.append(location);
// Add to the set of locations included
locationsIncluded.add(location);
+ // If a "WEB-INF/classes" exists and is a directory, add to virtual classpath
+ File webInfClasses = resLoc.append("WEB-INF/classes").toFile();
+ if (webInfClasses.exists() && webInfClasses.isDirectory()) {
+ if (vcBuffer.length() != 0) {
+ vcBuffer.append(";");
+ }
+ vcBuffer.append(webInfClasses.getPath());
+ }
// Check if this extra content location contains jars
File webInfLib = resLoc.append("WEB-INF/lib").toFile();
- // If this "WEB-INF/lib" exists and is a directory, add
+ // If a "WEB-INF/lib" exists and is a directory, add
// its jars to the virtual classpath
if (webInfLib.exists() && webInfLib.isDirectory()) {
String [] jars = webInfLib.list(new FilenameFilter() {
@@ -357,10 +363,10 @@
}
});
for (int k = 0; k < jars.length; k++) {
- if (vcBuffer.length() != 0) {
- vcBuffer.append(";");
+ if (vcJarBuffer.length() != 0) {
+ vcJarBuffer.append(";");
}
- vcBuffer.append(webInfLib.getPath() + File.separator + jars[k]);
+ vcJarBuffer.append(webInfLib.getPath() + File.separator + jars[k]);
}
}
}
@@ -390,12 +396,24 @@
locationsIncluded.add(location);
// Check if this extra content location contains jars
File webInfLib = null;
+ File webInfClasses = null;
if ("/WEB-INF".equals(rtPath)) {
webInfLib = resLoc.append("lib").toFile();
+ webInfClasses = resLoc.append("classes").toFile();
}
else if ("/WEB-INF/lib".equals(rtPath)) {
webInfLib = resLoc.toFile();
}
+ else if ("/WEB-INF/classes".equals(rtPath)) {
+ webInfClasses = resLoc.toFile();
+ }
+ // If a "WEB-INF/classes" exists and is a directory, add to virtual classpath
+ if (webInfClasses != null && webInfClasses.exists() && webInfClasses.isDirectory()) {
+ if (vcBuffer.length() != 0) {
+ vcBuffer.append(";");
+ }
+ vcBuffer.append(webInfClasses.getPath());
+ }
// If this "WEB-INF/lib" exists and is a directory, add
// its jars to the virtual classpath
if (webInfLib != null && webInfLib.exists() && webInfLib.isDirectory()) {
@@ -406,10 +424,10 @@
}
});
for (int k = 0; k < jars.length; k++) {
- if (vcBuffer.length() != 0) {
- vcBuffer.append(";");
+ if (vcJarBuffer.length() != 0) {
+ vcJarBuffer.append(";");
}
- vcBuffer.append(webInfLib.getPath() + File.separator + jars[k]);
+ vcJarBuffer.append(webInfLib.getPath() + File.separator + jars[k]);
}
}
}
@@ -453,13 +471,25 @@
rpBuffer.append(rtPath).append("|").append(location);
// Check if this extra content location contains jars
File webInfLib = null;
+ File webInfClasses = null;
if ("/WEB-INF".equals(rtPath)) {
webInfLib = new File(location, "lib");
+ webInfClasses = new File(location, "classes");
}
else if ("/WEB-INF/lib".equals(rtPath)) {
webInfLib = new File(location);
}
- // If this "WEB-INF/lib" exists and is a directory, add
+ else if ("/WEB-INF/classes".equals(rtPath)) {
+ webInfClasses = new File(location);
+ }
+ // If a "WEB-INF/classes" exists and is a directory, add to virtual classpath
+ if (webInfClasses != null && webInfClasses.exists() && webInfClasses.isDirectory()) {
+ if (vcBuffer.length() != 0) {
+ vcBuffer.append(";");
+ }
+ vcBuffer.append(webInfClasses.getPath());
+ }
+ // If a "WEB-INF/lib" exists and is a directory, add
// its jars to the virtual classpath
if (webInfLib != null && webInfLib.exists() && webInfLib.isDirectory()) {
String [] jars = webInfLib.list(new FilenameFilter() {
@@ -469,10 +499,10 @@
}
});
for (int k = 0; k < jars.length; k++) {
- if (vcBuffer.length() != 0) {
- vcBuffer.append(";");
+ if (vcJarBuffer.length() != 0) {
+ vcJarBuffer.append(";");
}
- vcBuffer.append(webInfLib.getPath() + File.separator + jars[k]);
+ vcJarBuffer.append(webInfLib.getPath() + File.separator + jars[k]);
}
}
}
@@ -498,6 +528,14 @@
}
}
+ // Combine the classes and jar virtual classpaths
+ if (vcJarBuffer.length() > 0) {
+ if (vcBuffer.length() > 0) {
+ vcBuffer.append(';');
+ }
+ vcBuffer.append(vcJarBuffer);
+ }
+
String vcp = vcBuffer.toString();
String oldVcp = loader.getVirtualClasspath();
if (!vcp.equals(oldVcp)) {