Andy thanks! I'm hoping Ramesh will be able to answer some of this
I’m not sure where I actually would make the code call for the below , because
from what I'm seeing - there is only driver configuration and no place to
insert code in Teiid, but I'm probably mistaken.
-----Original Message-----
From: Andy Seaborne [mailto:[email protected]]
Sent: Wednesday, November 02, 2016 9:42 AM
To: [email protected]
Subject: Re: JDBC in Teiid/JBoss NodeValue / ClassNotFounderror
The FILTER requires value processing - which is NodeValue - otherwise your
query does not need it.
NodeValue calls "JenaSystem.init()" when the class is loaded so that suggests
that full initialization has not happened.
Try putting this code before doing anything related to jena including touching
a JDBC URL.
InitJenaCore.init();
RIOT.init();
ARQ.init();
This is not the right way to do initialization but it will work because it is
hardcoding what should happen.
Can you get more of the stacktraces? Where in NodeValue is there an exception
causing NoClassDefFoundError? (Java does not make this easy)
Andy
On 02/11/16 13:19, [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
> >
>
>
>
>
>