13 Replies Latest reply on Jan 6, 2011 11:45 AM by nbhatia

    Failure to find javax.activation:activation:jar:1.0.2

    nbhatia

      I am going through the Arquillian Getting Started guide. Running through the first example (section 3.2) is giving me the following error:

       

       

      >mvn test -Pjbossas-remote-6
      [INFO] Scanning for projects...
      [INFO]
      [INFO] ------------------------------------------------------------------------
      [INFO] Building Arquillian Testing Sample 1.0-SNAPSHOT
      [INFO] ------------------------------------------------------------------------
      [WARNING] The POM for woodstox:wstx-asl:jar:3.2.1 is missing, no dependency information available
      [WARNING] The POM for com.sun.xml.messaging.saaj:saaj-impl:jar:1.3.4 is missing, no dependency information available
      [WARNING] The POM for org.jvnet:mimepull:jar:1.4 is missing, no dependency information available
      [WARNING] The POM for org.glassfish.gmbal:gmbal-api-only:jar:3.0.0-b023 is missing, no dependency information available
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 3.907s
      [INFO] Finished at: Sun Nov 07 01:49:53 EST 2010
      [INFO] Final Memory: 40M/530M
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal on project arquillian-sample: Could not resolve dependencies for project org.archfirst.examples:arquillian-sample:war:1.0-SNAPSHOT: The following artifacts could not be resolved: javax.activation:activation:jar:1.0.2: Failure to find javax.activation:activation:jar:1.0.2 in https://repository.jboss.org/nexus/content/groups/public-jboss/ was cached in the local repository.

      >mvn test -Pjbossas-remote-6

      [INFO] Scanning for projects...

      [INFO]

      [INFO] ------------------------------------------------------------------------

      [INFO] Building Arquillian Testing Sample 1.0-SNAPSHOT

      [INFO] ------------------------------------------------------------------------

      [WARNING] The POM for woodstox:wstx-asl:jar:3.2.1 is missing, no dependency information available

      [WARNING] The POM for com.sun.xml.messaging.saaj:saaj-impl:jar:1.3.4 is missing, no dependency information available

      [WARNING] The POM for org.jvnet:mimepull:jar:1.4 is missing, no dependency information available

      [WARNING] The POM for org.glassfish.gmbal:gmbal-api-only:jar:3.0.0-b023 is missing, no dependency information available

      [INFO] ------------------------------------------------------------------------

      [INFO] BUILD FAILURE

      [INFO] ------------------------------------------------------------------------

      [INFO] Total time: 3.907s

      [INFO] Finished at: Sun Nov 07 01:49:53 EST 2010

      [INFO] Final Memory: 40M/530M

      [INFO] ------------------------------------------------------------------------

      [ERROR] Failed to execute goal on project arquillian-sample: Could not resolve dependencies for project org.archfirst.examples:arquillian-sample:war:1.0-SNAPSHOT: The following artifacts could not be resolved: javax.activation:activation:jar:1.0.2: Failure to find javax.activation:activation:jar:1.0.2 in https://repository.jboss.org/nexus/content/groups/public-jboss/ was cached in the local repository.

       

       

      Any idea what the issue might be? The project itself has no dependency on javax.activation:activation:jar:1.0.2, but it shows up as soon as I try to run the Arquillian test.

       

      I am attaching my full Maven project. Try running the test using the command shown above and you should see the error. If you skip the test by running "mvn package -DskipTests", you can build a perfectly working war (it contains one web page that invokes the same TemeratureConverter as the test tries to do).

       

      Please help!

       

      Thanks.

      Naresh

        • 1. Re: Failure to find javax.activation:activation:jar:1.0.2
          aslak

          Odd, try removing the <updatePolicy>never</updatePolicy> on the jboss-public-repository-group repository. Maybe maven refuse to check the repo..

          • 2. Re: Failure to find javax.activation:activation:jar:1.0.2
            jaikiran

            You could also try

             

            mvn -U test -Pjbossas-remote-6

             

            Looks at the message, it seems to be a maven (metadata) caching issue with your local filesystem repo.

            • 3. Re: Failure to find javax.activation:activation:jar:1.0.2
              nbhatia

              Well, based on Aslak's suggestion on another thread, I switched my repository URL to https://repository.jboss.org/nexus/content/groups/public/ (earlier it was public-jboss). Regardless, I checked both repositories and they do not have activation.jar version 1.0.2. The public repository has activation.jar version 1.1 but that does not help in this case. All I can think of is that people must have version 1.0.2 in their local repository, so the issue has gone unnoticed. Thoughts?

               

              P.S. I also tried "mvn -U test -Pjbossas-remote-6" but that does not help.

              • 4. Re: Failure to find javax.activation:activation:jar:1.0.2
                aslak

                hmm.. repo1.maven.org has the metadata for it, but no the jar.

                 

                http://repo1.maven.org/maven2/javax/activation/activation/1.0.2/

                 

                Can you do a mvn test dependency:tree to see who is pulling it in?

                • 5. Re: Failure to find javax.activation:activation:jar:1.0.2
                  nbhatia

                  1) mvn test dependency:tree does not work - it tries to run the tests and fails without showing the dependency tree

                   

                  2) mvn dependency:tree runs but does not pull in jbossas-remote-6 dependencies:

                   

                  [INFO] org.archfirst.examples:arquillian-sample:war:1.0-SNAPSHOT
                  [INFO] +- javax:javaee-api:jar:6.0:provided
                  [INFO] +- org.testng:testng:jar:5.12.1:test
                  [INFO] |  \- junit:junit:jar:3.8.1:test
                  [INFO] \- org.jboss.arquillian:arquillian-testng:jar:1.0.0.Alpha4:test
                  [INFO]    +- org.jboss.arquillian:arquillian-impl-base:jar:1.0.0.Alpha4:test
                  [INFO]    |  +- org.jboss.arquillian:arquillian-api:jar:1.0.0.Alpha4:test
                  [INFO]    |  |  \- org.jboss.shrinkwrap:shrinkwrap-api:jar:1.0.0-alpha-11:test
                  [INFO]    |  +- org.jboss.arquillian:arquillian-spi:jar:1.0.0.Alpha4:test
                  [INFO]    |  +- org.jboss.shrinkwrap:shrinkwrap-impl-base:jar:1.0.0-alpha-11:test
                  [INFO]    |  \- org.jboss.shrinkwrap:shrinkwrap-spi:jar:1.0.0-alpha-11:test
                  [INFO]    \- ant:ant:jar:1.6.5:test

                  [INFO] org.archfirst.examples:arquillian-sample:war:1.0-SNAPSHOT

                  [INFO] +- javax:javaee-api:jar:6.0:provided

                  [INFO] +- org.testng:testng:jar:5.12.1:test

                  [INFO] |  \- junit:junit:jar:3.8.1:test

                  [INFO] \- org.jboss.arquillian:arquillian-testng:jar:1.0.0.Alpha4:test

                  [INFO]    +- org.jboss.arquillian:arquillian-impl-base:jar:1.0.0.Alpha4:test

                  [INFO]    |  +- org.jboss.arquillian:arquillian-api:jar:1.0.0.Alpha4:test

                  [INFO]    |  |  \- org.jboss.shrinkwrap:shrinkwrap-api:jar:1.0.0-alpha-11:test

                  [INFO]    |  +- org.jboss.arquillian:arquillian-spi:jar:1.0.0.Alpha4:test

                  [INFO]    |  +- org.jboss.shrinkwrap:shrinkwrap-impl-base:jar:1.0.0-alpha-11:test

                  [INFO]    |  \- org.jboss.shrinkwrap:shrinkwrap-spi:jar:1.0.0-alpha-11:test

                  [INFO]    \- ant:ant:jar:1.6.5:test

                   

                  3) mvn -Pjbossas-remote-6 dependency:tree does not run, it fails because it is still trying to grab javax.activation:activation:jar:1.0.2:

                   

                  [ERROR] Failed to execute goal on project arquillian-sample: Could not resolve dependencies for project org.archfirst.examples:arquillian-sample:war:1.0-SNAPSHOT: The following artifacts could not be resolved: javax.activation:activation:jar:1.0.2: Could not find artifact javax.activation:activation:jar:1.0.2 in jboss-public-repository-group (https://repository.jboss.org/nexus/content/groups/public/, releases=true, snapshots=true, managed=false)

                   

                  I am going to try to break javax:javaee-api:jar:6.0:provided into only the required components in case that helps to break the dependency. Any other ideas?

                  • 6. Re: Failure to find javax.activation:activation:jar:1.0.2
                    aslak
                    • 7. Re: Failure to find javax.activation:activation:jar:1.0.2
                      nbhatia

                      Thanks. I have restructured my pom according to the arquillian examples.

                       

                      1) With jbossas-remote-6, I am still getting javax.activation:activation:jar:1.0.2 not found

                       

                      2) With arquillian-glassfish-embedded-3, I am getting ClassNotFoundException:

                       

                      Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory
                              at java.lang.ClassLoader.findClass(ClassLoader.java:359)
                              at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
                              at com.sun.enterprise.v3.server.APIClassLoaderServiceImpl$APIClassLoader.loadClass(APIClassLoaderServiceImpl.java:173)
                              at com.sun.enterprise.v3.server.APIClassLoaderServiceImpl$APIClassLoader.loadClass(APIClassLoaderServiceImpl.java:149)
                              at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
                              at java.lang.Class.forName0(Native Method)
                              at java.lang.Class.forName(Class.java:247)
                              at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:46)
                              at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
                              ... 66 more

                      Caused by: java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory

                              at java.lang.ClassLoader.findClass(ClassLoader.java:359)

                              at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

                              at com.sun.enterprise.v3.server.APIClassLoaderServiceImpl$APIClassLoader.loadClass(APIClassLoaderServiceImpl.java:173)

                              at com.sun.enterprise.v3.server.APIClassLoaderServiceImpl$APIClassLoader.loadClass(APIClassLoaderServiceImpl.java:149)

                              at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

                              at java.lang.Class.forName0(Native Method)

                              at java.lang.Class.forName(Class.java:247)

                              at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:46)

                              at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)

                              ... 66 more

                       

                      I can't figure out what is really different in my project that is causing it to fail in both these profiles (in different ways).

                       

                      I am attaching my complete Maven project to my original post. Could you please tell me if I am doing anything weird.

                       

                      Thanks.

                      Naresh

                      • 8. Re: Failure to find javax.activation:activation:jar:1.0.2
                        aslak

                        The glassfish embedded error comes because you have the jboss jndi.properties file on classpath when running.. JNDi will then use this file which is configured for jboss and fails..

                        • 9. Re: Failure to find javax.activation:activation:jar:1.0.2
                          nbhatia

                          Thanks. I just figured it out myself. Looking at the arquillian examples, the jndi properties are sitting under jboss-resources and not under plain old resources. I have restructured my pom to take that into account. Now the glassfish-embedded test works, phew! (jboss-remote still has the same problem). I will update my maven project in the original post shortly for the benefit of future "Getting Started" users.

                           

                          Looking back at my experience, I must say that getting started was not as simple as writing a unit test (as suggested in the "Getting Started" section). The nuances of the different containers has caused a lot of grief for me. My recommendation would be to make that section very concrete to one container (my preference would be an embedded container) and providing a fully working standalone project for it - this would keep the pom very simple and understandable for the newbie. The current pom in the examples directory is too long and it is very difficult to appreciate what it is trying to do.

                           

                          Having said that, I very much understand the value Arquillian is bringing to the table and highly appreciate your efforts.

                           

                          Thanks.

                          Naresh

                          • 10. Re: Failure to find javax.activation:activation:jar:1.0.2
                            lazo

                            I had the same problem. Repalcing jboss AS version 6.0.0.20100721-M4 with 6.0.0.20101110-CR1 problem with missing activation:jar:1.0.2 is resolved.

                            • 11. Re: Failure to find javax.activation:activation:jar:1.0.2
                              nbhatia

                              Still no luck. I switched to 6.0.0.Final but that still doesn't work. It is failing at build time, so I don't think JBoss version matters. I have my maven project checked in at http://archfirst.googlecode.com/svn/trunk/java/examples/arquillian-sample if you want to give it a try.

                               

                              This is the error I am getting:

                               

                              [ERROR] Failed to execute goal on project arquillian-sample: Could not resolve dependencies for project org.archfirst.examples:arquillian-sample:war:1.0-SNAPSHOT: Could not find artifact javax.activation:activation:jar:1.0.2 in jboss-public-repository-group (https://repository.jboss.org/nexus/content/groups/public/) -> [Help 1]

                               

                              I browse to the jboss repository mentioned above and there is no  activation:jar:1.0.2 there. Do you have this jar in your local maven repo? Are you using some other maven repository to get it?

                              • 12. Re: Failure to find javax.activation:activation:jar:1.0.2
                                aslak

                                The jboss deprecated repo has it:

                                 

                                https://repository.jboss.org/nexus/content/repositories/deprecated/javax/activation/activation/1.0.2/

                                 

                                Could you do a "mvn dependency:tree" to see who pulls it in?

                                • 13. Re: Failure to find javax.activation:activation:jar:1.0.2
                                  nbhatia

                                  Thanks Aslak. I added the deprecated repository and then ran "mvn dependency:tree". I found that activation:jar:1.0.2 was being pulled in by org.jboss.jbossas:jboss-as-client. Then I realized that I was using version 6.0.0.20100721-M4 of the jboss-as-client in my pom. (That was the latest version of the client when I was building the example back in November!) Sorry Matej, I did not connect the dots when I read your comment - I upgraded my version of jboss-as instead of changing the dependency in the POM.

                                   

                                  Anyway, switching to version 6.0.0.Final fixed the problem. The strange thing is that it is still pulling in activation:jar:1.0.2 (this time from from http://repo1.maven.org/maven2). I did a "mvn dependency:tree" but that is showing a dependency only on activation:jar:1.1. I don't understand why maven is still pulling in version 1.0.2! In any case the problem is now solved.

                                   

                                  Aslak and Matez, thanks again for your help.

                                   

                                  Naresh