Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDK11 support: ClassNotFoundException: javax.transaction.xa.Xid #266

Closed
ato opened this issue Aug 1, 2019 · 0 comments · Fixed by #272
Closed

JDK11 support: ClassNotFoundException: javax.transaction.xa.Xid #266

ato opened this issue Aug 1, 2019 · 0 comments · Fixed by #272

Comments

@ato
Copy link
Collaborator

ato commented Aug 1, 2019

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.

ato added a commit that referenced this issue Aug 2, 2019
Under JDK11 our old version of it throws ClassNotFoundExceptions when
tests load some builtin classes like javax.transaction.xa.Xid.

Fixes #266
ato added a commit that referenced this issue Aug 6, 2019
Under JDK11 our old version of it throws ClassNotFoundExceptions when
tests load some builtin classes like javax.transaction.xa.Xid.

Fixes #266
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant