We have an application running in Tomcat 7.0 using the Oracle Jena adapter for 220.127.116.11 and Jena 2.6.4. I am experiencing an issue opening an existing Oracle model. The issue appears to be when I try to copy the data to an in-memory model, Jena is throwing a NPE:
Caused by: java.lang.NullPointerException: null
at com.hp.hpl.jena.graph.Triple.hashCode(Triple.java:150) ~[jena-2.6.4.jar:na]
at com.hp.hpl.jena.graph.TripleCache.get(TripleCache.java:66) ~[jena-2.6.4.jar:na]
at com.hp.hpl.jena.graph.Triple.create(Triple.java:160) ~[jena-2.6.4.jar:na]
at oracle.spatial.rdf.client.jena.OracleBatchTripleIterator.processNodes(OracleBatchTripleIterator.java:85) ~[sdordfclient-18.104.22.168.0.jar:na]
at oracle.spatial.rdf.client.jena.OracleBatchSemIterator.next(OracleBatchSemIterator.java:233) ~[sdordfclient-22.214.171.124.0.jar:na]
at com.hp.hpl.jena.util.iterator.NiceIterator$1.next(NiceIterator.java:99) ~[jena-2.6.4.jar:na]
at com.hp.hpl.jena.util.IteratorCollection.iteratorToList(IteratorCollection.java:52) ~[jena-2.6.4.jar:na]
at com.hp.hpl.jena.graph.impl.SimpleBulkUpdateHandler.addIterator(SimpleBulkUpdateHandler.java:57) ~[jena-2.6.4.jar:na]
at com.hp.hpl.jena.graph.impl.SimpleBulkUpdateHandler.add(SimpleBulkUpdateHandler.java:67) ~[jena-2.6.4.jar:na]
at com.hp.hpl.jena.rdf.model.impl.ModelCom.add(ModelCom.java:170) ~[jena-2.6.4.jar:na]
at com.hp.hpl.jena.rdf.model.impl.ModelCom.add(ModelCom.java:167) ~[jena-2.6.4.jar:na]
I am able to use the same code running in a simple Java app just fine, but when included in the Tomcat war, the same code fails. Here is the sample of the loading code:
I've tried this two different ways; adding the connected model to an in-memory simple Jena Model, and also to TDB-backed dataset, and they both throw this exception at that point. Nothing gets thrown by the ModelOracleSem call.
I have a little more information about this, but no solution yet; and, unfortunately, no reproducible test case that I can give you (yet). I attempted to put together a small example that would illustrate the problem, but was unsuccessful. I put together the simplest web app I could that opened an Oracle model, but unlike our full-fledged app, the test worked correctly, eliminating Tomcat by itself as the culprit.
I has since started trying to remove as much complexity I can little by little from the code in our webapp, and I am still seeing the issue. This leads me to believe that there is something about the way our WAR is packaged that is causing the problem, especially given that the attempt to open the model fails both when run as a REST request, as well as when run via a Quartz job (both in the same WAR with the same error).
All of the dependencies are the same, including the JDBC driver. Here are the versions of everything (relevant) we're using:
I realize we have a mismatch between the Jena Adapter and the version of Oracle we're on, but since it works outside of Tomcat I don't suspect this is the problem. We're currently in the infancy of trying to upgrade our Oracle instances, but it could be quite some time before we complete that.
I'm going to continue to try and eliminate variables to see if I can figure out what about our WAR is causing the problem, but I wanted to post an update in case there was any advice you can provide.