The most common reason for wrong/unexpected version of a class to get used at runtime arises from the fact that Java at runtime will simply scan the classpath and grab the first class name that matches when searching for classes. So what can happen is that even if you specify the right dependency version some OTHER dependency (I'm assuming Maven, as the example) may load some OTHER version of something. The way to troubleshoot and see if this is happening is use the maven command line option for generating the depencency graph/tree and view that and see where the other unwanted version is getting pulled in from, and then to fix it (not ALWAYS possible) is to do an exclude of the improper version and then hope that doesn't choke the JAR/dep that pulled in the wrong version to begin with. This is a nasty problem, and is the reason that springboot exists and to some extent why OSGi exists. The single classpath is a limitation of Java.
Best regards, Clay Ferguson [email protected] On Mon, May 22, 2017 at 10:59 PM, Chetan Mehrotra <[email protected] > wrote: > On Mon, May 22, 2017 at 7:14 PM, Ron Wheeler > <[email protected]> wrote: > > Exception in thread "main" java.lang.IllegalAccessError: tried to access > > class org.apache.jackrabbit.stats.TimeSeriesAverage from class > > org.apache.jackrabbit.oak.plugins.blob.BlobStoreStats > > at > > org.apache.jackrabbit.oak.plugins.blob.BlobStoreStats.getAvgTimeSeries( > BlobStoreStats.java:200) > > Looks like some dependency version conflict issue. Whats the version > of jackrabbit-jcr-commons in your classpath? The TimeSeriesAverage was > made public with JCR-3855 long time back. So unless you are using a > version < 2.10 you should not be getting this error > > Chetan Mehrotra >
