Trying to debug uses violation
This is related to the "Shell hanging" post. My shell hung when I tried to debug a uses violation, which is described next.
When I deployed my app, I received the following error:
------BEGIN ERROR-----------------
Could not satisfy constraints for bundle 'com.apress.prodmserver.vehicle.repository.jpa' at version '1.0.0'. Cannot resolve: com.apress.prodmserver.vehicle.repository.jpa
Resolver report:
Uses violation: <Import-Package: org.springframework.beans.factory.aspectj; version="0.0.0"> in bundle <com.apress.prodmserver.vehicle.repository.jpa_1.0 .0>
Possible matches:
<Export-Package: org.springframework.beans.factory.aspectj; version="3.0.0.CI-395"> from <org.springframework.aspects_3.0.0.CI-395>
No dependent constraint mismatch. Try refreshing the <org.springframework.aspects_3.0.0.CI-395> bundle.
------END ERROR-----------------
I read Rod Harrop's post on Diagnosing OSGi uses conflicts, and tried employing similar strategies to locate the cause. Because my shell hung whenever I used "headers" for one of the suspects, there is no way for me to further debugging. My understanding is that I look for conflicts in the imports of org.springframework.aspects_3.0.0.CI-395 and com.apress.prodmserver.vehicle.repository.jpa_1.0. 0. Below I am pasting the respective files.
(spring.aspect)
------BEGIN org.springframework.aspects_3.0.0.CI-395 MANIFEST.MF Import Section -----------------
Import-Package:
org.apache.commons.logging;version="[1.1.1, 2.0.0)",
org.aspectj.internal.lang.annotation;version="[1.5.4, 2.0.0)";resolution:="optional",
org.aspectj.lang;version="[1.5.4, 2.0.0)";resolution:="optional",
org.aspectj.lang.annotation;version="[1.5.4, 2.0.0)";resolution:="optional",
org.aspectj.lang.reflect;version="[1.5.4, 2.0.0)";resolution:="optional",
org.springframework.beans;version="[3.0.0, 3.0.1)",
org.springframework.beans.factory;version="[3.0.0, 3.0.1)",
org.springframework.beans.factory.annotation;versi on="[3.0.0, 3.0.1)",
org.springframework.beans.factory.wiring;version="[3.0.0, 3.0.1)",
org.springframework.transaction.annotation;version ="[3.0.0, 3.0.1)";resolution:="optional",
org.springframework.transaction.interceptor;versio n="[3.0.0, 3.0.1)";resolution:="optional"
------END org.springframework.aspects_3.0.0.CI-395 -----------------
(jpa)
------BEGIN com.apress.prodmserver.vehicle.repository.jpa_1.0. 0 MANIFEST.MF Import Section ----------------
Import-Package: com.apress.prodmserver.vehicle.domain,
com.apress.prodmserver.vehicle.repository,
javax.sql
Import-Bundle: com.springsource.org.eclipse.persistence;version="[1.1.0,1.1.0]";import-scope:=application,
com.springsource.javax.persistence;version="[1.0.0,2.0.0)",
com.springsource.org.aspectj.weaver;version="[1.6.6,1.6.7)"
Import-Library: org.springframework.spring;version="[3.0.0,3.0.1)"
------END com.apress.prodmserver.vehicle.repository.jpa_1.0. 0 ------
The Import-Package section in jpa is straight forward, and shouldn't conflict with spring.aspect. Import-Library shouldn't conflict with spring.aspect neither since spring.aspect is part of the library. Finally, I was about to examine the headers in bundles under Import-Bundle, but my shell didn't work.
Hopefully someone with a keen eye can spot the conflict.
Checked SpringSource Bundle Repository
I resorted to checking the import-package declarations in the repository. I didn't find any conflicts. Although both com.springsource.org.aspectj.weaver and org.springsource.aspects both import org.apache.commons.logging, they are importing the exact same versions. And they are not exporting this import through uses.
By the way, I am not seeing any bundles in my server with more than one version installed. I am not even sure how did the uses violations come up at the first place.
1 Attachment(s)
Another try with the CI-450
I tried deploying my bundles on CI-450. The same uses violation came up. This time, both the admin console and the server output console gave the exact same error. I am uploading the bundles (Note - bundles.zip was originally bundles.7z).
Another observation I had is that the admin console rolled back all the changes when the deployment failed. The error message, on the other hand, advised refreshing one of the bundles (in this case - org.springframework.aspects_3.0.0.RC1) which has been uninstalled during the rollback. I had to reinstall the dependencies bundles by hand in order to refresh.
---- BEGIN Error message ------------------
Resolver report:
Uses violation: <Import-Package: org.springframework.beans.factory.aspectj; version="0.0.0"> in bundle <com.apress.prodmserver.vehicle.repository.jpa_1.0 .0>
Possible matches:
<Export-Package: org.springframework.beans.factory.aspectj; version="3.0.0.RC1"> from <org.springframework.aspects_3.0.0.RC1>
No dependent constraint mismatch. Try refreshing the <org.springframework.aspects_3.0.0.RC1> bundle.
---- END Error message ------------------