DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: David Blain
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
DataNucleus Cache

Support Coherence 3.7+

Created: 19/Jan/13 10:09 AM   Updated: 19/Dec/13 09:22 AM   Resolved: 19/Dec/13 09:22 AM
Component/s: Coherence
Affects Version/s: 3.1.1
Fix Version/s: 3.1.3

Environment: Windows 7, Java 6u35 x64, DataNucleus 3.1.2, Coherence 3.7.1, Neo4j 1.7.2

Forum Thread URL:,7333
Datastore: Other
Severity: Development

 Description  « Hide
I'm trying to configure datanucleus 3.1.2 with JPA and Neo4j plugin and Coherence as L2 cache. Everything works except the cache, at runtime I receive the following exception:

java.lang.IncompatibleClassChangeError: Found interface, but class was expected
        at org.datanucleus.cache.coherence.CoherenceLevel2Cache.put(
        at org.datanucleus.cache.AbstractLevel2Cache.putAll(
        at org.datanucleus.ObjectManagerImpl.putObjectsIntoLevel2Cache(
        at org.datanucleus.ObjectManagerImpl.performLevel2CacheUpdateAtCommit(
        at org.datanucleus.ObjectManagerImpl.preCommit(
        at org.datanucleus.ObjectManagerImpl.transactionPreCommit(
        at org.datanucleus.TransactionImpl.internalPreCommit(
        at org.datanucleus.TransactionImpl.commit(
        at org.datanucleus.api.jpa.JPAEntityTransaction.commit(
        at be.dablomatique.entities.DepartmentsTest.tearDown(
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.lang.reflect.Method.invoke(
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(
        at org.junit.internal.runners.statements.RunAfters.evaluate(
        at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(
        at org.junit.runners.ParentRunner$
        at org.junit.runners.ParentRunner$1.schedule(
        at org.junit.runners.ParentRunner.runChildren(
        at org.junit.runners.ParentRunner.access$000(
        at org.junit.runners.ParentRunner$2.evaluate(
        at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(
        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite
        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.lang.reflect.Method.invoke(
        at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(
        at org.apache.maven.surefire.booter.SurefireBooter.main(

When I disable the datanucleus-cache configuration (3.1.1), then it works. I've tried with several version, it still fails with the same exception.

I've looked in the source code (on: and I saw that 2 of the Coherence interfaces have been reimplemented in the datanucleus-cache project as classes (CacheFactory and NamedCache), which could explain why we receive this error.

Sort Order: Ascending order - Click to sort in descending order
David Blain added a comment - 19/Jan/13 10:15 AM
To bypass this problem, I removed both reimplemented Coherence classes from the source code and added the Coherence dependency to rebuild the jar project. Maybe both classes should be reimplemented as interfaces in the original source code because with this fix, the library becomes dependent of Coherence which isn't a good solution I think.

FYI you can find the modified project on:

Andy Jefferson added a comment - 19/Jan/13 10:38 AM
But that doesn't solve the problem. It has to be possible for any DN developer to build the "cache" plugin without some commercial library. i.e using what is freely available in repos. Providing those stubs in the source tree means that they can do that (and they aren't included in the released datanucleus-cache.jar, just for compiling). Consequently what is needed are updated stubs that match the current Coherence, preferably via a patch to SVN trunk.

Andy Jefferson added a comment - 19/Dec/13 08:42 AM
Downgrading since no patch provided, and no easy way of supporting this. Your GitHub project says to "Download Coherence 3.7.1 from ..." yet Coherence is at v12.x now and also when I download their jar and try to install it using the Oracle docs it says
"java -jar coherence_121200.jar
Extracting files....
The OpenJDK JVM is not supported on this platform.
The Oracle Universal Installer failed. Exiting."

Consequently, unless someone has a coherence.jar available that could be put in a Maven repo, this issue is dependent on someone providing something. Of course we could just wait til they update Coherence to support javax.cache (now at v1.0) and we already support that. So it's down to users to say if its a priority to them and act accordingly

Andy Jefferson added a comment - 19/Dec/13 09:22 AM
Actually found a copy of this jar and added instructions to pom.xml