felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan H <hussdl1985-fe...@yahoo.de>
Subject Re: Embedding Hibernate in an OSGi bundle using maven-bundle-plugin is hard
Date Mon, 05 Apr 2010 15:10:45 GMT

> 
> 
> On 4/4/10 8:01 PM, Dan H wrote:
>> Has anyone managed to embed Hibernate within their bundle using Maven
>> and maven-bundle-plugin? I'm getting errors that seem to be the result
>> of bad manifest "Import-Package" sections:
>>
>> ----
>> ERROR: Error starting file:/C:/dev/felix/bundle/kurt-handler-a-1.0.0.jar
>> (org.osgi.framework.BundleException: Unresolved
>>   constraint in bundle de.huss.kurt-handler-a [2]: package;
>> (package=com.sun.jdmk.comm))
>> org.osgi.framework.BundleException: Unresolved constraint in bundle
>> de.huss.kurt-handler-a [2]: package; (package=com.su
>> n.jdmk.comm)
>>          at
>> org.apache.felix.framework.Felix.resolveBundle(Felix.java:3295)
>>          at org.apache.felix.framework.Felix.startBundle(Felix.java:1653)
>>          at
>> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1124)
>>          at
>> org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
>>          at java.lang.Thread.run(Thread.java:619)
>> ----
>>
>> There is a lot of guesswork involved, but I think that the bundle plugin
>> does not handle the<exclusions>  node of a dependency and adds a package
>> import to the manifest anyway. It also seems possible to me that the
>> bundle plugin is adding imports for dependencies that are flagged as
>> optional. I've attached the pom.xml and the generated manifest for those
>> who care.
>>    
> 
> Well, if you don't need that package, try adding this to the
> maven-bundle-plugin configuration:
> 
> <Import-Package>!com.sun.jdmk.*,*</Import-Package>
> 
> This will exclude jdmk and all subpackages from your imports, but still
> import everything else.
> 
Yeah, that's what I did for the first four imports: jdmk, javassist,
org.jaxen.pattern, org.apache.commons.logging, etc. etc.

However, I realized that this trial&error approach throws us back to
manual (non-)dependency management: having to make a list of all things
 that we *don't* want to be imported doesn't really solve the problem.

Well, instead of crying in your face I'm going to try make myself
useful. I'll take a look at the plugin code. Perhaps I can hack
something in that makes this fantastic plugin it do its job as
advertised :-)

To those who found this email when googling "Maven Hibernate OSGi" or
something like that: if I ever find a solution, I'll make sure to post
it here.

-Dan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Mime
View raw message