felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard S. Hall" <he...@ungoverned.org>
Subject Re: Embedding Hibernate in an OSGi bundle using maven-bundle-plugin is hard
Date Mon, 05 Apr 2010 00:06:01 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.

-> richard

> Another thought: maybe I'm missing some magic Maven artifact that I
> could import to get a working Hibernate library for OSGi environments?
>
> Thank you very much in advance!
> -Dan
>    
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message