Hello,
the problem seems to be simple:
My bundle declared two package dependencies (package A and B) with
always one specific version version="[1.1.2,1.1.2]".
The problem seems to be, that B has a dependency to A with
version="[1.1.2, 2.0.0)" of A. When deploying my bundle, B gets wired to
version 1.2.0.v20110728 of A and my bundle doesn't resolve because it
expects version 1.1.2 of A.
See http://www.wingsuit.de/transitive_dependency.jpg
At runtime B has the choice to use the latest version of A that nobody
needs (what it does) or to use the one that is
actually imported by my dependent bundle. I wonder why it uses the first
option.
I set the import statements for A before B to try if the order is
relevant but that didn't change anything. I guess I got something wrong
or don't know something about how OSGi works. I checked the OSGi spec
but couldn't find a solution. Is there any declaration that I overlooked?
I know the question is not specific to Felix but I would appreciate it a
lot if anybody has a hint on how I could proceed to resolve the
dependency! In case the problem is described in "OSGi in
Action" I would bye the book.
In case it's needed there is some detailed background:
I'm developing a node browser application ("jcrbrowser") for Sling that
is written in JSP's with JSTL-EL. When I upload the
two dependencies from http://ebr.springsource.com/repository
com.springsource.javax.servlet.jsp.jstl-1.1.2.jar (A in my example) and
com.springsource.org.apache.taglibs.standard-1.1.2.jar (B in my example)
manually via the Management Console everything works fine.
It doesn't work with other versions of those two jars.
I would like to provide the jcrbrowser as a bundle in an OBR to make it
easy for users to install it in Sling with its dependencies.
So I declared all the jstl dependency as package imports like this:
Import-Package: javax.servlet.jsp.jstl.fmt;version="[1.1.2,1.1.2]"
and all the taglibs.standard dependency similar:
org.apache.taglibs.standard;version="[1.1.2,1.1.2]"...
Then I added my obr for my bundle and the
obr from Spring that provides the two bundles
(http://sigil.codecauldron.org/spring-external.obr) to Sling (Felix) and
deployed my bundle.
The result of "start 98" is:
org.osgi.framework.BundleException: Constraint violation for package
'javax.servlet.jsp.jstl.fmt' when resolving module 98.0
between existing import 95.0.javax.servlet.jsp.jstl.fmt BLAMED ON
[[98.0] package;
(&(package=javax.servlet.jsp.jstl.fmt)(version>=1.1.2)(version<=1.1.2))]
and uses constraint 99.0.javax.servlet.jsp.jstl.fmt BLAMED ON [[98.0]
package;
(&(package=org.apache.taglibs.standard.tag.rt.fmt)(version>=1.1.2)(version<=1.1.2)),
[94.0] package;
(&(package=javax.servlet.jsp.jstl.fmt)(version>=1.1.2)(!(version>=2.0.0)))]
I understand it as:
"Constraint violation for package '...jstl.fmt' when resolving
jcrbrowser, expecting jstl.fmt version 1.1.2 but bundle jstl(99) wired a
higher version to bundle taglibs standard (94)."
Where
98=jcrbrowser
94=taglibs.standard (B)
99=jstl bundle 1.2.0.v20110728 (A)
95=jstl bundle 1.1.2 (A)
94 taglibs.standard:
Import-Package:
org.apache.taglibs.standard.tag.common.fmt;version="[1.1.2, 2.0.0)"
99 jstl bundle-version 1.2.0.v20110728:
Export-Package:
javax.servlet.jsp.jstl.fmt;version="1.2.0.v20110728";uses:="javax.servlet.http,javax.servlet.jsp"
95 jstl bundle-version 1.1.2:
Export-Package:
javax.servlet.jsp.jstl.fmt;version="1.1.2";uses:="javax.servlet.jsp"
Best,
Sandro
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]