Understanding the ‘unresolved constraint’, ‘missing requirement’ message from Apache Felix Pt. 2

We previously took a look at Felix’s unresolved constraint message. I started testing with Felix 4.0.2 today and realized the output for an unresolved constraint has changed a bit.

ERROR: Bundle org.sakaiproject.nakamura.world [76] Error starting file:bundles/org.sakaiproject.nakamura.world_1.4.0.SNAPSHOT.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle org.sakaiproject.nakamura.world [76]: Unable to resolve 76.0: missing requirement [76.0] osgi.wiring.package; (&(osgi.wiring.package=javax.servlet)(version>=3.0.0)))
11.07.2012 17:01:43.297 *ERROR* [FelixDispatchQueue] org.sakaiproject.nakamura.world FrameworkEvent ERROR (org.osgi.framework.BundleException: Unresolved constraint in bundle org.sakaiproject.nakamura.world [76]: Unable to resolve 76.0: missing requirement [76.0] osgi.wiring.package; (&(osgi.wiring.package=javax.servlet)(version>=3.0.0))) org.osgi.framework.BundleException: Unresolved constraint in bundle org.sakaiproject.nakamura.world [76]: Unable to resolve 76.0: missing requirement [76.0] osgi.wiring.package; (&(osgi.wiring.package=javax.servlet)(version>=3.0.0))
 at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3826)
 at org.apache.felix.framework.Felix.startBundle(Felix.java:1868)
 at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1191)
 at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:295)
 at java.lang.Thread.run(Thread.java:679)

We have the same unresolved constraint..missing requirement as before but the part we’re interested in has changed a bit. Let’s break apart that first message.

(org.osgi.framework.BundleException: Unresolved constraint in bundle org.sakaiproject.nakamura.world [76]: Unable to resolve 76.0: missing requirement [76.0] osgi.wiring.package; (&(osgi.wiring.package=javax.servlet)(version>=3.0.0)))

Given what we know from last time, the interesting bits above are:

Unresolved constraint in bundle org.sakaiproject.nakamura.world [76]

This tells you what bundle had an issue trying to resolve a constraint. The next part is a bit less obvious but can be broken up.

osgi.wiring.package; (&(osgi.wiring.package=javax.servlet)(version>=3.0.0)))

osgi.wiring.package looks pretty foreign, hu? Disregard that and you see javax.servlet and version>=3.0.0. Tada! That’s the good stuff. So, figure out where that bundle is that exports javax.servlet>=3.0.0 and you’re on your way. (Hint: maybe, javax.servlet:javax.servlet-api:3.0.0 or org.ops4j.pax.web:pax-web-jetty-bundle:2.0.1 is what you’re looking for.)

Advertisements

5 thoughts on “Understanding the ‘unresolved constraint’, ‘missing requirement’ message from Apache Felix Pt. 2

  1. Hi, Good explanation. But what about the error i’m seeing where there is no trace of the package. I’m not able to resolve this as i don’t see the jar containing this package.
    org.osgi.framework.BundleException: Unresolved constraint in bundle vmscore [80]: Unable to resolve 80.1: missing requirement [80.1] osgi.wiring.package; (osgi.wiring.package=org.springframework.asm.tree)
    at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3974)[org.apache.felix.framework-4.2.1.jar:]

      • I know because the package itself is not in the spring jar.. and not sure why it is referring to this package.

    • Wow, I see references to org.springframework.asm.tree in various places on Github but none that actually lead me to a jar or project that contains it. With that, I have a question and a comment.

      Question: what version of Spring are you using?
      Comment: In your bundle manifest, you can mark this package as optional. If nothing is truly using it, this will allow you move forward. If something calls for it, you will see a ClassNotFoundException.

      Good luck and let me know how things go.

      • Spring-asm 3.1.0. But for now , i manipulated the manifest file to remove the .asa.tree package. it is able to proceed further.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s