The problem has been solved!
My problem is that I was using ant to package everything into a single
jar file, but my ant file was only extracting the class files from the
jena jar files. The jar files also contain some files in META-INF,
including ones that look like they are doing something to configure
xerces:
META-INF/services/javax.xml.datatype.DatatypeFactory
META-INF/services/javax.xml.parsers.DocumentBuilderFactory
META-INF/services/javax.xml.parsers.SAXParserFactory
META-INF/services/javax.xml.stream.XMLEventFactory
META-INF/services/javax.xml.validation.SchemaFactory
META-INF/services/org.w3c.dom.DOMImplementationSourceList
META-INF/services/org.xml.sax.driver
I now have my ant file include all the files from the jena jar files
and it now works!
Barbara
Quoting Dave Reynolds <[email protected]>:
This looks like a problem with the version of Xerces. Make sure you
don't have a different older Xerces on your classpath. Note that
some Java environments have an "endorsed" directory which sneaks an
old copy of Xerces onto your classpath without you being aware of it.
Dave
On 25/05/12 02:13, Barbara Lerner wrote:
Hi,
I am new to Jena and am trying to use tdb to create a database.
When I call TDBFactory.createModel, I get the exception shown
below. I have tried using ModelFactory.createDefaultModel() and
that works fine. I thought there might be a versioning problem
with external jars, but I believe I am using the jar files that
came with tdb in my build.
I would appreciate any suggestions!
Barbara
Exception in thread "main" java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at org.apache.xerces.impl.dv.ObjectFactory.newInstance(Unknown Source)
at org.apache.xerces.impl.dv.SchemaDVFactory.getInstance(Unknown Source)
at org.apache.xerces.impl.dv.SchemaDVFactory.getInstance(Unknown Source)
at
com.hp.hpl.jena.datatypes.xsd.XSDDatatype.<init>(XSDDatatype.java:210)
at
com.hp.hpl.jena.datatypes.xsd.XSDDatatype.<init>(XSDDatatype.java:222)
at com.hp.hpl.jena.datatypes.xsd.impl.XSDFloat.<init>(XSDFloat.java:44)
at
com.hp.hpl.jena.datatypes.xsd.XSDDatatype.<clinit>(XSDDatatype.java:55)
at com.hp.hpl.jena.sparql.graph.NodeConst.<clinit>(NodeConst.java:16)
at
com.hp.hpl.jena.sparql.engine.optimizer.reorder.ReorderFixed.<clinit>(ReorderFixed.java:23)
at
com.hp.hpl.jena.sparql.engine.optimizer.reorder.ReorderLib.fixed(ReorderLib.java:53)
at com.hp.hpl.jena.tdb.sys.SystemTDB.<clinit>(SystemTDB.java:173)
at com.hp.hpl.jena.tdb.TDB.<clinit>(TDB.java:70)
at com.hp.hpl.jena.tdb.sys.SetupTDB.<clinit>(SetupTDB.java:70)
at
com.hp.hpl.jena.tdb.sys.DatasetGraphSetup.createDatasetGraph(DatasetGraphSetup.java:21)
at
com.hp.hpl.jena.tdb.sys.CachingTDBMaker.createDatasetGraph(CachingTDBMaker.java:46)
at com.hp.hpl.jena.tdb.sys.TDBMaker._createGraph(TDBMaker.java:71)
at com.hp.hpl.jena.tdb.TDBFactory.createGraph(TDBFactory.java:94)
at com.hp.hpl.jena.tdb.TDBFactory.createGraph(TDBFactory.java:100)
at com.hp.hpl.jena.tdb.TDBFactory.createModel(TDBFactory.java:56)
at laser.ddg.query.RdfModelFactory.getModel(RdfModelFactory.java:39)
at laser.ddg.query.RdfModelFactory.<clinit>(RdfModelFactory.java:19)
at laser.juliette.ddgbuilder.DDGBuilder.<init>(DDGBuilder.java:97)
at
laser.juliette.ddgbuilder.DDGBuilderConfigurator.visit(DDGBuilderConfigurator.java:16)
at
laser.juliette.runtime.RuntimeFactoryFactory.createRuntimeFactory(RuntimeFactoryFactory.java:13)
at laser.juliette.runner.Runner.startProcess(Runner.java:47)
at laser.juliette.runner.Runner.run(Runner.java:30)
at
laser.juliette.runner.RunnerCommandService.run(RunnerCommandService.java:22)
at laser.juliette.driver.Driver.run(Driver.java:48)
at laser.juliette.driver.Driver.main(Driver.java:25)
Caused by: java.lang.RuntimeException: internal error
at
org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl.applyFacets1(Unknown
Source)
at
org.apache.xerces.impl.dv.xs.SchemaDVFactoryImpl.createBuiltInTypes(Unknown
Source)
at
org.apache.xerces.impl.dv.xs.SchemaDVFactoryImpl.<clinit>(Unknown
Source)
... 35 more
------------------
Barbara Lerner
Associate Professor
Computer Science Dept.
Mt. Holyoke College
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.