You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Barry Hathaway <bh...@nycap.rr.com> on 2011/09/29 00:49:04 UTC

Jena and OSGi

I'm not having any luck getting Jena to work in an OGSi environment 
(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

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

Has anybody had any luck using Jena in ServiceMix?
Thanks.

Barry Hathaway


Re: Jena and OSGi

Posted by Dave Reynolds <da...@gmail.com>.
Hi Barry,

Glad there's some hopeful progress.

I didn't use a pom for JenaUsers (Maven and I don't get along so I avoid
it in cases where it doesn't buy me anything) it was just a bndtools
project. The bnd.bnd file (mostly autogenerated) was:

[[[
-runbundles: osgi.cmpn,\
org.apache.felix.shell,\
org.apache.felix.shell.tui,\
com.hp.hpl.jena.core.osgi;version=2.6.4
-runfw: org.eclipse.osgi;version=3.6.1
-buildpath: osgi.core,\
osgi.cmpn,\
biz.aQute.bnd.annotation,\
junit.osgi,\
com.hp.hpl.jena.core.osgi;version=2.6.4
Private-Package: com.epimorphics.support,\
              resources
Require-Bundle:  com.hp.hpl.jena.core.osgi
Bundle-Activator: com.epimorphics.support.JenaTest
]]]

I believe you could use that from a pom via something like:

[[[
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>2.3.4</version>
                  <dependencies>
                    <dependency>
                      <groupId>biz.aQute</groupId>
                      <artifactId>bndlib</artifactId>
                      <version>1.43.0</version>
                    </dependency>
                  </dependencies>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <_include>bnd.bnd</_include>
                    </instructions>
                </configuration>
            </plugin>
]]]

Dave

On Thu, 2011-10-13 at 17:18 -0400, Barry Hathaway wrote: 
> Dave,
> 
> Thanks for sending the files along.  When I installed and started the 
> bundles it did
> print the "SUCCESS" message (actually I had left 2 other Jena bundle in 
> ServiceMix
> so the JenaUsers bundle resolved to it rather than the new bundle). So 
> apparently
> Jena is built correctly. I'll poke around some more and see if I can 
> uncover the problem.
> I'll start with modifying the small JenaUsers bundle and add a few 
> things.  If you have
> the pom that you used to build it please send it along.  Thanks.
> 
> Barry
> 
> On 10/10/2011 7:25 AM, Dave Reynolds wrote:
> > Hi Barry,
> >
> > In that case I'm totally confused about what's going on.
> >
> > A self-contained bundle built using the pom I sent you should use an
> > embedded Xerces you works for me.
> >
> > If it is not using the embedded Xerces but is finding your 2.9.1 install
> > then that should work too (I've checked compatibility with 2.9.1).
> >
> > So we've covered belt and braces and still no joy.
> >
> > Does your JDK have an "endorsed" directory with a copy of Xerces hidden
> > away in it?
> >
> > Best I can suggest is start eliminating variables. I've temporarily put
> > up a copy of a jena bundle [1] built with [2] and a test bundle [3]
> > which just does:
> >
> > public class JenaTest implements BundleActivator {
> >
> >      public static final String DATA_FILE = "/resources/data.rdf";
> >
> >      @Override
> >      public void start(BundleContext context) throws Exception {
> >          System.out.println("Test bundle ...");
> >          Model m = ModelFactory.createDefaultModel();
> >          InputStream in = JenaTest.class.getResourceAsStream(DATA_FILE);
> >          m.read(in, null, FileUtils.langXML);
> >          System.out.println( m.size()>  0 ? "SUCCESS" : "No data");
> >      }
> >
> >      @Override
> >      public void stop(BundleContext context) throws Exception {
> >          System.out.println("Bundle stopped");
> >      }
> > }
> >
> > If I drop the two bundles into a vanilla OSGi runner like Equinox then
> > when the test bundle starts it shows:
> >
> >    Test bundle ...
> >    SUCCESS
> >
> > for me.
> >
> > If you test it in your set up on say Equinox and it fails then it
> > presumably must be your java.
> >
> > If it works, then try dropping the same jars into your real OSGi
> > environment. If that fails then there is something weird about that
> > environment.
> >
> > If it works, then just need to track the differences between that
> > pom/jena-bundle and the one you are using.
> >
> > Dave
> >
> > [1]
> > http://www.epimorphics.com/public/temp/com.hp.hpl.jena.core.osgi-2.6.4.jar
> > [2] http://www.epimorphics.com/public/temp/pom.xml
> > [3] http://www.epimorphics.com/public/temp/JenaUsers.jar
> >
> >
> >
> > On Sun, 2011-10-09 at 14:27 -0400, Barry Hathaway wrote:
> >> Dave,
> >>
> >> I'm actually running with a recent version of Xerces (2.9.1).
> >>
> >> Barry
> >>
> >> On 10/8/2011 10:34 AM, Dave Reynolds wrote:
> >>> On Fri, 2011-10-07 at 17:49 -0400, Barry Hathaway wrote:
> >>>> 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?
> >>> Not really. Like I say I make quite heavy use of Jena with OSGi bundles
> >>> without such problems.
> >>>
> >>> So long as the Xerces references in Jena core are being satisfied from
> >>> the Xerces in the bundle and not from import list then I'm stumped.
> >>>
> >>> Can you update the Xerces in your ServiceMix bundle to something a bit
> >>> more modern which is compatible with Jena?
> >>>
> >>>> Do you think it could have something to do with the static classes in
> >>>> the factory?
> >>> No, since it works fine in other OSGi environments.
> >>>
> >>> Dave
> >>>
> >>>
> >>>
> >>>
> >
> >
> >
> >
> 




Re: Jena and OSGi

Posted by Barry Hathaway <bh...@nycap.rr.com>.
Dave,

Thanks for sending the files along.  When I installed and started the 
bundles it did
print the "SUCCESS" message (actually I had left 2 other Jena bundle in 
ServiceMix
so the JenaUsers bundle resolved to it rather than the new bundle). So 
apparently
Jena is built correctly. I'll poke around some more and see if I can 
uncover the problem.
I'll start with modifying the small JenaUsers bundle and add a few 
things.  If you have
the pom that you used to build it please send it along.  Thanks.

Barry

On 10/10/2011 7:25 AM, Dave Reynolds wrote:
> Hi Barry,
>
> In that case I'm totally confused about what's going on.
>
> A self-contained bundle built using the pom I sent you should use an
> embedded Xerces you works for me.
>
> If it is not using the embedded Xerces but is finding your 2.9.1 install
> then that should work too (I've checked compatibility with 2.9.1).
>
> So we've covered belt and braces and still no joy.
>
> Does your JDK have an "endorsed" directory with a copy of Xerces hidden
> away in it?
>
> Best I can suggest is start eliminating variables. I've temporarily put
> up a copy of a jena bundle [1] built with [2] and a test bundle [3]
> which just does:
>
> public class JenaTest implements BundleActivator {
>
>      public static final String DATA_FILE = "/resources/data.rdf";
>
>      @Override
>      public void start(BundleContext context) throws Exception {
>          System.out.println("Test bundle ...");
>          Model m = ModelFactory.createDefaultModel();
>          InputStream in = JenaTest.class.getResourceAsStream(DATA_FILE);
>          m.read(in, null, FileUtils.langXML);
>          System.out.println( m.size()>  0 ? "SUCCESS" : "No data");
>      }
>
>      @Override
>      public void stop(BundleContext context) throws Exception {
>          System.out.println("Bundle stopped");
>      }
> }
>
> If I drop the two bundles into a vanilla OSGi runner like Equinox then
> when the test bundle starts it shows:
>
>    Test bundle ...
>    SUCCESS
>
> for me.
>
> If you test it in your set up on say Equinox and it fails then it
> presumably must be your java.
>
> If it works, then try dropping the same jars into your real OSGi
> environment. If that fails then there is something weird about that
> environment.
>
> If it works, then just need to track the differences between that
> pom/jena-bundle and the one you are using.
>
> Dave
>
> [1]
> http://www.epimorphics.com/public/temp/com.hp.hpl.jena.core.osgi-2.6.4.jar
> [2] http://www.epimorphics.com/public/temp/pom.xml
> [3] http://www.epimorphics.com/public/temp/JenaUsers.jar
>
>
>
> On Sun, 2011-10-09 at 14:27 -0400, Barry Hathaway wrote:
>> Dave,
>>
>> I'm actually running with a recent version of Xerces (2.9.1).
>>
>> Barry
>>
>> On 10/8/2011 10:34 AM, Dave Reynolds wrote:
>>> On Fri, 2011-10-07 at 17:49 -0400, Barry Hathaway wrote:
>>>> 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?
>>> Not really. Like I say I make quite heavy use of Jena with OSGi bundles
>>> without such problems.
>>>
>>> So long as the Xerces references in Jena core are being satisfied from
>>> the Xerces in the bundle and not from import list then I'm stumped.
>>>
>>> Can you update the Xerces in your ServiceMix bundle to something a bit
>>> more modern which is compatible with Jena?
>>>
>>>> Do you think it could have something to do with the static classes in
>>>> the factory?
>>> No, since it works fine in other OSGi environments.
>>>
>>> Dave
>>>
>>>
>>>
>>>
>
>
>
>


Re: Jena and OSGi

Posted by Dave Reynolds <da...@gmail.com>.
Hi Barry,

In that case I'm totally confused about what's going on.

A self-contained bundle built using the pom I sent you should use an
embedded Xerces you works for me.

If it is not using the embedded Xerces but is finding your 2.9.1 install
then that should work too (I've checked compatibility with 2.9.1).

So we've covered belt and braces and still no joy.

Does your JDK have an "endorsed" directory with a copy of Xerces hidden
away in it?

Best I can suggest is start eliminating variables. I've temporarily put
up a copy of a jena bundle [1] built with [2] and a test bundle [3]
which just does:

public class JenaTest implements BundleActivator {

    public static final String DATA_FILE = "/resources/data.rdf";

    @Override
    public void start(BundleContext context) throws Exception {
        System.out.println("Test bundle ...");
        Model m = ModelFactory.createDefaultModel();
        InputStream in = JenaTest.class.getResourceAsStream(DATA_FILE);
        m.read(in, null, FileUtils.langXML);
        System.out.println( m.size() > 0 ? "SUCCESS" : "No data");
    }

    @Override
    public void stop(BundleContext context) throws Exception {
        System.out.println("Bundle stopped");
    }
}

If I drop the two bundles into a vanilla OSGi runner like Equinox then
when the test bundle starts it shows:

  Test bundle ...
  SUCCESS 

for me.

If you test it in your set up on say Equinox and it fails then it
presumably must be your java.

If it works, then try dropping the same jars into your real OSGi
environment. If that fails then there is something weird about that
environment.

If it works, then just need to track the differences between that
pom/jena-bundle and the one you are using.

Dave

[1]
http://www.epimorphics.com/public/temp/com.hp.hpl.jena.core.osgi-2.6.4.jar
[2] http://www.epimorphics.com/public/temp/pom.xml
[3] http://www.epimorphics.com/public/temp/JenaUsers.jar



On Sun, 2011-10-09 at 14:27 -0400, Barry Hathaway wrote: 
> Dave,
> 
> I'm actually running with a recent version of Xerces (2.9.1).
> 
> Barry
> 
> On 10/8/2011 10:34 AM, Dave Reynolds wrote:
> > On Fri, 2011-10-07 at 17:49 -0400, Barry Hathaway wrote:
> >> 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?
> > Not really. Like I say I make quite heavy use of Jena with OSGi bundles
> > without such problems.
> >
> > So long as the Xerces references in Jena core are being satisfied from
> > the Xerces in the bundle and not from import list then I'm stumped.
> >
> > Can you update the Xerces in your ServiceMix bundle to something a bit
> > more modern which is compatible with Jena?
> >
> >> Do you think it could have something to do with the static classes in
> >> the factory?
> > No, since it works fine in other OSGi environments.
> >
> > Dave
> >
> >
> >
> >
> 




Re: Jena and OSGi

Posted by Barry Hathaway <bh...@nycap.rr.com>.
Dave,

I'm actually running with a recent version of Xerces (2.9.1).

Barry

On 10/8/2011 10:34 AM, Dave Reynolds wrote:
> On Fri, 2011-10-07 at 17:49 -0400, Barry Hathaway wrote:
>> 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?
> Not really. Like I say I make quite heavy use of Jena with OSGi bundles
> without such problems.
>
> So long as the Xerces references in Jena core are being satisfied from
> the Xerces in the bundle and not from import list then I'm stumped.
>
> Can you update the Xerces in your ServiceMix bundle to something a bit
> more modern which is compatible with Jena?
>
>> Do you think it could have something to do with the static classes in
>> the factory?
> No, since it works fine in other OSGi environments.
>
> Dave
>
>
>
>


Re: Jena and OSGi

Posted by Dave Reynolds <da...@gmail.com>.
On Fri, 2011-10-07 at 17:49 -0400, Barry Hathaway wrote: 
> 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?

Not really. Like I say I make quite heavy use of Jena with OSGi bundles
without such problems.

So long as the Xerces references in Jena core are being satisfied from
the Xerces in the bundle and not from import list then I'm stumped. 

Can you update the Xerces in your ServiceMix bundle to something a bit
more modern which is compatible with Jena?

> Do you think it could have something to do with the static classes in 
> the factory?

No, since it works fine in other OSGi environments.

Dave



Re: Jena and OSGi

Posted by Barry Hathaway <bh...@nycap.rr.com>.
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
>>>
>
>
>
>


Re: Jena and OSGi

Posted by Dave Reynolds <da...@gmail.com>.
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
> >
> 




Re: Jena and OSGi

Posted by Barry Hathaway <bh...@nycap.rr.com>.
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?
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
>


Re: Jena and OSGi

Posted by Dave Reynolds <da...@gmail.com>.
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