Specifically, this exception is thrown when the resolver has exhausted
all possible wiring combinations and could not find a valid wiring
configuration (i.e., no possible consistent class space). When this
exception is thrown, there is no information that Felix really has to
put in the exception...it just knows that it has exhausted all combinations.
However, if you turn on debug logging, Felix should give you debug
messages when it encounters a constraint violation.
Generally speaking, this issue is related to "uses" constraints, which
is what the OSGi resolver uses to determine if a class space is
consistent. If one package "uses" another package, then it means that
the package exposes classes of the used package in its method signatures
in some fashion. Thus, any bundle importing the using package from the
using bundle must be wired to the same provider of the used packages (if
it imports the used packages too), e.g.:
A imports bar and exports foo which uses bar
B exports bar
C exports bar
D imports foo and bar
If A.bar is wired to B.bar, then D.bar must also be wired to B.bar
(likewise if A.bar is wired to C.bar).
-> richard
Sahoo wrote:
I get an exception that looks like this:
Unable to resolve due to constraint violation.
at
org.apache.felix.framework.Felix._resolveBundle(Felix.java:1733)
at org.apache.felix.framework.Felix._startBundle(Felix.java:1589)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1542)
at
org.apache.felix.framework.BundleImpl.start(BundleImpl.java:369)
In the absence of exception chaining, I had to attaching a debugger to
find out the origin. The exceptions is originated from
R4SearchPolicyCore.incrementCandidateConfiguration(List resolverList).
What constraint is being violated? The exception seems to be coming
because it thinks there is an inconsistent class space. Some more
information would be useful to find out what exactly prompted it to
think that way.
Thanks,
Sahoo
---------------------------------------------------------------------
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]