8 Replies Latest reply: Oct 24, 2012 11:45 AM by Vikas B RSS

Why is shrinkwrap resolver failing?

Aaron Siri Newbie

I'm using Arquillian 1.0.0.Final to test some CDI/MongoDB code against a maven-installed and managed JBoss 7.1 container.  I'm having problems running the tests and am seeing the following error:

 

May 18, 2012 11:24:21 AM org.jboss.shrinkwrap.resolver.impl.maven.LogTransferListerer transferFailed

WARNING: Failed downloading org/jboss/arquillian/container/arquillian-container-spi/1.0.0.CR7/arquillian-container-spi-1.0.0.CR7.pom from https://dev.hotmetalsoftware.com/nexus/content/groups/public/, reason: org.apache.maven.wagon.authorization.AuthorizationException: Access denied to: https://dev.hotmetalsoftware.com/nexus/content/groups/public/org/jboss/arquillian/container/arquillian-container-spi/1.0.0.CR7/arquillian-container-spi-1.0.0.CR7.pom

 

I'm using Nexus to mirror everything and it requires authentication.  I have the authentication settings properly configured in maven's settings.xml and I've had no problems obtaining dependencies during normal maven execution.  Also, using an exising local repository cache appears to work fine.  But, when I start fresh (i.e. delete/rename .m2/repository) I see the errors above.  Any idea if anything changed in the maven plugin?

 

Any other ideas what could be happening?

 

Thanks,

-Aaron

  • 1. Re: Why is shrinkwrap resolver failing?
    Michal Matloka Newbie

    Have you found an answer for this problem?

  • 2. Re: Why is shrinkwrap resolver failing?
    Andrew Rubinger Master

    Post relevant ShrinkWrap Resolver code?  We do have some authentication tests, but I'd like to ensure our coverage is adequate.

  • 3. Re: Why is shrinkwrap resolver failing?
    davidkatz Newbie

    I am having the same issue. I saw this JIRa issue for encrypted passwords,

     

    https://issues.jboss.org/browse/SHRINKRES-38

     

    ... so also tried with plain text passwords in my settings.xml but still got the AuthorizationException.

     

    Also tried with a test-specific settings.xml with the same effect

    (not clear if this is then used  excluseively or somehow in tandem with the default maven settings.xml, and if yes, which one has precedence. I did notice that even with the test-defined settings.xml, a sytax error int he default settings.xml caused the test to fail....)

     

     

            WebArchive war = ShrinkWrap.create(WebArchive.class, "mytest.war")

                                       .addPackage("org.mycompany.infrastructure")

                                       .addAsResource("log4j.properties")

                                       .addAsWebInfResource(new File("src/main/resources", "WEB-INF/web.xml"))

                                       .addAsWebInfResource(new File("src/main/resources", "WEB-INF/glassfish-web.xml"))

                                       .addAsLibraries(DependencyResolvers.use(MavenDependencyResolver.class)

                                       //.configureFrom("src/test/resources/mvn/settings.xml")

                                                                          .includeDependenciesFromPom("./pom.xml")

                                                                          .scope("compile")

                                                                          // offline required because of

                                                                          // https://issues.jboss.org/browse/SHRINKRES-38

                                                                          // .goOffline()

                                                                          .resolveAsFiles());

     

    Here's the stack trace:

    java.lang.RuntimeException: Could not invoke deployment method: public static org.jboss.shrinkwrap.api.spec.WebArchive org.mycompany.infrastructure.bounceproxy.ChannelServicesTest.createArchiveAndDeploy()

              at org.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator.invoke(AnnotationDeploymentScenarioGenerator.java:160)

              at org.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator.generateDeployment(AnnotationDeploymentScenarioGenerator.java:94)

              at org.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator.generate(AnnotationDeploymentScenarioGenerator.java:57)

              at org.jboss.arquillian.container.test.impl.client.deployment.DeploymentGenerator.generateDeployment(DeploymentGenerator.java:79)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

              at java.lang.reflect.Method.invoke(Unknown Source)

              at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

              at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

              at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

              at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

              at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

              at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)

              at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:100)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

              at java.lang.reflect.Method.invoke(Unknown Source)

              at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

              at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)

              at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)

              at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

              at java.lang.reflect.Method.invoke(Unknown Source)

              at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

              at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

              at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

              at java.lang.reflect.Method.invoke(Unknown Source)

              at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)

              at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)

              at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)

              at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)

              at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:80)

              at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:182)

              at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)

              at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)

              at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)

              at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

              at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)

              at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)

              at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

              at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

              at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

              at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

              at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

    Caused by: java.lang.reflect.InvocationTargetException

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

              at java.lang.reflect.Method.invoke(Unknown Source)

              at org.jboss.arquillian.container.test.impl.client.deployment.AnnotationDeploymentScenarioGenerator.invoke(AnnotationDeploymentScenarioGenerator.java:156)

              ... 50 more

    Caused by: org.jboss.shrinkwrap.resolver.api.ResolutionException: Unable to collect dependeny tree for a resolution

              at org.jboss.shrinkwrap.resolver.impl.maven.MavenBuilderImpl.resolveAsFiles(MavenBuilderImpl.java:371)

              at org.jboss.shrinkwrap.resolver.impl.maven.MavenBuilderImpl.resolveAsFiles(MavenBuilderImpl.java:342)

              ... 55 more

    Caused by: org.sonatype.aether.collection.DependencyCollectionException: Failed to collect dependencies for [org.mycompany.feature:servletcommon:jar:1.0.0-SNAPSHOT (compile), org.mycompany.feature:featurecommon:jar:1.0.0-SNAPSHOT (compile), com.sun.jersey.contribs:jersey-apache-client:jar:1.12 (test), com.sun.jersey:jersey-server:jar:1.12 (compile), org.atmosphere:atmosphere-jersey:jar:1.0.0 (compile), com.fasterxml.jackson.core:jackson-annotations:jar:2.0.5 (compile), eu.infomas:annotation-detector:jar:3.0.0 (compile), javax.mail:mail:jar:1.4 (test), org.jboss.spec:jboss-javaee-6.0:pom:1.0.0.Final (provided), com.jayway.restassured:rest-assured:jar:1.6.2 (test), com.sun.grizzly:grizzly-http:jar:1.9.50 (test), com.sun.grizzly:grizzly-http-servlet:jar:1.9.50 (test), com.sun.grizzly:grizzly-comet:jar:1.9.50 (test), com.sun.grizzly:grizzly-compat:jar:1.9.50 (test), org.jboss.arquillian.junit:arquillian-junit-container:jar:1.0.2.Final (test), org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-impl-maven:jar:1.0.0-beta-7 (test), junit:junit:jar:4.8.2 (test), org.slf4j:slf4j-api:jar:1.6.1 (compile), org.slf4j:slf4j-log4j12:jar:1.6.1 (compile)]

              at org.sonatype.aether.impl.internal.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:251)

              at org.sonatype.aether.impl.internal.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:267)

              at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:314)

              at org.jboss.shrinkwrap.resolver.impl.maven.MavenRepositorySystem.resolveDependencies(MavenRepositorySystem.java:194)

              at org.jboss.shrinkwrap.resolver.impl.maven.MavenBuilderImpl.resolveAsFiles(MavenBuilderImpl.java:367)

              ... 57 more

    Caused by: org.sonatype.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.jboss.shrinkwrap:shrinkwrap-api:jar:1.0.0-cr-1

              at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:275)

              at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:171)

              at org.sonatype.aether.impl.internal.DefaultDependencyCollector.process(DefaultDependencyCollector.java:419)

              at org.sonatype.aether.impl.internal.DefaultDependencyCollector.process(DefaultDependencyCollector.java:515)

              at org.sonatype.aether.impl.internal.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:233)

              ... 61 more

    Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.jboss.shrinkwrap:shrinkwrap-api:pom:1.0.0-cr-1 from/to carit-mirror (http://myserver.com:8081/nexus/content/groups/default): Access denied to: http://myserver.com:8081/nexus/content/groups/default/org/jboss/shrinkwrap/shrinkwrap-api/1.0.0-cr-1/shrinkwrap-api-1.0.0-cr-1.pom

              at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:499)

              at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:187)

              at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:260)

              ... 65 more

    Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not transfer artifact org.jboss.shrinkwrap:shrinkwrap-api:pom:1.0.0-cr-1 from/to carit-mirror (http://myserver.com:8081/nexus/content/groups/default): Access denied to: http://myserver.com:8081/nexus/content/groups/default/org/jboss/shrinkwrap/shrinkwrap-api/1.0.0-cr-1/shrinkwrap-api-1.0.0-cr-1.pom

              at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:934)

              at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:925)

              at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.flush(WagonRepositoryConnector.java:681)

              at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.flush(WagonRepositoryConnector.java:675)

              at org.sonatype.aether.connector.wagon.WagonRepositoryConnector.get(WagonRepositoryConnector.java:420)

              at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:411)

              ... 67 more

    Caused by: org.apache.maven.wagon.authorization.AuthorizationException: Access denied to: http://myserver.com:8081/nexus/content/groups/default/org/jboss/shrinkwrap/shrinkwrap-api/1.0.0-cr-1/shrinkwrap-api-1.0.0-cr-1.pom

              at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:119)

              at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)

              at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)

              at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)

              at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:590)

              at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

              at java.lang.Thread.run(Unknown Source)

  • 4. Re: Why is shrinkwrap resolver failing?
    Andrew Rubinger Master

    Yep, the auth doesn't look like it's going through:

    Caused by: org.apache.maven.wagon.authorization.AuthorizationException: Access denied to: http://myserver.com:8081/nexus/content/groups/default/org/jboss/shrinkwrap/shrinkwrap-api/1.0.0-cr-1/shrinkwrap-api-1.0.0-cr-1.pom

     

    Looking through our test coverage, I'm actually not seeing assertions here as I'd expect:

     

    https://github.com/shrinkwrap/resolver/blob/master/impl-maven/src/test/java/org/jboss/shrinkwrap/resolver/impl/maven/integration/RepositoryAuthTestCase.java

     

    I've opened https://issues.jboss.org/browse/SHRINKRES-69 to correct this and issue an audit.  If you'd like to dig in, let me know and I'll help you get started.

  • 5. Re: Why is shrinkwrap resolver failing?
    Andrew Rubinger Master

    Would you mind having a look here?

     

    https://github.com/ALRubinger/resolver/commit/a1007b4baa6a9eeb46a186e4a4f96de4a2cc772b

     

    Take a look at the noted comments in the test; if you attempt to hit a repo twice, using different auth, in the same JVM, all requests subsequent to the first will retain the initial auth values used.  Sun JDK is caching.

     

    Does this describe your problem?  This is the closest I've gotten so far in 2.0.0-alpha series to duplicating an authentication failure.


    S,
    ALR

     

    Edited to fix link

  • 6. Re: Why is shrinkwrap resolver failing?
    Andrew Rubinger Master

    Note that I've now resolved the issue noted above in:

     

      https://issues.jboss.org/browse/SHRINKRES-69

     

    If this is not your issue (ie. bad caching of auth values), please further explain or supply a test case?

  • 7. Re: Why is shrinkwrap resolver failing?
    Andrew Rubinger Master

    PS - If this *is* indeed your issue, you should be able to kludge fix it temporarily by setting sysprop "maven.wagon.http.preemptiveAuthentication" to true before using SWR.

  • 8. Re: Why is shrinkwrap resolver failing?
    Vikas B Newbie

    System.setProperty("maven.wagon.http.preemptiveAuthentication", "true"); did not work for me