You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Cris Rockwell <cm...@umich.edu> on 2021/03/05 15:24:13 UTC
Pax Help regarding oak-jackrabbit-api
The hard part about Pax exam testing is getting the project bundle active given the dependency versions provided by the testing instance. I tried patching the test instance maven bundles and versions, but gave up after a certain point.
Instead what I trying is logging the bundles and version
void logBundles() {
for (final Bundle bundle : bundleContext.getBundles()) {
// logs to target/test.log
logger.info(bundle.getSymbolicName()+":"+bundle.getVersion().toString());
}
}
And adjusting my maven pom.xml to allow a range
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>oak-auth-external</artifactId>
<version>[1.12,1.32]</version>
</dependency>
But now I have this bundle wiring error
ERROR: Bundle org.apache.sling.auth.saml2 [187] Error starting file:/Users/cmrockwe/Documents/a3workspace/sling-whiteboard/saml-handler/target/paxexam/SamlHandlerIT/dbeeda70-55ff-4d85-ba39-c0a117fd83eb/pax-exam-downloads/org.apache.sling.auth.saml2_0.2.0.SNAPSHOT.jar (org.osgi.framework.BundleException: Unable to resolve org.apache.sling.auth.saml2 [187](R 187.0): missing requirement [org.apache.sling.auth.saml2 [187](R 187.0)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.jackrabbit.api)(version>=2.6.0)(!(version>=3.0.0))) Unresolved requirements: [[org.apache.sling.auth.saml2 [187](R 187.0)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.jackrabbit.api)(version>=2.6.0)(!(version>=3.0.0)))])
org.osgi.framework.BundleException: Unable to resolve org.apache.sling.auth.saml2 [187](R 187.0): missing requirement [org.apache.sling.auth.saml2 [187](R 187.0)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.jackrabbit.api)(version>=2.6.0)(!(version>=3.0.0))) Unresolved requirements: [[org.apache.sling.auth.saml2 [187](R 187.0)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.jackrabbit.api)(version>=2.6.0)(!(version>=3.0.0)))]
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4368)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2281)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1539)
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
at java.base/java.lang.Thread.run(Thread.java:834)
so I try to add
SlingOptions.versionResolver.setVersion("org.apache.jackrabbit", "oak-jackrabbit-api", "1.12.0");
But it gives this confusing shading error.
[ERROR] org.apache.sling.auth.saml2.impl.SamlHandlerIT Time elapsed: 5.053 s <<< ERROR!
org.ops4j.pax.exam.TestContainerException: [mvn:org.apache.jackrabbit/oak-jackrabbit-api/1.12.0] could not be downloaded
Caused by: java.io.IOException: Error resolving artifact org.apache.jackrabbit:oak-jackrabbit-api:jar:1.12.0: [Could not find artifact org.apache.jackrabbit:oak-jackrabbit-api:jar:1.12.0 in apache-snapshots (https://repository.apache.org/snapshots/), Could not find artifact org.apache.jackrabbit:oak-jackrabbit-api:jar:1.12.0 in central (https://repo1.maven.org/maven2/)]
Caused by: shaded.org.eclipse.aether.resolution.ArtifactResolutionException: Error resolving artifact org.apache.jackrabbit:oak-jackrabbit-api:jar:1.12.0
And I just don't understand why I would have an error relating to org.apache.jackrabbit:oak-jackrabbit-api:jar:1.12.0 when Sling Options <https://github.com/apache/sling-org-apache-sling-testing-paxexam/blob/2bc462ae796f33c4d3099d64ac6af0bd104c083e/src/main/java/org/apache/sling/testing/paxexam/SlingOptions.java#L1059> has functions that setup Jackrabbit Oak.
Any thoughts on this one?
Cris
Re: Pax Help regarding oak-jackrabbit-api
Posted by Julian Reschke <ju...@gmx.de>.
Am 05.03.2021 um 16:24 schrieb Cris Rockwell:
> The hard part about Pax exam testing is getting the project bundle active given the dependency versions provided by the testing instance. I tried patching the test instance maven bundles and versions, but gave up after a certain point.
>
> Instead what I trying is logging the bundles and version
> void logBundles() {
> for (final Bundle bundle : bundleContext.getBundles()) {
> // logs to target/test.log
> logger.info(bundle.getSymbolicName()+":"+bundle.getVersion().toString());
> }
> }
>
> And adjusting my maven pom.xml to allow a range
> <dependency>
> <groupId>org.apache.jackrabbit</groupId>
> <artifactId>oak-auth-external</artifactId>
> <version>[1.12,1.32]</version>
> </dependency>
>
> But now I have this bundle wiring error
>
> ERROR: Bundle org.apache.sling.auth.saml2 [187] Error starting file:/Users/cmrockwe/Documents/a3workspace/sling-whiteboard/saml-handler/target/paxexam/SamlHandlerIT/dbeeda70-55ff-4d85-ba39-c0a117fd83eb/pax-exam-downloads/org.apache.sling.auth.saml2_0.2.0.SNAPSHOT.jar (org.osgi.framework.BundleException: Unable to resolve org.apache.sling.auth.saml2 [187](R 187.0): missing requirement [org.apache.sling.auth.saml2 [187](R 187.0)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.jackrabbit.api)(version>=2.6.0)(!(version>=3.0.0))) Unresolved requirements: [[org.apache.sling.auth.saml2 [187](R 187.0)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.jackrabbit.api)(version>=2.6.0)(!(version>=3.0.0)))])
> org.osgi.framework.BundleException: Unable to resolve org.apache.sling.auth.saml2 [187](R 187.0): missing requirement [org.apache.sling.auth.saml2 [187](R 187.0)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.jackrabbit.api)(version>=2.6.0)(!(version>=3.0.0))) Unresolved requirements: [[org.apache.sling.auth.saml2 [187](R 187.0)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.jackrabbit.api)(version>=2.6.0)(!(version>=3.0.0)))]
> at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4368)
> at org.apache.felix.framework.Felix.startBundle(Felix.java:2281)
> at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1539)
> at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
> at java.base/java.lang.Thread.run(Thread.java:834)
>
>
>
> so I try to add
> SlingOptions.versionResolver.setVersion("org.apache.jackrabbit", "oak-jackrabbit-api", "1.12.0");
>
> But it gives this confusing shading error.
>
> [ERROR] org.apache.sling.auth.saml2.impl.SamlHandlerIT Time elapsed: 5.053 s <<< ERROR!
> org.ops4j.pax.exam.TestContainerException: [mvn:org.apache.jackrabbit/oak-jackrabbit-api/1.12.0] could not be downloaded
> Caused by: java.io.IOException: Error resolving artifact org.apache.jackrabbit:oak-jackrabbit-api:jar:1.12.0: [Could not find artifact org.apache.jackrabbit:oak-jackrabbit-api:jar:1.12.0 in apache-snapshots (https://repository.apache.org/snapshots/), Could not find artifact org.apache.jackrabbit:oak-jackrabbit-api:jar:1.12.0 in central (https://repo1.maven.org/maven2/)]
> Caused by: shaded.org.eclipse.aether.resolution.ArtifactResolutionException: Error resolving artifact org.apache.jackrabbit:oak-jackrabbit-api:jar:1.12.0
>
>
> And I just don't understand why I would have an error relating to org.apache.jackrabbit:oak-jackrabbit-api:jar:1.12.0 when Sling Options <https://github.com/apache/sling-org-apache-sling-testing-paxexam/blob/2bc462ae796f33c4d3099d64ac6af0bd104c083e/src/main/java/org/apache/sling/testing/paxexam/SlingOptions.java#L1059> has functions that setup Jackrabbit Oak.
>
> Any thoughts on this one?
> ...
oak-jackrabbit-api was new as of 1.16.0 (see
<https://issues.apache.org/jira/browse/OAK-8339>).
Best regards, Julian