It looks like not closing a pool negatively affected the test. Gary
On Mon, Apr 1, 2019 at 12:22 PM Zheng Feng <[email protected]> wrote: > The https://travis-ci.org/apache/commons-dbcp looks good to me. How did > this exception happen ? > > On Mon, Apr 1, 2019 at 11:49 PM Gary Gregory <[email protected]> > wrote: > > > Thanks! Now this is failing :-( > > > > java.sql.SQLException: Unable to enlist connection because the > transaction > > has been garbage collected > > at > > > > > org.apache.commons.dbcp2.managed.TransactionContext.getTransaction(TransactionContext.java:186) > > at > > > > > org.apache.commons.dbcp2.managed.TransactionContext.setSharedConnection(TransactionContext.java:105) > > at > > > > > org.apache.commons.dbcp2.managed.ManagedConnection.updateTransactionStatus(ManagedConnection.java:310) > > at > > > > > org.apache.commons.dbcp2.managed.ManagedConnection.<init>(ManagedConnection.java:89) > > at > > > > > org.apache.commons.dbcp2.managed.ManagedDataSource.getConnection(ManagedDataSource.java:64) > > at > > > > > org.apache.commons.dbcp2.managed.TestSynchronizationOrder.testInterposedSynchronization(TestSynchronizationOrder.java:115) > > at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native > > Method) > > at > > > > > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > > at > > > > > java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > > at java.base/java.lang.reflect.Method.invoke(Method.java:566) > > at > > > > > org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:628) > > at > > > > > org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:117) > > at > > > > > org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:184) > > at > > > > > org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) > > at > > > > > org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:180) > > at > > > > > org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:127) > > at > > > > > org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:68) > > at > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:135) > > at > > > > > org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) > > at > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125) > > at > > org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135) > > at > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123) > > at > > > > > org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) > > at > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122) > > at > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80) > > at java.base/java.util.ArrayList.forEach(ArrayList.java:1540) > > at > > > > > org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38) > > at > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139) > > at > > > > > org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) > > at > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125) > > at > > org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135) > > at > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123) > > at > > > > > org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) > > at > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122) > > at > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80) > > at java.base/java.util.ArrayList.forEach(ArrayList.java:1540) > > at > > > > > org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38) > > at > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139) > > at > > > > > org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) > > at > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125) > > at > > org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135) > > at > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123) > > at > > > > > org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) > > at > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122) > > at > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80) > > at > > > > > org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32) > > at > > > > > org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) > > at > > > > > org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51) > > at > > > > > org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:229) > > at > > > > > org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:197) > > at > > > > > org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:211) > > at > > > > > org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:191) > > at > > > > > org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:137) > > at > > > > > org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.run(JUnit5TestReference.java:89) > > at > > > > > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41) > > at > > > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541) > > at > > > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763) > > at > > > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463) > > at > > > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209) > > > > Gary > > > > On Mon, Apr 1, 2019 at 11:23 AM Zheng Feng <[email protected]> wrote: > > > > > Hi Gray, > > > > > > I tried the following patch to use the application class loader and it > > > works on the JDK11. > > > > > > diff --git > > > > > > > > > a/src/test/java/org/apache/commons/dbcp2/managed/TestSynchronizationOrder.java > > > > > > > > > b/src/test/java/org/apache/commons/dbcp2/managed/TestSynchronizationOrder.java > > > index 0d35be7e..62333433 100644 > > > --- > > > > > > > > > a/src/test/java/org/apache/commons/dbcp2/managed/TestSynchronizationOrder.java > > > +++ > > > > > > > > > b/src/test/java/org/apache/commons/dbcp2/managed/TestSynchronizationOrder.java > > > @@ -297,7 +297,7 @@ public class TestSynchronizationOrder { > > > } > > > }; > > > xads = (XADataSource) Proxy.newProxyInstance( > > > - InvocationHandler.class.getClassLoader(), > > > + TestSynchronizationOrder.class.getClassLoader(), > > > new Class[]{XADataSource.class}, handle); > > > bmds.setXaDataSourceInstance(xads); > > > > > > > > > On Sun, Mar 31, 2019 at 9:28 PM Gary Gregory <[email protected]> > > > wrote: > > > > > > > Hi All: > > > > > > > > I need help getting DBCP to pass its tests on Java 11. > > > > > > > > org.apache.commons.dbcp2.managed.TestSynchronizationOrder currently > > fails > > > > with: > > > > > > > > java.lang.IllegalArgumentException: javax.sql.XADataSource referenced > > > from > > > > a method is not visible from class loader > > > > at > > > > > > > > > > > > > > java.base/java.lang.reflect.Proxy$ProxyBuilder.ensureVisible(Proxy.java:858) > > > > at > > > > > > > > > > > > > > java.base/java.lang.reflect.Proxy$ProxyBuilder.validateProxyInterfaces(Proxy.java:681) > > > > at > > java.base/java.lang.reflect.Proxy$ProxyBuilder.<init>(Proxy.java:627) > > > > at > > java.base/java.lang.reflect.Proxy$ProxyBuilder.<init>(Proxy.java:635) > > > > at > > > > > > > > > > > > > > java.base/java.lang.reflect.Proxy.lambda$getProxyConstructor$0(Proxy.java:415) > > > > at > > > > > > > > > > > > > > java.base/jdk.internal.loader.AbstractClassLoaderValue$Memoizer.get(AbstractClassLoaderValue.java:329) > > > > at > > > > > > > > > > > > > > java.base/jdk.internal.loader.AbstractClassLoaderValue.computeIfAbsent(AbstractClassLoaderValue.java:205) > > > > at > > java.base/java.lang.reflect.Proxy.getProxyConstructor(Proxy.java:413) > > > > at > java.base/java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1006) > > > > at > > > > > > > > > > > > > > org.apache.commons.dbcp2.managed.TestSynchronizationOrder.setup(TestSynchronizationOrder.java:299) > > > > at > > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native > > > > Method) > > > > at > > > > > > > > > > > > > > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > > > > at > > > > > > > > > > > > > > java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > > > > at java.base/java.lang.reflect.Method.invoke(Method.java:566) > > > > at > > > > > > > > > > > > > > org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:628) > > > > at > > > > > > > > > > > > > > org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:117) > > > > at > > > > > > > > > > > > > > org.junit.jupiter.engine.descriptor.ClassTestDescriptor.invokeMethodInExtensionContext(ClassTestDescriptor.java:439) > > > > at > > > > > > > > > > > > > > org.junit.jupiter.engine.descriptor.ClassTestDescriptor.lambda$synthesizeBeforeEachMethodAdapter$15(ClassTestDescriptor.java:427) > > > > at > > > > > > > > > > > > > > org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeBeforeEachMethods$3(TestMethodTestDescriptor.java:149) > > > > at > > > > > > > > > > > > > > org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) > > > > at > > > > > > > > > > > > > > org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeBeforeMethodsOrCallbacksUntilExceptionOccurs(TestMethodTestDescriptor.java:169) > > > > at > > > > > > > > > > > > > > org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeBeforeEachMethods(TestMethodTestDescriptor.java:148) > > > > at > > > > > > > > > > > > > > org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:123) > > > > at > > > > > > > > > > > > > > org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:68) > > > > at > > > > > > > > > > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:135) > > > > at > > > > > > > > > > > > > > org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) > > > > at > > > > > > > > > > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125) > > > > at > > > > > > org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135) > > > > at > > > > > > > > > > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123) > > > > at > > > > > > > > > > > > > > org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) > > > > at > > > > > > > > > > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122) > > > > at > > > > > > > > > > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80) > > > > at java.base/java.util.ArrayList.forEach(ArrayList.java:1540) > > > > at > > > > > > > > > > > > > > org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38) > > > > at > > > > > > > > > > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139) > > > > at > > > > > > > > > > > > > > org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) > > > > at > > > > > > > > > > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125) > > > > at > > > > > > org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135) > > > > at > > > > > > > > > > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123) > > > > at > > > > > > > > > > > > > > org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) > > > > at > > > > > > > > > > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122) > > > > at > > > > > > > > > > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80) > > > > at java.base/java.util.ArrayList.forEach(ArrayList.java:1540) > > > > at > > > > > > > > > > > > > > org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38) > > > > at > > > > > > > > > > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139) > > > > at > > > > > > > > > > > > > > org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) > > > > at > > > > > > > > > > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125) > > > > at > > > > > > org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135) > > > > at > > > > > > > > > > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123) > > > > at > > > > > > > > > > > > > > org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) > > > > at > > > > > > > > > > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122) > > > > at > > > > > > > > > > > > > > org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80) > > > > at > > > > > > > > > > > > > > org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32) > > > > at > > > > > > > > > > > > > > org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) > > > > at > > > > > > > > > > > > > > org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51) > > > > at > > > > > > > > > > > > > > org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:229) > > > > at > > > > > > > > > > > > > > org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:197) > > > > at > > > > > > > > > > > > > > org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:211) > > > > at > > > > > > > > > > > > > > org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:191) > > > > at > > > > > > > > > > > > > > org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:137) > > > > at > > > > > > > > > > > > > > org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.run(JUnit5TestReference.java:89) > > > > at > > > > > > > > > > > > > > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41) > > > > at > > > > > > > > > > > > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541) > > > > at > > > > > > > > > > > > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763) > > > > at > > > > > > > > > > > > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463) > > > > at > > > > > > > > > > > > > > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209) > > > > > > > > From Maven, it looks like this: > > > > > > > > [ERROR] Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time > elapsed: > > > > 0.008 s <<< FAILURE! - in > > > > org.apache.commons.dbcp2.managed.TestSynchronizationOrder > > > > [ERROR] testInterposedSynchronization Time elapsed: 0.005 s <<< > > ERROR! > > > > java.lang.IllegalArgumentException: javax.sql.XADataSource referenced > > > from > > > > a method is not visible from class loader > > > > at > > > > > > > > > > > > > > org.apache.commons.dbcp2.managed.TestSynchronizationOrder.setup(TestSynchronizationOrder.java:299) > > > > > > > > [ERROR] testSessionSynchronization Time elapsed: 0.001 s <<< ERROR! > > > > java.lang.IllegalArgumentException: javax.sql.XADataSource referenced > > > from > > > > a method is not visible from class loader > > > > at > > > > > > > > > > > > > > org.apache.commons.dbcp2.managed.TestSynchronizationOrder.setup(TestSynchronizationOrder.java:299) > > > > > > > > Thank you, > > > > Gary > > > > > > > > > >
