tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject tomee git commit: TOMEE-1862 don't open a stream on context.xml if present
Date Fri, 08 Jul 2016 11:34:15 GMT
Repository: tomee
Updated Branches:
  refs/heads/master 677bdd77a -> c2edc4d6a


TOMEE-1862 don't open a stream on context.xml if present


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/c2edc4d6
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/c2edc4d6
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/c2edc4d6

Branch: refs/heads/master
Commit: c2edc4d6affce930e1d597e9a3eab9aa8119d34b
Parents: 677bdd7
Author: Romain manni-Bucau <rmannibucau@gmail.com>
Authored: Fri Jul 8 13:33:51 2016 +0200
Committer: Romain manni-Bucau <rmannibucau@gmail.com>
Committed: Fri Jul 8 13:33:51 2016 +0200

----------------------------------------------------------------------
 .../java/org/apache/tomee/catalina/TomcatWebAppBuilder.java   | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/c2edc4d6/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
index 17b3856..3c0981a 100644
--- a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
+++ b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatWebAppBuilder.java
@@ -100,7 +100,6 @@ import org.apache.openejb.core.ivm.naming.SystemComponentReference;
 import org.apache.openejb.jee.EnvEntry;
 import org.apache.openejb.jee.WebApp;
 import org.apache.openejb.loader.Files;
-import org.apache.openejb.loader.IO;
 import org.apache.openejb.loader.SystemInstance;
 import org.apache.openejb.server.httpd.BeginWebBeansListener;
 import org.apache.openejb.server.httpd.EndWebBeansListener;
@@ -152,7 +151,6 @@ import javax.transaction.TransactionManager;
 import javax.transaction.TransactionSynchronizationRegistry;
 import java.io.File;
 import java.io.IOException;
-import java.io.InputStream;
 import java.io.Serializable;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
@@ -454,12 +452,10 @@ public class TomcatWebAppBuilder implements WebAppBuilder, ContextListener,
Pare
             for (final WebAppInfo webApp : appInfo.webApps) {
                 // look for context.xml
                 final File war = new File(webApp.path);
-                InputStream contextXml = null;
                 URL contextXmlUrl = null;
                 if (war.isDirectory()) {
                     final File cXml = new File(war, Constants.ApplicationContextXml).getAbsoluteFile();
                     if (cXml.exists()) {
-                        contextXml = IO.read(cXml);
                         contextXmlUrl = cXml.toURI().toURL();
                         logger.info("using context file " + cXml.getAbsolutePath());
                     }
@@ -468,7 +464,6 @@ public class TomcatWebAppBuilder implements WebAppBuilder, ContextListener,
Pare
                     final JarEntry entry = warAsJar.getJarEntry(Constants.ApplicationContextXml);
                     if (entry != null) {
                         contextXmlUrl = new URL("jar:" + war.getAbsoluteFile().toURI().toURL().toExternalForm()
+ "!/" + Constants.ApplicationContextXml);
-                        contextXml = warAsJar.getInputStream(entry);
                     }
                 }
 
@@ -497,7 +492,7 @@ public class TomcatWebAppBuilder implements WebAppBuilder, ContextListener,
Pare
                     }
                 }
                 standardContext.setUnpackWAR(!"false".equalsIgnoreCase(appInfo.properties.getProperty("tomcat.unpackWar")));
-                if (contextXml != null) {
+                if (contextXmlUrl != null) {
                     standardContext.setConfigFile(contextXmlUrl);
                 }
 


Mime
View raw message