Re: NullPointerExceptions in v3.6.0

2018-03-06 Thread Chris Wood
Hi Andy, It does seem weird. Just for completeness, I changed my first example to: Model model = dataset.getDefaultModel(); model.add(new StatementImpl( ModelFactory.createDefaultModel().createResource("http://example.org/thing "), FOAF.name,

Re: NullPointerExceptions in v3.6.0

2018-03-05 Thread Andy Seaborne
On 02/03/18 18:02, Chris Wood wrote: Hi Andy, I've answered one question, but got another... Your comment "What is more, I can't line the stacktrace line numbers up with the code. Jena 3.0.1 lines up better" made me sheepishly realise that my tdbquery path was pointing to an old version of

Re: NullPointerExceptions in v3.6.0

2018-03-02 Thread Chris Wood
Hi Andy, I've answered one question, but got another... Your comment "What is more, I can't line the stacktrace line numbers up with the code. Jena 3.0.1 lines up better" made me sheepishly realise that my tdbquery path was pointing to an old version of Jena I had locally (although this was

Re: NullPointerExceptions in v3.6.0

2018-03-02 Thread Andy Seaborne
Hi Chris, I am on Linux, with Apache Maven 3.5.2, java openjdk version "1.8.0_151". It works for me. What is more, I can't line the stacktrace line numbers up with the code. Jena 3.0.1 lines up better on JournalControl.recoverSegment(JournalControl.java:185) because that is a call to

Re: NullPointerExceptions in v3.6.0

2018-03-01 Thread Chris Wood
Hi Andy (et al.), I hope this is a minimal, reproducible example - and shows that I still get the error after compilation with maven. If I run the same code as an independent project in Eclipse (i.e. without maven integration) then it works as expected and the final tdbquery command returns the

Re: NullPointerExceptions in v3.6.0

2018-03-01 Thread Chris Wood
Hi Andy, Yeh, that was on my debugging list! I've seemingly tracked it down to a maven problem. I'm working in eclipse: when I created a new project and copied all the files across and ran it in eclipse, it worked; as soon as I built and packed via maven, I got the error. I'll do some more

Re: NullPointerExceptions in v3.6.0

2018-02-28 Thread Andy Seaborne
Chris, It looks like details matter - could you send a complete, minimal example (i.e. standalone and runnable)? Thanks Andy On 28/02/18 17:26, Chris Wood wrote: Yeh, I thought I was doing that! I've taken that line of code out anyway but it seems to make no difference... On 28

Re: NullPointerExceptions in v3.6.0

2018-02-28 Thread Chris Wood
Yeh, I thought I was doing that! I've taken that line of code out anyway but it seems to make no difference... On 28 February 2018 at 16:55, Rob Vesse wrote: > Notice that Andy specifically said in his response: > > call this very early (before any TDB related activity)

Re: NullPointerExceptions in v3.6.0

2018-02-28 Thread Rob Vesse
Notice that Andy specifically said in his response: call this very early (before any TDB related activity) Rob On 28/02/2018, 16:21, "Chris Wood" wrote: Hi Rob - sorry, that was an over-simplification of the psedocode; I do call

Re: NullPointerExceptions in v3.6.0

2018-02-28 Thread Chris Wood
Hi Rob - sorry, that was an over-simplification of the psedocode; I do call dataset.begin(ReadWrite.WRITE); after initialising it. I had also wondered if setFileMode makes any difference - I was using it because of this Andy's comment here:

Re: NullPointerExceptions in v3.6.0

2018-02-28 Thread Rob Vesse
Two things look odd: - You never call dataset.begin() to start the transaction yet you later try to commit() it - Calling SystemTDB.setFileMode() after opening a dataset probably doesn't have any effect on already open datasets though I could be wrong on this point Rob On 28/02/2018, 13:08,

Re: NullPointerExceptions in v3.6.0

2018-02-28 Thread Chris Wood
Hi Andy, It's probably a bit more complicated than I originally suggested. Inside my try statement I do a bit of processing in a separate class (I create a new in-memory Dataset, and return the model from it, so I can add it to my my main dataset); but I also use this class to initialise the

Re: NullPointerExceptions in v3.6.0

2018-02-28 Thread Andy Seaborne
Chris, Is the dataset TDB (from TDBFactory) or a dataset holding a model, maybe with added inference, where the base graph is backed by TDB? It is better to put changes to the dataset inside a transaction. Failing that, it should be sync'ed -- TDB.sync(). Andy

NullPointerExceptions in v3.6.0

2018-02-27 Thread Chris Wood
I've got a small application that follows the standard recommended pattern: // initialise dataset / model ... try { // ... add statements StmtIterator r = this.my_model.listStatements(); System.out.println(r.toList().size()); this.dataset.commit(); } catch