JDK11 support: ClassNotFoundException: javax.transaction.xa.Xid
envgap__internetarchive__heritrix3-266
01 / FAILURE SIGNATURE
As reported upstream
java.lang.NoClassDefFoundError: javax/transaction/xa/Xid
Not a benchmark task.
- In a clean container the reported failure did not reproduce, or the known fix did not make the project run.
02 / ENVIRONMENT RECIPE
- Base commit
7a1c4f53348c1f17c5b3660e9f2ba90a6efd51ca- Manifest
pom.xml- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
internetarchive/heritrix3 #266 · read the original issue
Under openjdk 11.0.3 several bdb related unit tests error:
```
testStoredSortedMap(org.archive.settings.file.PrefixFinderTest): javax/transaction/xa/Xid
testDoCheckpoint(org.archive.settings.file.BdbModuleTest): javax/transaction/xa/Xid
testAdd(org.archive.bdb.StoredQueueTest): javax/transaction/xa/Xid
testClear(org.archive.bdb.StoredQueueTest): javax/transaction/xa/Xid
testRemove(org.archive.bdb.StoredQueueTest): javax/transaction/xa/Xid
testOrdering(org.archive.bdb.StoredQueueTest): javax/transaction/xa/Xid
testElement(org.archive.bdb.StoredQueueTest): javax/transaction/xa/Xid
testIdentity(org.archive.bdb.StoredQueueTest): javax/transaction/xa/Xid
testReadConsistencyUnderLoad(org.archive.util.ObjectIdentityBdbCacheTest): javax/transaction/xa/Xid
testBackingDbGetsUpdated(org.archive.util.ObjectIdentityBdbCacheTest): javax/transaction/xa/Xid
testMemMapCleared(org.archive.util.ObjectIdentityBdbCacheTest): javax/transaction/xa/Xid
testReadConsistencyUnderLoad(org.archive.util.ObjectIdentityBdbManualCacheTest): javax/transaction/xa/Xid
testBackingDbGetsUpdated(org.archive.util.ObjectIdentityBdbManualCacheTest): javax/transaction/xa/Xid
```
with this stacktrace:
```
java.lang.NoClassDefFoundError: javax/transaction/xa/Xid
at com.sleepycat.je.dbi.DatabaseImpl.<init>(DatabaseImpl.java:173)
at com.sleepycat.je.dbi.DbTree.<init>(DbTree.java:254)
at com.sleepycat.je.dbi.EnvironmentImpl.<init>(EnvironmentImpl.java:476)
at com.sleepycat.je.dbi.EnvironmentImpl.<init>(EnvironmentImpl.java:340)
at com.sleepycat.je.dbi.DbEnvPool.getEnvironment(DbEnvPool.java:195)
at com.sleepycat.je.Environment.makeEnvironmentImpl(Environment.java:229)
at com.sleepycat.je.Environment.<init>(Environment.java:211)
at com.sleepycat.je.Environment.<init>(Environment.java:165)
at org.archive.settings.file.PrefixFinderTest.testStoredSortedMap(PrefixFinderTest.java:85)
Caused by: java.lang.ClassNotFoundException: javax.transaction.xa.Xid
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at org.apache.maven.surefire.booter.IsolatedClassLoader.loadClass(IsolatedClassLoader.java:93)
... 37 more
```
This class does still exist in jdk11:
```
$ jshell
| Welcome to JShell -- Version 11.0.3
| For an introduction type: /help intro
jshell> javax.transaction.xa.Xid.MAXBQUALSIZE
$1 ==> 64
```
I don't understand the root cause but on a hunch found commenting out this line in pom.xml fixes the error:
```
<useSystemClassLoader>false</useSystemClassLoader>
```
The pom has a comment explaining:
> However, using the systemClassLoader means that we inherit
> maven's CLASSPATH while running our test code. This is a
> problem since maven uses an earlier version of
> commons-lang than we do.
I think it'd be very unlikely that maven would today still using an older version of commons-lang than heritrix but haven't checked that.04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]