Good!
Yes, Jena has a tight association with Xerces and has been in te past
quite version sensitive. Jena also has source code from Xerces as well.
Xerces is used not only for XML parsing but also for XSD datatype
handling so Jena calls into Xerces not just org.apache.xerces.parser.
It is tempting to shade a copy of Xerces to isolate it from system
provided parsers. Shading was around/reliable when we had recurring
problems when some JRE had it as an endorsed jar.
Andy
On 04/11/16 16:25, [email protected] wrote:
Update.... Great news! The JDBC driver for Jena will work fine in Teiid!!!!
(thanks again for your help, Rob/Andy)
Ramesh noticed something from my comment and I noticed something from his:
https://developer.jboss.org/message/965015?tstart=0#965015
Perhaps the Teiid team could include this in their next release so that it
would support the JENA JDBC driver out of the box, would make it easier for
others to take advantage of all of this great work.
-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Thursday, November 03, 2016 9:16 PM
To: [email protected]
Subject: RE: JDBC in Teiid/JBoss NodeValue / ClassNotFounderror
Rob/Andy - I added more to this thread, I was able to create a simple Java
program and query a triplestore - to gain a better understanding of the JDBC
driver outside of Teiid, could either of you take a look at the bottom of this
thread and add some colour?
I'm not sure what guidance to give to Ramesh to help bridge the gap:
https://developer.jboss.org/thread/272656
I think this is an excellent opportunity to get an open-source data
virtualization working with semantics and think there are some interesting
possibilities for combining data in this manner.
I really appreciate you both helping out with this. I see it as a way to build
views on to SPARQL and vice versa and believe it would help further with
adoption within large organizations that have legacy RDBMSs ; I've already
leveraged Teiid on the Ontop to perform federated queries from r2rml to create
materialized RDF in a really easy way, and this flexibility would just pile on
to that.
-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: Wednesday, November 02, 2016 12:16 PM
To: [email protected]
Subject: RE: JDBC in Teiid/JBoss NodeValue / ClassNotFounderror
Rob - I restarted and tried much of the below , but same behavior - Ramesh has
just responded with a question here at the bottom of the thread:
https://developer.jboss.org/thread/272656
-----Original Message-----
From: Rob Vesse [mailto:[email protected]]
Sent: Wednesday, November 02, 2016 11:16 AM
To: [email protected]
Subject: Re: JDBC in Teiid/JBoss NodeValue / ClassNotFounderror
One possibility is that there is JAR/class caching going on. You may need to
completely remove your application from JBoss and then redeploy it as the fact
that you still see this behaviour implies that you still aren’t getting the
correct services files from the JAR files. Restart of the container/JVM may
also be necessary
Note that if you choose to use the individual driver JAR files then you would
need to also add all the dependencies explicitly as that could also lead to
missing classes and initialisations
Rob
On 02/11/2016 13:19, "[email protected]" <[email protected]>
wrote:
Rob/Andy - thanks!
I'm not sure if I made this clear ... My query does work fine as long as I don't
include "FILTER"; I'm able to get back a select ?s ?p ?o {?s ?p ?o} with no
issues from the driver
I did just try the latest snapshot bundle jar, unfortunately... If I include FILTER
regex(?var,"value")
I still get:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class
org.apache.jena.sparql.expr.NodeValue
I don't believe Teiid is doing any repackaging, and I'm also confused if I
include the individual jar files it won't work ..
Anything else I could try to troubleshoot this? I'm at a loss
-----Original Message-----
From: Rob Vesse [mailto:[email protected]]
Sent: Wednesday, November 02, 2016 6:00 AM
To: [email protected]
Subject: Re: JDBC in Teiid/JBoss NodeValue / ClassNotFounderror
They seem to be conflating two different things here
We do use and support Standard JDBC Driver initialisation. We also use the
same underlying Java mechanism i.e. ServiceLoader to initialise Jena itself.
Our JDBC driver initialisation invokes our Jena initialisation. So as far as
we’re concerned we are not doing anything wrong:
https://github.com/apache/jena/blob/master/jena-jdbc/jena-jdbc-driver-remote/src/main/java/org/apache/jena/jdbc/remote/RemoteEndpointDriver.java#L178
https://github.com/apache/jena/blob/master/jena-jdbc/jena-jdbc-driver-tdb/src/main/java/org/apache/jena/jdbc/tdb/TDBDriver.java#L95
https://github.com/apache/jena/blob/master/jena-jdbc/jena-jdbc-driver-mem/src/main/java/org/apache/jena/jdbc/mem/MemDriver.java#L90
As Andy has pointed out there was a bug in how the bundle JAR with all the
drivers was being created which meant that Jena initialisation wasn’t happening
properly because the composites services file for Jena initialisers wasn’t
being created properly. If you use the latest 3.1.1-SNAPSHOT builds then this
is resolved.
lists.apache.org provides a much more modern interface to our mailing lists
Rob
On 02/11/2016 03:10, "[email protected]" <[email protected]>
wrote:
Hi Andy - further info from Ramesh ; thanks for your patience - he was
having access accessing /reading MarkMail - so I'm relaying (original from
bottom of https://developer.jboss.org/thread/272656) :
"Basically what they need to do, replace their ServiceLoader mechanism
with standard JDBC4 ServiceLoader mechanism like
https://github.com/rareddy/teiid/tree/master/client/src/main/resources/META-INF/services
That will register their Driver class, and in their driver class possibly in a
"static block" call ARQ.init() that will initialize every time one uses their JDBC
driver. "
-----Original Message-----
From: Andy Seaborne [mailto:[email protected]]
Sent: Tuesday, November 01, 2016 12:10 PM
To: [email protected]
Subject: Re: JDBC in Teiid/JBoss NodeValue / ClassNotFounderror
On 01/11/16 14:54, [email protected] wrote:
> Thanks Andy!
>
> Question - who is responsible for loading the JDBC driver, and how
does one load it?
>
> I'm not clear on exact details on how to get it to work. I reached
out to the Teiid team, and Ramesh has a question for you .
>
> Can you look at the bottom of this thread for the question from
Ramesh?
>
> https://developer.jboss.org/thread/272656
Firstly - I didn't write and don't use jena-jdbc so my level of
expertise is limited. The initialization of Jena in shaded jars is something
that has come up before.
It looks like the problem is at the Jena initialization step, not the
loading the JDBC driver. That's supposed to be automatic and is - the crash
happens because the initialization is incomplete or is happening in the wrong
order because the normal sequence isn't happening.
In yoru code, if you can, call ARQ.init() before anything else.
Calling it repeatedly is safe and cheap.
Hopefully RobV can give a better answer for the JDBC aspects.
There is a services/java.sql.Driver - that should cause the JDBC driver
to load. Standard way for Java.
Andy
>
>
> -----Original Message-----
> From: Andy Seaborne [mailto:[email protected]]
> Sent: Tuesday, November 01, 2016 5:49 AM
> To: [email protected]
> Subject: Re: JDBC in Teiid/JBoss NodeValue / ClassNotFounderror
>
>
>> I checked and the jena-jdbc-driver-bundle does not set up the
>> ServiceLoader services correctly. We'll fix that.
>
> jena-jdbc-driver-bundle should be fixed (JENA-1255) now. There is a
development with it in.
>
> Andy
>
>>
>> But I don't immediately see why using the jars directly does not
>> work, but that's due to my lack of knowledge about Teiid and JBoss.
>>
>> Is there any repackaging going on?
>>
>> Andy
>