On 19/10/13 23:08, Charles Li wrote:
Hi, Andy:
Just an update - it seems Eclipse 4.3, when configured with using JDK 1.7,
has a XML parser built in. If I try to change the XML parser by setting
"-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"
in eclipse.ini, Eclipse won't start with security access error.
If I put the above command-line property to my Eclipse plugin project, it
has no effect - I still get the ClassCastException.
I understand this is not a place to ask Eclipse 4 questions, but is there
anyone here developing Jena TDB application using Eclipse 4.3? Any comment?
I use Kepler (Eclipse 4.3 SR 1) and java 1.7 with no problems.
java version "1.7.0_25"
OpenJDK Runtime Environment (IcedTea 2.3.10) (7u25-2.3.10-1ubuntu0.13.04.2)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)
Java does have it's own built in XML parser; it's xerces but renamed
away from org.apache.xerces to com.sun.org.apache.xerces.internal....
I have the Jena xerces on the project build path or when using m2e.
Conceiveable it's an eclipse plugin (I try to have a few as possible!).
Lots of projects have a dependecy on Xerces so something else may be
pulling it in.
Andy
Thanks!
- Charles
On Fri, Oct 18, 2013 at 2:51 AM, Andy Seaborne <[email protected]> wrote:
On 17/10/13 22:52, Charles Li wrote:
Thanks for the response, Andy!
So what version of xerces jar should I use? Under Jena 2.10.1/lib, I
see xercesImpl-2.11.0.jar and xml-apis-1.4.01.jar. Should I try to make
sure they are the first ones to be picked up in my classpath?
Ideally, the only ones (and the associated API ). There seems to be a
strange one on your classpath - good to find out what and why.
Jena 2.10.1 was built with Xerces 2.11.0.
The problem you have is that Java can't load XML property files.
Andy
On Thu, Oct 17, 2013 at 4:16 PM, Andy Seaborne <[email protected]> wrote:
You have the wrong version of Xerces on the classpath (one that is too
old, probably) for some reason. You may have two copies on the
classpath,
the earlier one if being found.
(and some environments put Xerces in the endorsed directory which
overrides anything you choose but they seem to be are nowadays)
Andy
On 17/10/13 21:52, Charles Li wrote:
Hi, Jena Experts:
Please excuse me if you think I am asking in a wrong place.
classpath issues are a perennial issue :-)
I created a utility package in Java to do different Jena queries. The
objective is to hide the Jena/RDF Store details from the user.
I am using Eclipse 4 for the development. When I call my utility package
in
a Java main() program, it execute successfully. However, when I created
an
Eclipse GUI and call the same utility package from a GUI viewPart, it
fails
at the following call with a ClassCastException:
model = TDBFactory.createDataset(****CimModelStoreURL).**
getDefaultModel();
Caused by: java.lang.ClassCastException:
org.apache.xerces.jaxp.****DocumentBuilderFactoryImpl cannot be cast to
javax.xml.parsers.****DocumentBuilderFactory
at
javax.xml.parsers.****DocumentBuilderFactory.****newInstance(**
DocumentBuilderFactory.java:****121)
at java.util.XMLUtils.****getLoadingDoc(XMLUtils.java:****92)
at java.util.XMLUtils.load(****XMLUtils.java:74)
at java.util.Properties.****loadFromXML(Properties.java:****868)
at com.hp.hpl.jena.util.Metadata.****read(Metadata.java:76)
at com.hp.hpl.jena.util.Metadata.****addMetadata(Metadata.java:**54)
at com.hp.hpl.jena.util.Metadata.****<init>(Metadata.java:48)
at com.hp.hpl.jena.JenaRuntime.<****clinit>(JenaRuntime.java:34)
... 81 more
Without knowing exactly what's going on inside the above call, it is
hard
to trouble shoot. Any advice?
Thanks a lot!
P.S.: I found this but not sure if it is relevant.
http://www.pressingquestion.****com/2600422/Java-Xerces-Jar-****
And-Jena<http://www.**pressingquestion.com/2600422/**
Java-Xerces-Jar-And-Jena<http://www.pressingquestion.com/2600422/Java-Xerces-Jar-And-Jena>