Skip to content

The Jnats client bundle requires private-package from Eddsa while using in OSGi #199

@oscerd

Description

@oscerd

https://github.com/nats-io/java-nats/blob/f49af697311ddf37658641fe1fc07eadcfe4b611/build.gradle#L55

Trying to use the jnats client as feature dependency in camel-nats, I noticed that the nats-client requires private-package from eddsa, in particular from the math package

[org.ops4j.pax.exam.container.remote.RBCRemoteTarget] : Installed bundle (from stream) as ID: 86
[org.ops4j.pax.exam.container.remote.RBCRemoteTarget] : call [[TestAddress:PaxExam-b7a0e5b7-e3d3-439b-b49c-a9ee7442507f root:PaxExam-2edff29d-0f80-4582-8a23-d795e182156e]]
org.apache.felix.resolver.reason.ReasonException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=camel-nats; type=karaf.feature; version="[2.24.0.SNAPSHOT,2.24.0.SNAPSHOT]"; filter:="(&(osgi.identity=camel-nats)(type=karaf.feature)(version>=2.24.0.SNAPSHOT)(version<=2.24.0.SNAPSHOT))" [caused by: Unable to resolve camel-nats/2.24.0.SNAPSHOT: missing requirement [camel-nats/2.24.0.SNAPSHOT] osgi.identity; osgi.identity=org.apache.camel.camel-nats; type=osgi.bundle; version="[2.24.0.SNAPSHOT,2.24.0.SNAPSHOT]"; resolution:=mandatory [caused by: Unable to resolve org.apache.camel.camel-nats/2.24.0.SNAPSHOT: missing requirement [org.apache.camel.camel-nats/2.24.0.SNAPSHOT] osgi.wiring.package; filter:="(&(osgi.wiring.package=io.nats.client)(version>=2.3.0)(!(version>=3.0.0)))" [caused by: Unable to resolve io.nats.jnats/2.3.0: missing requirement [io.nats.jnats/2.3.0] osgi.wiring.package; filter:="(osgi.wiring.package=net.i2p.crypto.eddsa.math)"]]]
	at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1343)
	at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:392)
	at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:378)
	at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:332)
	at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:257)
	at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:388)
	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1025)
	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:964)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve camel-nats/2.24.0.SNAPSHOT: missing requirement [camel-nats/2.24.0.SNAPSHOT] osgi.identity; osgi.identity=org.apache.camel.camel-nats; type=osgi.bundle; version="[2.24.0.SNAPSHOT,2.24.0.SNAPSHOT]"; resolution:=mandatory [caused by: Unable to resolve org.apache.camel.camel-nats/2.24.0.SNAPSHOT: missing requirement [org.apache.camel.camel-nats/2.24.0.SNAPSHOT] osgi.wiring.package; filter:="(&(osgi.wiring.package=io.nats.client)(version>=2.3.0)(!(version>=3.0.0)))" [caused by: Unable to resolve io.nats.jnats/2.3.0: missing requirement [io.nats.jnats/2.3.0] osgi.wiring.package; filter:="(osgi.wiring.package=net.i2p.crypto.eddsa.math)"]]
	at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1343)
	... 12 more
Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve org.apache.camel.camel-nats/2.24.0.SNAPSHOT: missing requirement [org.apache.camel.camel-nats/2.24.0.SNAPSHOT] osgi.wiring.package; filter:="(&(osgi.wiring.package=io.nats.client)(version>=2.3.0)(!(version>=3.0.0)))" [caused by: Unable to resolve io.nats.jnats/2.3.0: missing requirement [io.nats.jnats/2.3.0] osgi.wiring.package; filter:="(osgi.wiring.package=net.i2p.crypto.eddsa.math)"]
	at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1343)
	... 13 more
Caused by: org.apache.felix.resolver.reason.ReasonException: Unable to resolve io.nats.jnats/2.3.0: missing requirement [io.nats.jnats/2.3.0] osgi.wiring.package; filter:="(osgi.wiring.package=net.i2p.crypto.eddsa.math)"
	at org.apache.felix.resolver.Candidates$MissingRequirementError.toException(Candidates.java:1343)
	... 14 more
[org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer] : Shutting down the test container (Pax Runner)

This is because the eddsa bundle declares math package as private package here
https://github.com/str4d/ed25519-java/blob/v0.3.0/pom.xml#L78

So I believe you need to do some manipulation in the client project, otherwise it won't work in an OSGi container.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions