On 11/15/10 15:54, Mike Ottinger wrote:
Thanks Justin for the reply.

So I could have sworn I had included this import before my original posting, but I added it back as suggested and lo and behold it's working. Unless I'm crazy, what I thought I was seeing with the jaxen import was that the jaxen and dom4j bundles had optional import dependencies on each other. Yet, when everything was loaded in Felix, I only saw jaxen importing dom4j, but didn't see dom4j importing jaxen! But now my bundle is working fine and I see in Felix the correct imports. Question, I'm using the maven-bundle-plugin, do the order of the imports I declare matter? Thanks for the help.

It does matter if you are using negation (i.e., !), but otherwise it shouldn't matter I don't think.

-> richard


Mike


On Nov 12, 2010, at 5:33 PM, Justin Edelson wrote:

Mike-
Did you install the jaxen bundle? If the import is optional and isn't resolved, then I don't think that shows up in the web console (at least not in the Imported Packages section because, you know, it isn't imported).

Try installing the jaxen bundle and then refreshing the dom4j bundle.

HTH,
Justin

On Nov 11, 2010, at 4:51 PM, Mike Ottinger wrote:

Hello All,

I'm a bit of a newbie with OSGI, so perhaps I'm missing something elementary here, but here it goes; I have a requirement to use the dom4j library for some xml parsing in a bundle. I found an OSGI bundle for dom4j in the SpringSource Bundle repository (http://ebr.springsource.com/repository/app/bundle/version/detail?name=com.springsource.org.dom4j&version=1.6.1). I added all of the appropriate imports for it and the one mandatory dependency it has, I've installed everything in Felix and it's happy. But when I go to use my bundle, I get a NoClassDefFoundError: org/jaxen/JaxenException stacktrace.

Looking into the manifest.mf for the dom4j bundle I see it has an Import-Package declaration for jaxen as optional:

org.jaxen;version="[1.1.1, 2.0.0)";resolution:=optional

But examining the dom4j bundle from the felix web console I don't see org.jaxen as listed for the Imported Packages section. So I'm not sure how I get dom4j to access the jaxen dependency with the bundles I have at my disposal. I could embed these dependencies in my own bundle and carry them around, but I thought the "purist" approach was to look for your dependencies as bundles and have them installed in your container.

Looking for advice on what might be going on here. Thanks in advance.

Mike Ottinger
Senior Software Engineer
Tacit Knowledge




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to