Dave,

I put Xerces back into the Jena bundle. I checked all the bundles and the imports/exports
look fine; however, I'm still getting:

PropertyAccessException 1:
org.springframework.beans.MethodInvocationException: Property 'kbaseRoot' threw exception;
nested exception is com.hp.hpl.jena.shared.JenaException:
org.apache.xerces.impl.dv.DVFactoryException:
DTD factory class org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl does not extend from DTDDVFactory.

when I execute the following 3 lines in my application:

        Model m = ModelFactory.createMemModelMaker().createFreshModel();
        FileInputStream is = new FileInputStream(file);
        m = m.read(is, null);

with the offending line being the read.  Any ideas?
Do you think it could have something to do with the static classes in the factory?
Thanks.

Barry

On 10/6/2011 3:32 AM, Dave Reynolds wrote:
Hi Barry,

On Wed, 2011-10-05 at 19:49 -0400, Barry Hathaway wrote:
Dave,

Thanks for sending the pom files along.  I built and installed the arq
bundle as you suggested.
For the jena one, I removed the Xerces embedded dependency since it is
available in one
of the standard ServiceMix bundles (also log4j and slf4j). When I tried
to use the bundle
I received the same message as below:
      DTDDVFactoryImpl does not extend from DTDDVFactory

Is there a specific reason for embedding Xerces into the Jena bundle?
Jena uses some of the XSD data type handling machinery from Xerces whose
interface has been less stable than the normal parsing interface. This
should only affect you if your environment has a *very* old Xerces in it
or is selectively hiding some of the Xerces packages. Whichever is the
case I recommend you put Xerces back into the Jena bundle to avoid that
environment dependency.

Cheers,
Dave



Thanks.

Barry

On 9/29/2011 4:13 AM, Dave Reynolds wrote:
On Wed, 2011-09-28 at 18:49 -0400, Barry Hathaway wrote:
I'm not having any luck getting Jena to work in an OGSi environment
(ServiceMix).
We've used Jena extensively in an OSGi environment though not
ServiceMix.

I've tried "wrap"ping the Jena jars into separate bundles. I've also
built the bundles with
maven-bundle-plugin.  Then when I try:
       Model m = ModelFactory.createMemModelMaker().createFreshModel();
I get:
       DTDDVFactoryImpl does not extend from DTDDVFactory
Those classes are from Xerces. Check how you have specified that
dependency, maybe ServiceMix has a very old Xerces which is being
incorrectly bound to the bundle.

I have also tried building a single bundle which includes all the
imported jars using the
pom.xml file from the Clerezza project. This bundle also starts up, but
this time when
I execute the model factory command above I get:
       nested exception is java.lang.ExceptionInInitializerError
The approach we've used is similar to this - include most of the
dependent jars in the bundle to simplify dependency management. We
package as three bundles - jena, arq and tdb.

In case it helps I've attached pom files for core and arq bundle
projects we use.

[In an ideal world I'd like to ship self-contained bundles like this
from Apache Jena, though the complexities of the Apache and Maven
conventions put me off trying this in the near term.]

Dave






Reply via email to