On 08/08/15 23:38, Erich Bremer wrote:
My bad, I had a separate library for Fuseki 1 on the list and ahead of
Jena 3.  Seems to be okay now.  - Erich

Hi Erich,  thanks for letting us know.


For the record, in case this style of issue which might occur with other mixes of jena2, jena3 jars:

Exception in thread "main" java.lang.NoSuchMethodError:
org.apache.jena.atlas.lib.Cache.getIfPresent

At Jena 3.0.0 there were some changes to Jena's own library code.

1/ Caching now uses Google Guava - there is a shaded version in jena-shaded-guava to avoid version issues.

2/ Some of the library code has been migrated to jena-base

so here jena-core v3 code is run, and it now uses the library caching code. It is looking for org.apache.jena.atlas.lib.Cache. But Cache.getIfPresent is a new operation for Jena 3, not in the Jena2 lib.Cache (in jena-arq). Old jena-arq has lib.Cache so it's not a ClassNotFoundException or NoClassDefFoundError, but a NoSuchMethodError. It found an old class, it didn't have the method.

        Andy

On 8/7/2015 6:18 AM, Rob Vesse wrote:
NoSuchMethodError is usually indicative of a malformed class path

You likely have a mix of Jena 2.x and 3.x present on your class path so I
would first check your dependency tree carefully

Rob

On 07/08/2015 06:11, "Erich Bremer" <[email protected]> wrote:

I got an error in creating a new Jena TDB database.  The /tdb folder is
empty.   It worked fine under Jena 2.x

         Dataset ds = TDBFactory.createDataset("/tdb");

Exception in thread "main" java.lang.NoSuchMethodError:
org.apache.jena.atlas.lib.Cache.getIfPresent(Ljava/lang/Object;)Ljava/lang

/Object;
     at org.apache.jena.enhanced.EnhGraph.getNodeAs(EnhGraph.java:133)
     at
org.apache.jena.rdf.model.impl.IteratorFactory.asResource(IteratorFactory.

java:71)
     at
org.apache.jena.rdf.model.impl.IteratorFactory.asResource(IteratorFactory.

java:62)
     at
org.apache.jena.rdf.model.impl.ModelCom.getResource(ModelCom.java:884)
     at
org.apache.jena.rdf.model.impl.ModelCom.createResource(ModelCom.java:1334)

     at org.apache.jena.vocabulary.OWL.<clinit>(OWL.java:46)
     at
org.apache.jena.sparql.graph.NodeConst.<clinit>(NodeConst.java:45)
     at
org.apache.jena.sparql.engine.optimizer.reorder.ReorderFixed.<clinit>(Reor

derFixed.java:59)
     at
org.apache.jena.sparql.engine.optimizer.reorder.ReorderLib.fixed(ReorderLi

b.java:71)
     at org.apache.jena.tdb.sys.SystemTDB.<clinit>(SystemTDB.java:186)
     at org.apache.jena.tdb.TDB.<clinit>(TDB.java:89)
     at
org.apache.jena.tdb.setup.DatasetBuilderStd.<clinit>(DatasetBuilderStd.jav

a:59)
     at
org.apache.jena.tdb.StoreConnection.make(StoreConnection.java:228)
     at
org.apache.jena.tdb.StoreConnection.make(StoreConnection.java:235)
     at
org.apache.jena.tdb.transaction.DatasetGraphTransaction.<init>(DatasetGrap

hTransaction.java:73)
     at org.apache.jena.tdb.sys.TDBMaker._create(TDBMaker.java:58)
     at
org.apache.jena.tdb.sys.TDBMaker.createDatasetGraphTransaction(TDBMaker.ja

va:46)
     at
org.apache.jena.tdb.TDBFactory._createDatasetGraph(TDBFactory.java:82)
     at
org.apache.jena.tdb.TDBFactory.createDatasetGraph(TDBFactory.java:64)
     at org.apache.jena.tdb.TDBFactory.createDataset(TDBFactory.java:48)
     at org.apache.jena.tdb.TDBFactory.createDataset(TDBFactory.java:44)
     at
com.ebremer.analysis.imports.importregions.main(importregions.java:29)





Reply via email to