You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jg...@apache.org on 2018/12/06 21:20:27 UTC
[1/6] tomee git commit: TOMEE-2322 WIP attempting to fix classpath
setup for iTests
Repository: tomee
Updated Branches:
refs/heads/tomee-7.1.x 01fb28e1a -> 192bf4dc3
TOMEE-2322 WIP attempting to fix classpath setup for iTests
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/a0dba831
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/a0dba831
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/a0dba831
Branch: refs/heads/tomee-7.1.x
Commit: a0dba8314f47cb7ca0f71451d8514804d5819579
Parents: 01fb28e
Author: Jonathan Gallimore <jg...@tomitribe.com>
Authored: Thu Dec 6 12:40:03 2018 +0000
Committer: Jonathan Gallimore <jg...@tomitribe.com>
Committed: Thu Dec 6 20:58:02 2018 +0000
----------------------------------------------------------------------
.../java/org/apache/openejb/cli/Bootstrap.java | 27 +++++++++++++++++++-
.../failover/RandomConnectionStrategyTest.java | 6 +++--
2 files changed, 30 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/a0dba831/container/openejb-core/src/main/java/org/apache/openejb/cli/Bootstrap.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/cli/Bootstrap.java b/container/openejb-core/src/main/java/org/apache/openejb/cli/Bootstrap.java
index 2bb4a01..88dacad 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/cli/Bootstrap.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/cli/Bootstrap.java
@@ -25,7 +25,9 @@ import org.apache.openejb.util.PropertyPlaceHolderHelper;
import org.apache.openejb.util.URLs;
import java.io.File;
+import java.io.FilenameFilter;
import java.lang.reflect.InvocationTargetException;
+import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.net.URLClassLoader;
@@ -120,6 +122,7 @@ public class Bootstrap {
if (repository.endsWith("*.jar")) {
final File dir = new File(repository.substring(0, repository.length() - "*.jar".length()));
if (dir.isDirectory()) {
+ addJarsToPath(dynamicURLClassLoader, dir);
dynamicURLClassLoader.add(dir.toURI().toURL());
}
} else if (repository.endsWith(".jar")) {
@@ -135,6 +138,7 @@ public class Bootstrap {
}
}
} else {
+ addJarsToPath(dynamicURLClassLoader, lib);
dynamicURLClassLoader.add(lib.toURI().toURL());
}
@@ -146,12 +150,33 @@ public class Bootstrap {
return null;
}
+ private static void addJarsToPath(final BasicURLClassPath.CustomizableURLClassLoader classLoader, final File folder) throws MalformedURLException {
+ if (classLoader == null || folder == null) {
+ return;
+ }
+
+ if (! folder.exists()) {
+ return;
+ }
+
+ final File[] jarFiles = folder.listFiles(new FilenameFilter() {
+ @Override
+ public boolean accept(File dir, String name) {
+ return name.endsWith(".jar");
+ }
+ });
+
+ for (final File jarFile : jarFiles) {
+ classLoader.add(jarFile.toURI().toURL());
+ }
+ }
+
/**
* Read commands from BASE_PATH (using XBean's ResourceFinder) and execute the one specified on the command line
*/
public static void main(final String[] args) throws Exception {
+ setupHome(args);
try (final URLClassLoader loader = setupClasspath()) {
- setupHome(args);
final Class<?> clazz = (loader == null ? Bootstrap.class.getClassLoader() : loader).loadClass(OPENEJB_CLI_MAIN_CLASS_NAME);
http://git-wip-us.apache.org/repos/asf/tomee/blob/a0dba831/itests/failover/src/test/java/org/apache/openejb/itest/failover/RandomConnectionStrategyTest.java
----------------------------------------------------------------------
diff --git a/itests/failover/src/test/java/org/apache/openejb/itest/failover/RandomConnectionStrategyTest.java b/itests/failover/src/test/java/org/apache/openejb/itest/failover/RandomConnectionStrategyTest.java
index 401eabc..2f82aae 100644
--- a/itests/failover/src/test/java/org/apache/openejb/itest/failover/RandomConnectionStrategyTest.java
+++ b/itests/failover/src/test/java/org/apache/openejb/itest/failover/RandomConnectionStrategyTest.java
@@ -88,9 +88,11 @@ public class RandomConnectionStrategyTest {
root = new StandaloneServer(home, home);
root.killOnExit();
root.getJvmOpts().add("-Dopenejb.classloader.forced-load=org.apache.openejb");
- root.ignoreOut();
+// root.ignoreOut();
root.setProperty("name", name);
root.setProperty("openejb.extract.configuration", "false");
+ root.setDebug(true);
+ root.setDebugPort(5006);
final StandaloneServer.ServerService multipoint = root.getServerService("multipoint");
multipoint.setBind("localhost");
@@ -116,7 +118,7 @@ public class RandomConnectionStrategyTest {
final StandaloneServer server = new StandaloneServer(home, home);
server.killOnExit();
- server.ignoreOut();
+// server.ignoreOut();
server.setProperty("name", name);
server.setProperty("openejb.extract.configuration", "false");
server.getJvmOpts().add("-Dopenejb.classloader.forced-load=org.apache.openejb");
[6/6] tomee git commit: Correct the CXF version
Posted by jg...@apache.org.
Correct the CXF version
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/192bf4dc
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/192bf4dc
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/192bf4dc
Branch: refs/heads/tomee-7.1.x
Commit: 192bf4dc3a2d383794aa1b19303ef75ac022d0a6
Parents: f7ab13b
Author: Jonathan Gallimore <jg...@tomitribe.com>
Authored: Thu Dec 6 21:20:02 2018 +0000
Committer: Jonathan Gallimore <jg...@tomitribe.com>
Committed: Thu Dec 6 21:20:02 2018 +0000
----------------------------------------------------------------------
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/192bf4dc/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 5be97b6..f5e789d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -134,7 +134,7 @@
<tomcat.version>8.5.34</tomcat.version>
- <cxf.version>3.1.18</cxf.version>
+ <cxf.version>3.1.17</cxf.version>
<version.shrinkwrap.shrinkwrap>1.2.6</version.shrinkwrap.shrinkwrap>
<version.shrinkwrap.descriptor>2.0.0</version.shrinkwrap.descriptor>
<version.arquillian>1.1.13.Final</version.arquillian>
[3/6] tomee git commit: TOME-2322 removing debug
Posted by jg...@apache.org.
TOME-2322 removing debug
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/bb583e43
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/bb583e43
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/bb583e43
Branch: refs/heads/tomee-7.1.x
Commit: bb583e431c12af60cc476183ce6b7d7be114aae7
Parents: 8fbf722
Author: Jonathan Gallimore <jg...@tomitribe.com>
Authored: Thu Dec 6 14:26:31 2018 +0000
Committer: Jonathan Gallimore <jg...@tomitribe.com>
Committed: Thu Dec 6 20:58:14 2018 +0000
----------------------------------------------------------------------
.../openejb/itest/failover/RandomConnectionStrategyTest.java | 2 --
1 file changed, 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/bb583e43/itests/failover/src/test/java/org/apache/openejb/itest/failover/RandomConnectionStrategyTest.java
----------------------------------------------------------------------
diff --git a/itests/failover/src/test/java/org/apache/openejb/itest/failover/RandomConnectionStrategyTest.java b/itests/failover/src/test/java/org/apache/openejb/itest/failover/RandomConnectionStrategyTest.java
index c347285..401eabc 100644
--- a/itests/failover/src/test/java/org/apache/openejb/itest/failover/RandomConnectionStrategyTest.java
+++ b/itests/failover/src/test/java/org/apache/openejb/itest/failover/RandomConnectionStrategyTest.java
@@ -91,8 +91,6 @@ public class RandomConnectionStrategyTest {
root.ignoreOut();
root.setProperty("name", name);
root.setProperty("openejb.extract.configuration", "false");
-// root.setDebug(true);
-// root.setDebugPort(5006);
final StandaloneServer.ServerService multipoint = root.getServerService("multipoint");
multipoint.setBind("localhost");
[4/6] tomee git commit: TOMEE-2322 restore previous classloader at
the end
Posted by jg...@apache.org.
TOMEE-2322 restore previous classloader at the end
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/2b7a105a
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/2b7a105a
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/2b7a105a
Branch: refs/heads/tomee-7.1.x
Commit: 2b7a105a8183afcb9554e52b8cb24844f13780d0
Parents: bb583e4
Author: Jonathan Gallimore <jg...@tomitribe.com>
Authored: Thu Dec 6 15:09:10 2018 +0000
Committer: Jonathan Gallimore <jg...@tomitribe.com>
Committed: Thu Dec 6 20:58:20 2018 +0000
----------------------------------------------------------------------
.../src/main/java/org/apache/openejb/cli/Bootstrap.java | 6 ++++++
1 file changed, 6 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/2b7a105a/container/openejb-core/src/main/java/org/apache/openejb/cli/Bootstrap.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/cli/Bootstrap.java b/container/openejb-core/src/main/java/org/apache/openejb/cli/Bootstrap.java
index b5508a3..95e879e 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/cli/Bootstrap.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/cli/Bootstrap.java
@@ -175,10 +175,12 @@ public class Bootstrap {
* Read commands from BASE_PATH (using XBean's ResourceFinder) and execute the one specified on the command line
*/
public static void main(final String[] args) throws Exception {
+ ClassLoader cl = null;
setupHome(args);
try (final URLClassLoader loader = setupClasspath()) {
if (loader != null) {
+ cl = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(loader);
if (loader != ClassLoader.getSystemClassLoader()) {
System.setProperty("openejb.classloader.first.disallow-system-loading", "true");
@@ -200,6 +202,10 @@ public class Bootstrap {
throw Error.class.cast(cause);
}
throw new IllegalStateException(cause);
+ } finally {
+ if (cl != null) {
+ Thread.currentThread().setContextClassLoader(cl);
+ }
}
}
}
[2/6] tomee git commit: TOMEE-2322 Still WIP,
but these failover tests pass now
Posted by jg...@apache.org.
TOMEE-2322 Still WIP, but these failover tests pass now
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/8fbf722a
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/8fbf722a
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/8fbf722a
Branch: refs/heads/tomee-7.1.x
Commit: 8fbf722aab033c6720c5a1a34fc59164d6bf4e37
Parents: a0dba83
Author: Jonathan Gallimore <jg...@tomitribe.com>
Authored: Thu Dec 6 14:23:34 2018 +0000
Committer: Jonathan Gallimore <jg...@tomitribe.com>
Committed: Thu Dec 6 20:58:08 2018 +0000
----------------------------------------------------------------------
.../src/main/java/org/apache/openejb/cli/Bootstrap.java | 8 +++++++-
.../openejb/itest/failover/RandomConnectionStrategyTest.java | 8 ++++----
2 files changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/8fbf722a/container/openejb-core/src/main/java/org/apache/openejb/cli/Bootstrap.java
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/java/org/apache/openejb/cli/Bootstrap.java b/container/openejb-core/src/main/java/org/apache/openejb/cli/Bootstrap.java
index 88dacad..b5508a3 100644
--- a/container/openejb-core/src/main/java/org/apache/openejb/cli/Bootstrap.java
+++ b/container/openejb-core/src/main/java/org/apache/openejb/cli/Bootstrap.java
@@ -178,8 +178,14 @@ public class Bootstrap {
setupHome(args);
try (final URLClassLoader loader = setupClasspath()) {
- final Class<?> clazz = (loader == null ? Bootstrap.class.getClassLoader() : loader).loadClass(OPENEJB_CLI_MAIN_CLASS_NAME);
+ if (loader != null) {
+ Thread.currentThread().setContextClassLoader(loader);
+ if (loader != ClassLoader.getSystemClassLoader()) {
+ System.setProperty("openejb.classloader.first.disallow-system-loading", "true");
+ }
+ }
+ final Class<?> clazz = (loader == null ? Bootstrap.class.getClassLoader() : loader).loadClass(OPENEJB_CLI_MAIN_CLASS_NAME);
final Object main = clazz.getConstructor().newInstance();
main.getClass().getMethod("main", String[].class).invoke(main, new Object[]{args});
} catch (final InvocationTargetException e) {
http://git-wip-us.apache.org/repos/asf/tomee/blob/8fbf722a/itests/failover/src/test/java/org/apache/openejb/itest/failover/RandomConnectionStrategyTest.java
----------------------------------------------------------------------
diff --git a/itests/failover/src/test/java/org/apache/openejb/itest/failover/RandomConnectionStrategyTest.java b/itests/failover/src/test/java/org/apache/openejb/itest/failover/RandomConnectionStrategyTest.java
index 2f82aae..c347285 100644
--- a/itests/failover/src/test/java/org/apache/openejb/itest/failover/RandomConnectionStrategyTest.java
+++ b/itests/failover/src/test/java/org/apache/openejb/itest/failover/RandomConnectionStrategyTest.java
@@ -88,11 +88,11 @@ public class RandomConnectionStrategyTest {
root = new StandaloneServer(home, home);
root.killOnExit();
root.getJvmOpts().add("-Dopenejb.classloader.forced-load=org.apache.openejb");
-// root.ignoreOut();
+ root.ignoreOut();
root.setProperty("name", name);
root.setProperty("openejb.extract.configuration", "false");
- root.setDebug(true);
- root.setDebugPort(5006);
+// root.setDebug(true);
+// root.setDebugPort(5006);
final StandaloneServer.ServerService multipoint = root.getServerService("multipoint");
multipoint.setBind("localhost");
@@ -118,7 +118,7 @@ public class RandomConnectionStrategyTest {
final StandaloneServer server = new StandaloneServer(home, home);
server.killOnExit();
-// server.ignoreOut();
+ server.ignoreOut();
server.setProperty("name", name);
server.setProperty("openejb.extract.configuration", "false");
server.getJvmOpts().add("-Dopenejb.classloader.forced-load=org.apache.openejb");
[5/6] tomee git commit: TOMEE-2322 add missing jar
Posted by jg...@apache.org.
TOMEE-2322 add missing jar
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/f7ab13b5
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/f7ab13b5
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/f7ab13b5
Branch: refs/heads/tomee-7.1.x
Commit: f7ab13b5807ffd0cae704dcb3fcaeed2282925e4
Parents: 2b7a105
Author: Jonathan Gallimore <jg...@tomitribe.com>
Authored: Thu Dec 6 15:27:50 2018 +0000
Committer: Jonathan Gallimore <jg...@tomitribe.com>
Committed: Thu Dec 6 20:58:25 2018 +0000
----------------------------------------------------------------------
.../src/test/java/org/apache/tomee/TomEECliIT.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/f7ab13b5/tomee/apache-tomee/src/test/java/org/apache/tomee/TomEECliIT.java
----------------------------------------------------------------------
diff --git a/tomee/apache-tomee/src/test/java/org/apache/tomee/TomEECliIT.java b/tomee/apache-tomee/src/test/java/org/apache/tomee/TomEECliIT.java
index f33f53b..bff58c4 100644
--- a/tomee/apache-tomee/src/test/java/org/apache/tomee/TomEECliIT.java
+++ b/tomee/apache-tomee/src/test/java/org/apache/tomee/TomEECliIT.java
@@ -68,7 +68,8 @@ public class TomEECliIT {
final ProcessBuilder builder = new ProcessBuilder()
.command("java", "-cp", jar.getAbsolutePath() + File.pathSeparator +
tomee.getAbsolutePath() + File.separator + "lib" + File.separator + "openejb-core-8.0.0-SNAPSHOT.jar" + File.pathSeparator +
- tomee.getAbsolutePath() + File.separator + "lib" + File.separator + "commons-cli-1.2.jar",
+ tomee.getAbsolutePath() + File.separator + "lib" + File.separator + "commons-cli-1.2.jar" + File.pathSeparator +
+ tomee.getAbsolutePath() + File.separator + "lib" + File.separator + "commons-lang3-3.8.1.jar",
"org.apache.openejb.cli.Bootstrap", "classloadertest");
final Process start = builder.start();
@@ -162,7 +163,8 @@ public class TomEECliIT {
.command("java", "-cp", jar.getAbsolutePath() + File.pathSeparator +
jar2.getAbsolutePath() + File.pathSeparator +
tomee.getAbsolutePath() + File.separator + "lib" + File.separator + "openejb-core-8.0.0-SNAPSHOT.jar" + File.pathSeparator +
- tomee.getAbsolutePath() + File.separator + "lib" + File.separator + "commons-cli-1.2.jar",
+ tomee.getAbsolutePath() + File.separator + "lib" + File.separator + "commons-cli-1.2.jar" + File.pathSeparator +
+ tomee.getAbsolutePath() + File.separator + "lib" + File.separator + "commons-lang3-3.8.1.jar",
"org.apache.openejb.cli.Bootstrap", "classloadertest2");
final Process start = builder.start();