Regression in OSGi compatibility of Java client (amqp-client:3.6.4)

194 views
Skip to first unread message

Herr-Herner

unread,
Aug 2, 2016, 12:54:53 AM8/2/16
to rabbitmq-users
Since release 3.6.4 of amqp-client the following two packages get imported in the manifest header:
  • - junit.framework
  • - org.junit

The bundle cannot be resolved in an OSGi framework, because the test packages are not provided in a productive OSGi environment.

Version 3.6.3 of amqp-client does not import these two packages and gets resolved without any issues.

OSGi compatibility is a very important feature for me. Can someone please have a look what's going on during the build process.

I have created an issue for the problem:
https://github.com/rabbitmq/rabbitmq-java-client/issues/162

Thank you very much!

Michael Klishin

unread,
Aug 2, 2016, 10:38:38 AM8/2/16
to rabbitm...@googlegroups.com
Thank you, we will investigate. How can we reproduce the issue, can you please
provide e.g. a small Maven-managed repository on GitHub (or similar)?

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ
Message has been deleted
Message has been deleted

Herr-Herner

unread,
Aug 3, 2016, 2:52:03 AM8/3/16
to rabbitmq-users
I have a attached a small Maven-based project that shows the current package resolution problem in OSGi environments.

Execute "mvn --fail-at-end clean install" on the root project and have a look at the log output. You get the following:

[INFO] --- karaf-maven-plugin:4.0.5:verify (verify) @ com.rabbitmq.issue164.assembly.karaf ---
[INFO] Using repositories: http://uk.maven.org/maven2@id=UK
[INFO] Verification of feature com.rabbitmq/3.6.3 succeeded
[WARNING] Feature resolution failed for [com.rabbitmq/3.6.4]
Message: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=com.rabbitmq; type=karaf.feature; version=3.6.4; filter:="(&(osgi.identity=com.rabbitmq)(ty
pe=karaf.feature)(version>=3.6.4))" [caused by: Unable to resolve com.rabbitmq/3.6.4: missing requirement [com.rabbitmq/3.6.4] osgi.identity; osgi.identity=com.rabbitmq.client; typ
e=osgi.bundle; version="[3.6.4,3.6.4]"; resolution:=mandatory [caused by: Unable to resolve com.rabbitmq.client/3.6.4: missing requirement [com.rabbitmq.client/3.6.4] osgi.wiring.p
ackage; filter:="(osgi.wiring.package=junit.framework)"]]
Repositories: {
        file:C:\Users\cfiehe\Desktop\rabbitmq-java-client_issue-164\assembly\karaf\target/karaf/features.xml
        mvn:org.apache.karaf.features/framework/4.0.5/xml/features
        mvn:org.apache.karaf.features/standard/4.0.5/xml/features
        mvn:org.ops4j.pax.web/pax-web-features/4.2.6/xml/features
}
Resources: {
        mvn:com.rabbitmq/amqp-client/3.6.4
        mvn:org.apache.felix/org.apache.felix.configadmin/1.8.8
        mvn:org.apache.felix/org.apache.felix.fileinstall/3.5.4
        mvn:org.apache.karaf.features/org.apache.karaf.features.core/4.0.5
        mvn:org.apache.sshd/sshd-core/0.14.0
        mvn:org.ops4j.pax.logging/pax-logging-api/1.8.5
        mvn:org.ops4j.pax.logging/pax-logging-service/1.8.5
        mvn:org.ops4j.pax.url/pax-url-aether/2.4.7
}

I have declared two Karaf features, one using version 3.6.3, the other using 3.6.4 of amqp-client. During the verification phase, the Karaf plugin checks if all package imports can be fulfilled. The first feature based on version 3.6.3 can be resolved. The second one fails, because the JUnit packages are declared as mandatory requirements and are not provided by any bundle.

Navigate to "rabbitmq-java-client_issue-164/platform/pax-runner" and execute "mvn pax:run". Now, you get a basic Felix OSGi framework 5.4.0, equipped with the amqp-client bundle in version 3.6.3 and 3.6.4. During framework start, you get the following error:
ERROR: Bundle com.rabbitmq.client [5] Error starting file:bundles/com.rabbitmq.client_3.6.4.jar (org.osgi.framework.BundleException: Unable to resolve com.rabbitmq.client [5](R 5.0
): missing requirement [com.rabbitmq.client [5](R 5.0)] osgi.wiring.package; (osgi.wiring.package=junit.framework) Unresolved requirements: [[com.rabbitmq.client [5](R 5.0)] osgi.w
iring.package; (osgi.wiring.package=junit.framework)])
org.osgi.framework.BundleException: Unable to resolve com.rabbitmq.client [5](R 5.0): missing requirement [com.rabbitmq.client [5](R 5.0)] osgi.wiring.package; (osgi.wiring.package
=junit.framework) Unresolved requirements: [[com.rabbitmq.client [5](R 5.0)] osgi.wiring.package; (osgi.wiring.package=junit.framework)]
        at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4111)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2117)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1371)
        at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
        at java.lang.Thread.run(Thread.java:745)

Execute "bundles" on the shell to verify the bundle states:
g! bundles
    0|Active     |    0|org.apache.felix.framework (5.4.0)
    1|Active     |    1|org.apache.felix.gogo.command (0.16.0)
    2|Active     |    1|org.apache.felix.gogo.runtime (0.16.2)
    3|Active     |    1|org.apache.felix.gogo.shell (0.12.0)
    4|Active     |    5|com.rabbitmq.client (3.6.3)
    5|Installed  |    5|com.rabbitmq.client (3.6.4)

The bundle "com.rabbitmq.client (3.6.3)" is active which means that all mandatory package import requirements are satisfied, whereas bundle "com.rabbitmq.client (3.6.4)" keeps in the installed state, because the JUnit package dependencies cannot be fulfilled.
rabbitmq-java-client_issue-164.zip
Reply all
Reply to author
Forward
0 new messages