Discussion:
[d2rq-dev] Question about using d2r with jena
Phil Ashworth
2013-12-23 10:24:52 UTC
Permalink
HI D2r List

Happy Christmas to you all.



I've previously used 0.8.1 as localhost and as hosted endpoint in tomcat
using a war without issues.

It's great Thanks.



I've just been trying to use the code within a java application.

I've followed exactly example exactly as described on the site "Executing
Sparql Queries against a modeld2rq"



However when I run the app I get the error below.

I've imported the jena jars that are listed in the libs directory.

Can anyone tell me where I am going wrong?

FYI: The mapping I am loading works as a local host d2r-server



Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/jena/iri/IRIException

at com.hp.hpl.jena.n3.JenaReaderBase.readImpl(JenaReaderBase.java:113)

at com.hp.hpl.jena.n3.JenaReaderBase.read(JenaReaderBase.java:81)

at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:274)

at
com.hp.hpl.jena.util.FileManager.readModelWorker(FileManager.java:423)

at
com.hp.hpl.jena.util.FileManager.loadModelWorker(FileManager.java:326)

at com.hp.hpl.jena.util.FileManager.loadModel(FileManager.java:278)

at de.fuberlin.wiwiss.d2rq.jena.ModelD2RQ.<init>(ModelD2RQ.java:35)

at
rdf.d2rtest_0_1.d2rTest.tD2RInputConstructRDF_1Process(d2rTest.java:481)

at rdf.d2rtest_0_1.d2rTest.runJobInTOS(d2rTest.java:847)

at rdf.d2rtest_0_1.d2rTest.main(d2rTest.java:713)

Caused by: java.lang.ClassNotFoundException:
org.apache.jena.iri.IRIException

at java.net.URLClassLoader$1.run(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)





Thanks in advance.

Happy holidays!



Phil
Richard Cyganiak
2014-01-07 14:50:38 UTC
Permalink
Hi Phil,

Happy new year!

It may be too late to be of any help, but this looks like a classpath issue with your project setup. The class that is not found — org.apache.jena.iri.IRIException — is not used anywhere in D2RQ 0.8.1. In the version of Jena/ARQ that ships with D2RQ 0.8.1, that class was still called com.hp.hpl.jena.iri.IRIException.

My best guess is that you have a different version of the Jena jars, besides those shipped with D2RQ, somewhere on your project classpath. Make sure that you *only* have those jars shipped in D2RQ's lib directory (and its subdirectories) on the classpath.

Best,
Richard
Post by Phil Ashworth
HI D2r List
Happy Christmas to you all.
I’ve previously used 0.8.1 as localhost and as hosted endpoint in tomcat using a war without issues.
It’s great Thanks.
I’ve just been trying to use the code within a java application.
I’ve followed exactly example exactly as described on the site “Executing Sparql Queries against a modeld2rq”
However when I run the app I get the error below.
I’ve imported the jena jars that are listed in the libs directory.
Can anyone tell me where I am going wrong?
FYI: The mapping I am loading works as a local host d2r-server
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/jena/iri/IRIException
at com.hp.hpl.jena.n3.JenaReaderBase.readImpl(JenaReaderBase.java:113)
at com.hp.hpl.jena.n3.JenaReaderBase.read(JenaReaderBase.java:81)
at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:274)
at com.hp.hpl.jena.util.FileManager.readModelWorker(FileManager.java:423)
at com.hp.hpl.jena.util.FileManager.loadModelWorker(FileManager.java:326)
at com.hp.hpl.jena.util.FileManager.loadModel(FileManager.java:278)
at de.fuberlin.wiwiss.d2rq.jena.ModelD2RQ.<init>(ModelD2RQ.java:35)
at rdf.d2rtest_0_1.d2rTest.tD2RInputConstructRDF_1Process(d2rTest.java:481)
at rdf.d2rtest_0_1.d2rTest.runJobInTOS(d2rTest.java:847)
at rdf.d2rtest_0_1.d2rTest.main(d2rTest.java:713)
Caused by: java.lang.ClassNotFoundException: org.apache.jena.iri.IRIException
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Thanks in advance.
Happy holidays!
Phil
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk_______________________________________________
d2rq-map-devel mailing list
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel
Phil Ashworth
2014-01-08 07:46:05 UTC
Permalink
Hi Richard

Thanks for the update.

I did manage to to get it working before Christmas.
As I went through everything I had realised what you mention above was
happening. However I couldn't find out why.
However actually including the jar for the latest iri e.g.
org.apache....... worked a treat and everything ran.

I'm still a little confused as to why but ..... it works.

Based on this my next question is .... is anyone looking to get out a
release that uses the latest Jena version?

The reason I ask is that there are some really nice new features and
enhancements in jena that I would like to use around D2rq in java.

Happy New Year

Cheers

Phil
Post by Richard Cyganiak
Hi Phil,
Happy new year!
It may be too late to be of any help, but this looks like a classpath
issue with your project setup. The class that is not found —
org.apache.jena.iri.IRIException — is not used anywhere in D2RQ 0.8.1. In
the version of Jena/ARQ that ships with D2RQ 0.8.1, that class was still
called com.hp.hpl.jena.iri.IRIException.
My best guess is that you have a different version of the Jena jars,
besides those shipped with D2RQ, somewhere on your project classpath. Make
sure that you *only* have those jars shipped in D2RQ's lib directory (and
its subdirectories) on the classpath.
Best,
Richard
Post by Phil Ashworth
HI D2r List
Happy Christmas to you all.
I’ve previously used 0.8.1 as localhost and as hosted endpoint in tomcat
using a war without issues.
Post by Phil Ashworth
It’s great Thanks.
I’ve just been trying to use the code within a java application.
I’ve followed exactly example exactly as described on the site
“Executing Sparql Queries against a modeld2rq”
Post by Phil Ashworth
However when I run the app I get the error below.
I’ve imported the jena jars that are listed in the libs directory.
Can anyone tell me where I am going wrong?
FYI: The mapping I am loading works as a local host d2r-server
org/apache/jena/iri/IRIException
Post by Phil Ashworth
at
com.hp.hpl.jena.n3.JenaReaderBase.readImpl(JenaReaderBase.java:113)
Post by Phil Ashworth
at com.hp.hpl.jena.n3.JenaReaderBase.read(JenaReaderBase.java:81)
at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:274)
at
com.hp.hpl.jena.util.FileManager.readModelWorker(FileManager.java:423)
Post by Phil Ashworth
at
com.hp.hpl.jena.util.FileManager.loadModelWorker(FileManager.java:326)
Post by Phil Ashworth
at com.hp.hpl.jena.util.FileManager.loadModel(FileManager.java:278)
at de.fuberlin.wiwiss.d2rq.jena.ModelD2RQ.<init>(ModelD2RQ.java:35)
at
rdf.d2rtest_0_1.d2rTest.tD2RInputConstructRDF_1Process(d2rTest.java:481)
Post by Phil Ashworth
at rdf.d2rtest_0_1.d2rTest.runJobInTOS(d2rTest.java:847)
at rdf.d2rtest_0_1.d2rTest.main(d2rTest.java:713)
org.apache.jena.iri.IRIException
Post by Phil Ashworth
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Thanks in advance.
Happy holidays!
Phil
------------------------------------------------------------------------------
Post by Phil Ashworth
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into
your
Post by Phil Ashworth
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of
AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk_______________________________________________
Post by Phil Ashworth
d2rq-map-devel mailing list
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
d2rq-map-devel mailing list
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel
Richard Cyganiak
2014-01-08 09:35:46 UTC
Permalink
Phil,
Post by Phil Ashworth
I did manage to to get it working before Christmas.
As I went through everything I had realised what you mention above was happening. However I couldn't find out why.
However actually including the jar for the latest iri e.g. org.apache....... worked a treat and everything ran.
I'm still a little confused as to why but ..... it works.
That’s weird. It shouldn’t work! I will not ask any further questions… ;-)
Post by Phil Ashworth
Based on this my next question is .... is anyone looking to get out a release that uses the latest Jena version?
The reason I ask is that there are some really nice new features and enhancements in jena that I would like to use around D2rq in java.
Most work on D2RQ is currently happening through patches submitted by volunteers…

The version in the develop branch (which includes quite a few improvements, including a new SPARQL-to-SQL engine, which unfortunately is still incomplete, resulting in very poor SPARQL performance) uses Jena 2.7.4. Upgrading from 2.7.4 to 2.11.0 might still be a good bit of work, but isn’t as dramatic as going from the version that shipped with D2RQ 0.8.1.

Upgrading Jena is sort of routine maintenance, so it’s one of the first things I’m likely to do whenever I have a chunk of time for work on D2RQ, but I can’t offer a concrete timeline for this.

Best,
Richard
Post by Phil Ashworth
Happy New Year
Cheers
Phil
Hi Phil,
Happy new year!
It may be too late to be of any help, but this looks like a classpath issue with your project setup. The class that is not found — org.apache.jena.iri.IRIException — is not used anywhere in D2RQ 0.8.1. In the version of Jena/ARQ that ships with D2RQ 0.8.1, that class was still called com.hp.hpl.jena.iri.IRIException.
My best guess is that you have a different version of the Jena jars, besides those shipped with D2RQ, somewhere on your project classpath. Make sure that you *only* have those jars shipped in D2RQ's lib directory (and its subdirectories) on the classpath.
Best,
Richard
Post by Phil Ashworth
HI D2r List
Happy Christmas to you all.
I’ve previously used 0.8.1 as localhost and as hosted endpoint in tomcat using a war without issues.
It’s great Thanks.
I’ve just been trying to use the code within a java application.
I’ve followed exactly example exactly as described on the site “Executing Sparql Queries against a modeld2rq”
However when I run the app I get the error below.
I’ve imported the jena jars that are listed in the libs directory.
Can anyone tell me where I am going wrong?
FYI: The mapping I am loading works as a local host d2r-server
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/jena/iri/IRIException
at com.hp.hpl.jena.n3.JenaReaderBase.readImpl(JenaReaderBase.java:113)
at com.hp.hpl.jena.n3.JenaReaderBase.read(JenaReaderBase.java:81)
at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:274)
at com.hp.hpl.jena.util.FileManager.readModelWorker(FileManager.java:423)
at com.hp.hpl.jena.util.FileManager.loadModelWorker(FileManager.java:326)
at com.hp.hpl.jena.util.FileManager.loadModel(FileManager.java:278)
at de.fuberlin.wiwiss.d2rq.jena.ModelD2RQ.<init>(ModelD2RQ.java:35)
at rdf.d2rtest_0_1.d2rTest.tD2RInputConstructRDF_1Process(d2rTest.java:481)
at rdf.d2rtest_0_1.d2rTest.runJobInTOS(d2rTest.java:847)
at rdf.d2rtest_0_1.d2rTest.main(d2rTest.java:713)
Caused by: java.lang.ClassNotFoundException: org.apache.jena.iri.IRIException
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Thanks in advance.
Happy holidays!
Phil
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk_______________________________________________
d2rq-map-devel mailing list
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
d2rq-map-devel mailing list
https://lists.sourceforge.net/lists/listinfo/d2rq-map-devel
Loading...