11 Replies Latest reply on Jul 26, 2007 3:59 PM by genman

    Neither 2.0-SNAPSHOT nor 2.0.Beta work with Maven build

    genman

      I'm using Maven to build my project against the JBoss repository.

      Using these dependencies:

      <dependency>
       <groupId>jboss</groupId>
       <artifactId>jboss-container</artifactId>
       <version>2.0.0-SNAPSHOT</version>
       </dependency>
       <dependency>
       <groupId>jboss</groupId>
       <artifactId>jboss-kernel</artifactId>
       <version>2.0.0-SNAPSHOT</version>
       </dependency>
       <dependency>
       <groupId>jboss</groupId>
       <artifactId>jboss-aop-mc-int</artifactId>
       <version>2.0.0-SNAPSHOT</version>
       </dependency>

      and my own -beans.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      
      <deployment xmlns="urn:jboss:bean-deployer:2.0">
      
       <bean name="Simple" class="....SimpleBean">
       <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="test:type=SimpleBean", exposedInterface=....SimpleBeanMBean.class)</annotation>
       </bean>
      
       <bean name="MBeanServer" class="java.lang.Object">
       <constructor factoryClass="javax.management.MBeanServerFactory" factoryMethod="createMBeanServer" />
       </bean>
      
       <bean name="AspectManager" class="org.jboss.aop.AspectManager">
       <constructor factoryClass="org.jboss.aop.AspectManager" factoryMethod="instance" />
       </bean>
      
       <aop:lifecycle-configure xmlns:aop="urn:jboss:aop-beans:1.0" name="DependencyAdvice" class="org.jboss.aop.microcontainer.aspects.jmx.JMXIntroduction"
       classes="@org.jboss.aop.microcontainer.aspects.jmx.JMX">
       <property name="mbeanServer">
       <inject bean="MBeanServer" />
       </property>
       </aop:lifecycle-configure>
      
      
      </deployment>


      causes this:

      2007-07-20 12:17:38,312 ERROR [AbstractKernelController] (main) Error installing to PreInstall: name=Simple state=Not Installed
      java.lang.NoSuchMethodError: javassist.scopedpool.ScopedClassPool.<init>(Ljava/lang/ClassLoader;Ljavassist/ClassPool;Ljavassist/scopedpool/ScopedClassPoolRepository;Z)V
       at org.jboss.aop.classpool.AOPClassPool.<init>(AOPClassPool.java:66)
       at org.jboss.aop.classpool.AOPClassPool.<init>(AOPClassPool.java:56)
       at org.jboss.aop.classpool.AOPClassPoolFactory.create(AOPClassPoolFactory.java:40)
       at javassist.scopedpool.ScopedClassPoolRepositoryImpl.createScopedClassPool(ScopedClassPoolRepositoryImpl.java:99)
       at javassist.scopedpool.ScopedClassPoolRepositoryImpl.registerClassLoader(ScopedClassPoolRepositoryImpl.java:125)
       at javassist.scopedpool.ScopedClassPoolRepositoryImpl.findClassPool(ScopedClassPoolRepositoryImpl.java:106)
      


      For
      <dependency>
       <groupId>jboss</groupId>
       <artifactId>jboss-container</artifactId>
       <version>2.0.0.Beta</version>
       </dependency>
       <dependency>
       <groupId>jboss</groupId>
       <artifactId>jboss-kernel</artifactId>
       <version>2.0.0.Beta</version>
       </dependency>
       <dependency>
       <groupId>jboss</groupId>
       <artifactId>jboss-aop-mc-int</artifactId>
       <version>2.0.0.Beta</version>
       </dependency>


      I get:

      java.lang.Error: org.jboss.xb.binding.JBossXBException: Failed to parse source: file:/C:/src/workspace/jboss-mc-test/target/test-classes/META-INF/jboss-beans.xml@18,61
       at ...jbossmc.DeployTest.testIt(DeployTest.java:33)
       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.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
       at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
       at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
       at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
       at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
       at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
       at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
       at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
       at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
       at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
       at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
       at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
       at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: file:/C:/src/workspace/jboss-mc-test/target/test-classes/META-INF/jboss-beans.xml@18,61
       at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:164)
       at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:133)
       at org.jboss.kernel.plugins.deployment.xml.BasicXMLDeployer.deploy(BasicXMLDeployer.java:135)
       at com.autodesk.lbs.jbossmc.DeployTest.testIt(DeployTest.java:30)
       ... 20 more
      Caused by: org.jboss.xb.binding.JBossXBRuntimeException: {urn:jboss:aop-beans:1.0}lifecycle-configure not found as a child of {urn:jboss:bean-deployer:2.0}deployment
       at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:280)
       at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.startElement(SaxJBossXBParser.java:323)
       at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
       at org.apache.xerces.xinclude.XIncludeHandler.startElement(Unknown Source)
       at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
       at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
       at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
       at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
       at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
       at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
       at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:160)
       ... 23 more
      
      


      ... I'm also seeing a lot of dependencies pulled in for SNAPSHOT which I don't for Beta.

      I do wonder what the heck some of the dependencies are for, for example ant- and webdavlib- ... jboss-profiler, etc.

      Here's the list for my mini-project, which depends on SNAPSHOT-2.0:

      repository\ant\ant\1.6.5\ant-1.6.5.jar
      repository\apache-httpclient\commons-httpclient\2.0.2\commons-httpclient-2.0.2.jar
      repository\apache-log4j\log4j\1.2.8\log4j-1.2.8.jar
      repository\apache-slide\webdavlib\2.0\webdavlib-2.0.jar
      repository\apache-xerces\xercesImpl\2.7.1\xercesImpl-2.7.1.jar
      repository\apache-xerces\xml-apis\2.7.1\xml-apis-2.7.1.jar
      repository\javassist\javassist\3.4.GA\javassist-3.4.GA.jar
      repository\jboss\jboss-aop-mc-int\2.0.0-SNAPSHOT\jboss-aop-mc-int-2.0.0-SNAPSHOT.jar
      repository\jboss\jboss-aop\2.0.0-SNAPSHOT\jboss-aop-2.0.0-SNAPSHOT.jar
      repository\jboss\jboss-common-core\2.0.4.GA\jboss-common-core-2.0.4.GA.jar
      repository\jboss\jboss-common-logging-spi\2.0.4.GA\jboss-common-logging-spi-2.0.4.GA.jar
      repository\jboss\jboss-container\2.0.0-SNAPSHOT\jboss-container-2.0.0-SNAPSHOT.jar
      repository\jboss\jboss-dependency\2.0.0-SNAPSHOT\jboss-dependency-2.0.0-SNAPSHOT.jar
      repository\jboss\jboss-kernel\2.0.0-SNAPSHOT\jboss-kernel-2.0.0-SNAPSHOT.jar
      repository\jboss\jboss-logging-log4j\2.0.2.GA\jboss-logging-log4j-2.0.2.GA.jar
      repository\jboss\jboss-logging-spi\2.0.2.GA\jboss-logging-spi-2.0.2.GA.jar
      repository\jboss\jboss-test\1.0.3.GA\jboss-test-1.0.3.GA.jar
      repository\jboss\jboss-vfs\2.0.4.snapshot\jboss-vfs-2.0.4.snapshot.jar
      repository\jboss\jbossxb\1.0.0-SNAPSHOT\jbossxb-1.0.0-SNAPSHOT.jar
      repository\jboss\profiler\jvmti\jboss-profiler-jvmti\1.0.0.CR5\jboss-profiler-jvmti-1.0.0.CR5.jar
      repository\junit\junit\4.1\junit-4.1.jar
      repository\log4j\log4j\1.2.14\log4j-1.2.14.jar
      repository\org\apache\ant\ant-junit\1.7.0\ant-junit-1.7.0.jar
      repository\org\apache\ant\ant-launcher\1.7.0\ant-launcher-1.7.0.jar
      repository\org\apache\ant\ant\1.7.0\ant-1.7.0.jar
      repository\oswego-concurrent\concurrent\1.3.4\concurrent-1.3.4.jar
      repository\qdox\qdox\1.6\qdox-1.6.jar
      repository\sun-jaf\activation\1.0.2\activation-1.0.2.jar
      repository\trove\trove\1.0.2\trove-1.0.2.jar
      repository\wutka-dtdparser\dtdparser121\1.2.1\dtdparser121-1.2.1.jar
      


        • 1. Re: Neither 2.0-SNAPSHOT nor 2.0.Beta work with Maven build
          genman

          By the way, I cut/pasted the aop:lifecycle-configure from one of the SVN test cases. I figure though, there must be some bug in jbossxb.

          • 2. Re: Neither 2.0-SNAPSHOT nor 2.0.Beta work with Maven build
            genman

            I would suggest making some of those dependencies "optional" or "test" or "provided".

            Beta looks like this:

            repository\apache-httpclient\commons-httpclient\2.0.2\commons-httpclient-2.0.2.jar
            repository\apache-slide\webdavlib\2.0\webdavlib-2.0.jar
            repository\apache-xerces\xercesImpl\2.7.1\xercesImpl-2.7.1.jar
            repository\apache-xerces\xml-apis\2.7.1\xml-apis-2.7.1.jar
            repository\concurrent\concurrent\1.3.4\concurrent-1.3.4.jar
            repository\javassist\javassist\3.4.GA\javassist-3.4.GA.jar
            repository\jboss\jboss-aop-mc-int\2.0.0.Beta\jboss-aop-mc-int-2.0.0.Beta.jar
            repository\jboss\jboss-aop\2.0.0.alpha2\jboss-aop-2.0.0.alpha2.jar
            repository\jboss\jboss-common-core\2.0.2.GA\jboss-common-core-2.0.2.GA.jar
            repository\jboss\jboss-container\2.0.0.Beta\jboss-container-2.0.0.Beta.jar
            repository\jboss\jboss-dependency\2.0.0.Beta\jboss-dependency-2.0.0.Beta.jar
            repository\jboss\jboss-kernel\2.0.0.Beta\jboss-kernel-2.0.0.Beta.jar
            repository\jboss\jboss-logging-spi\2.0.2.GA\jboss-logging-spi-2.0.2.GA.jar
            repository\jboss\jbossxb\1.0.0.CR8\jbossxb-1.0.0.CR8.jar
            repository\oswego-concurrent\concurrent\1.3.4\concurrent-1.3.4.jar
            repository\sun-jaf\activation\1.0.2\activation-1.0.2.jar
            repository\trove\trove\1.0.2\trove-1.0.2.jar
            repository\wutka-dtdparser\dtdparser121\1.2.1\dtdparser121-1.2.1.jar
            


            which isn't quite as long.

            • 3. Re: Neither 2.0-SNAPSHOT nor 2.0.Beta work with Maven build
              genman

              This I fixed specifying a newer Javassist version:

               <dependency>
               <groupId>javassist</groupId>
               <artifactId>javassist</artifactId>
               <version>3.5-SNAPSHOT</version>
               </dependency>
              


              • 4. Re: Neither 2.0-SNAPSHOT nor 2.0.Beta work with Maven build
                alesj

                 

                "genman" wrote:
                This I fixed specifying a newer Javassist version:

                Cool.
                But I think this was changed quite some time ago.

                • 5. Re: Neither 2.0-SNAPSHOT nor 2.0.Beta work with Maven build
                  kconner

                  I believe the current groupId is org.jboss.microcontainer

                  • 6. Re: Neither 2.0-SNAPSHOT nor 2.0.Beta work with Maven build
                    kconner

                    And the current version is 2.0.0-SNAPSHOT

                    • 7. Re: Neither 2.0-SNAPSHOT nor 2.0.Beta work with Maven build
                      genman

                      Kevin, thanks. I went by what I saw at the JBoss repository... looks like I picked up the wrong one.

                      As to the extra dependencies, is there some way to take out:

                      ant\ant\1.6.5\ant-1.6.5.jar
                      apache-httpclient\commons-httpclient\2.0.2\commons-httpclient-2.0.2.jar
                      apache-slide\webdavlib\2.0\webdavlib-2.0.jar
                      jboss\jboss-test\1.0.4-SNAPSHOT\jboss-test-1.0.4-SNAPSHOT.jar
                      jboss\profiler\jvmti\jboss-profiler-jvmti\1.0.0.CR5\jboss-profiler-jvmti-1.0.0.CR5.jar
                      logkit\logkit\1.0.1\logkit-1.0.1.jar
                      org\apache\ant\ant-junit\1.7.0\ant-junit-1.7.0.jar
                      org\apache\ant\ant-launcher\1.7.0\ant-launcher-1.7.0.jar
                      org\apache\ant\ant\1.7.0\ant-1.7.0.jar
                      qdox\qdox\1.6\qdox-1.6.jar
                      sun-jaf\activation\1.0.2\activation-1.0.2.jar
                      


                      Maybe some of these are needed? But the feel like the might have been accidentally slipped in.


                      • 8. Re: Neither 2.0-SNAPSHOT nor 2.0.Beta work with Maven build
                        kconner

                        I think this is really a question for Ales and the others.

                        It may be possible to change their scope to 'provided', depending on how they are used. At least this will remove the transitive dependency.

                        I'll take a look at how they are being used and see what the others think.

                        • 9. Re: Neither 2.0-SNAPSHOT nor 2.0.Beta work with Maven build
                          genman


                          Thanks ... There's some libraries such as junit.jar and jboss-test which are leaking into dependencies as well. It seems these are explicitly added to the kernel:

                          microcontainer/kernel/pom.xml :

                           <dependencyManagement>
                           <dependencies>
                           <dependency>
                           <groupId>jboss</groupId>
                           <artifactId>jboss-test</artifactId>
                           <version>${version.jboss.test}</version>
                           <scope>compile</scope>
                           </dependency>
                           <dependency>
                           <groupId>junit</groupId>
                           <artifactId>junit</artifactId>
                           <version>${version.junit}</version>
                           <scope>compile</scope>
                           </dependency>
                           </dependencies>
                           </dependencyManagement>
                          


                          Changing compile -> test does not work . There's a bunch of test code, I guess base test cases, that's in src/main/java not src/test/java ...

                          • 10. Re: Neither 2.0-SNAPSHOT nor 2.0.Beta work with Maven build

                             


                            Changing compile -> test does not work . There's a bunch of test code, I guess base test cases, that's in src/main/java not src/test/java ...


                            This is deliberate. Both the microcontainer and its aop extension
                            provide unit test support where you use the microcontainer to configure junit tests.

                            This is used by other projects and can be used by users.

                            I've got no intention of restructuring the project in complex ways to fix this
                            (the testsuite also uses that code - naturally).

                            It really needs maven to support some kind of "optional" dependency.
                            The same is also true of other bogus dependencies like javassist, webdav, etc.

                            • 11. Re: Neither 2.0-SNAPSHOT nor 2.0.Beta work with Maven build
                              genman

                              That's fine if you don't want to restructure. I don't see it as "complex", just tedious.

                              Regarding optional dependencies, isn't this feature supported by maven?

                              http://maven.apache.org/guides/introduction/introduction-to-optional-and-excludes-dependencies.html

                              I'm really not familiar with this feature.

                              Of course, setting these packages to optional will break people's code existing, but MC is pre-2.0.