6 Replies Latest reply on Apr 12, 2007 10:13 AM by gcompienne

    What libraries are needed to run JBoss MC?

      Hello,

      I have been trying to start JBoss MC using a variant of the bootstrap code as described for MC 1. The code is a little long to post but here is a key extract (although I will post the code if it can help):

      deployer = new BeanXMLDeployer(getKernel());
      KernelDeployment deployment = deployer.deploy(
      new URL("file:///C:/local/MCF Proto/prototypes/phase1/jbossmc2/UBQBootstrap/dist/beans/bootstrap-beans.xml"));

      The "bootstrap-beans.xml" is just a shrink down version of the one used for JBoss 5 (more or less everything removed except the "MainDeployer" bean, see below).

      The idea was to test JBoss MC running with its main core classes and structure. So I built JBoss MC using maven and I tried to run my sample code, putting in the classpath all the JARs generated by the build (except the ones marked" java v1.4", see the list at the bottom).

      But I got the following exception "java.lang.NoClassDefFoundError: org/jboss/aop/proxy/container/AOPProxyFactory".

      So I started to add some of the JARs from JBoss 5 hoping to get it to run. I progressively added the following JARs:

      14/02/2007 19:10 508,873 javassist.jar
      23/02/2007 20:02 1,090,968 jboss-aop-jdk50.jar
      06/03/2007 10:25 170,389 concurrent.jar
      21/03/2006 18:23 361,155 trove.jar
      06/03/2007 10:25 1,203,318 xercesImpl.jar
      07/02/2007 18:31 367,771 jboss-xml-binding.jar

      At this point I got a: java.lang.RuntimeException: org.jboss.xb.binding.JBossXBRuntimeException: Failed to create a new SAX parser at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:100)
      [java] at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:85)
      [java] at org.gc.test.jbossmc.bootstrap.Bootstrap.deploy(Bootstrap.java:427)

      caused by: javax.xml.parsers.ParserConfigurationException: Feature 'http://apache.org/xml/features/xinclude'
      is not recognized.
      [java] at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source)
      [java] at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.(SaxJBossXBParser.java:92)

      And admittedly I am a little at a loss.

      Any help will be welcome.

      Thanks,

      Gilles.

      Original set of JARs (before I started to add some from JBoss 5):
      02/04/2007 16:33 431 archive.jar
      02/04/2007 16:32 12,672 jboss-aop-mc-int-aspects.jar
      02/04/2007 16:32 66,054 jboss-aop-mc-int-impl.jar
      02/04/2007 16:32 126,618 jboss-aop-mc-int-sources.jar
      02/04/2007 16:32 67,694 jboss-aop-mc-int.jar
      02/04/2007 16:25 2,291 jboss-container-classloading-spi.jar
      02/04/2007 16:25 47,633 jboss-container-metadata-spi.jar
      02/04/2007 16:25 32,584 jboss-container-metadata.jar
      02/04/2007 16:24 373,411 jboss-container-sources.jar
      02/04/2007 16:24 271,948 jboss-container-tests.jar
      02/04/2007 16:24 334,165 jboss-container.jar
      02/04/2007 16:26 28,378 jboss-dependency-plugins.jar
      02/04/2007 16:26 32,506 jboss-dependency-sources.jar
      02/04/2007 16:26 8,617 jboss-dependency-spi.jar
      02/04/2007 16:26 30,022 jboss-dependency.jar
      02/04/2007 16:34 142,368 jboss-deployers-metadata.jar
      02/04/2007 16:34 142,368 jboss-deployers-plugins.jar
      02/04/2007 16:34 132,893 jboss-deployers-sources.jar
      02/04/2007 16:34 22,352 jboss-deployers-spi.jar
      02/04/2007 16:34 143,929 jboss-deployers.jar
      02/04/2007 16:29 377,785 jboss-kernel-plugins.jar
      02/04/2007 16:29 557,789 jboss-kernel-sources.jar
      02/04/2007 16:29 327 jboss-kernel-spi.jar
      02/04/2007 16:29 490,842 jboss-kernel-tests.jar
      02/04/2007 16:29 379,450 jboss-kernel.jar
      02/04/2007 16:33 2,375 jboss-managed-api.jar
      02/04/2007 16:33 14,849 jboss-managed-plugins.jar
      02/04/2007 16:33 16,686 jboss-managed-sources.jar
      02/04/2007 16:33 16,285 jboss-managed.jar
      02/04/2007 16:33 29,530 jboss-metatype-sources.jar
      02/04/2007 16:33 27,830 jboss-metatype.jar
      02/04/2007 16:35 101,616 jboss-osgi-int-sources.jar
      02/04/2007 16:35 99,974 jboss-osgi-int.jar
      02/04/2007 16:34 33,227 jboss-spring-int-sources.jar
      02/04/2007 16:34 29,941 jboss-spring-int.jar
      07/02/2007 21:23 419,774 jboss-common-core.jar
      06/03/2007 10:25 428,482 jboss-common.jar
      06/03/2007 10:25 352,668 log4j-1.2.8.jar

      Content of bootstrap-beans.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      
      <!--
       The bootstrap of the server. This should only have the minimum
       needed to bootstrap the mc kernel and profile service.
       $Id:$
      -->
      <deployment xmlns="urn:jboss:bean-deployer:2.0">
      
       <!-- The MainDeployer -->
       <bean name="MainDeployer" class="org.jboss.deployers.plugins.deployment.MainDeployerImpl">
       <property name="structureDeployers">
       <list>
       <!-- A declared structure descriptor deployer -->
       <bean name="DeclaredStructure" class="org.jboss.deployers.plugins.structure.vfs.explicit.DeclaredStructure">
       </bean>
      
       <!-- WAR Structure -->
       <bean name="WARStructure" class="org.jboss.deployers.plugins.structure.vfs.war.WARStructure">
       <property name="webInfLibFilter">
       <!-- We accept all .jar files in WEB-INF/lib -->
       <bean name="WebInfLibFilter" class="org.jboss.virtual.plugins.vfs.helpers.SuffixMatchFilter">
       <constructor><parameter class="java.lang.String">.jar</parameter></constructor>
       </bean>
       </property>
       </bean>
       <!-- JAR Structure -->
       <bean name="JARStructure" class="org.jboss.deployers.plugins.structure.vfs.jar.JARStructure">
       <!-- Unless specified the default list of suffixes is .zip, .ear, .jar, ,.rar, .war, .sar, .har, .aop -->
       <constructor>
       <parameter>
       <set elementClass="java.lang.String">
       <value>.zip</value>
       <value>.ear</value>
       <value>.jar</value>
       <value>.rar</value>
       <value>.war</value>
       <value>.sar</value>
       <value>.har</value>
       <value>.aop</value>
       <value>.deployer</value>
       <value>.beans</value>
       </set>
       </parameter>
       </constructor>
       <property name="candidateStructureVisitorFactory">
       <!-- Any file that is not an ordinary directory is a candidate -->
       <bean name="JARStructureCandidates" class="org.jboss.deployers.plugins.structure.vfs.jar.JARCandidateStructureVisitorFactory">
       <!-- A filter to exclude some obvious non-subdeployments -->
       <property name="filter">
       <bean name="JARFilter" class="org.jboss.virtual.plugins.vfs.helpers.SuffixesExcludeFilter">
       <constructor><parameter>
       <list elementClass="java.lang.String">
       <!-- Exclude class files as subdeployments -->
       <value>.class</value>
       </list>
       </parameter></constructor>
       </bean>
       </property>
       </bean>
       </property>
       </bean>
       <!-- File Structure -->
       <bean name="FileStructure" class="org.jboss.deployers.plugins.structure.vfs.file.FileStructure">
       <!-- Unless specified the default list of suffixes is -service.xml, -beans.xml, -ds.xml, -aop.xml -->
       <constructor>
       <parameter>
       <set elementClass="java.lang.String">
       <value>-service.xml</value>
       <value>-beans.xml</value>
       <value>-ds.xml</value>
       <value>-aop.xml</value>
       </set>
       </parameter>
       </constructor>
       </bean>
       </list>
       </property>
       <property name="deployers">
       <list>
       <!-- POJO Deployment -->
       <bean name="BeanDeployer" class="org.jboss.deployers.plugins.deployers.kernel.BeanDeployer">
       <property name="type">beans</property>
       </bean>
       <bean name="KernelDeploymentDeployer" class="org.jboss.deployers.plugins.deployers.kernel.KernelDeploymentDeployer">
       <property name="type">beans</property>
       </bean>
       <bean name="BeanMetaDataDeployer" class="org.jboss.deployers.plugins.deployers.kernel.BeanMetaDataDeployer">
       <constructor><parameter><inject bean="jboss.kernel:service=Kernel"/></parameter></constructor>
       <property name="type">beans</property>
       </bean>
       </list>
       </property>
       </bean>
      
      </deployment>



        • 1. Re: What libraries are needed to run JBoss MC?

          Note: I am using the JBoss MC 2 from subversion obtained on the 2nd of April 2007 (SVN 61987).

          Gilles.

          • 2. Re: What libraries are needed to run JBoss MC?
            alesj

            What about if you added all 'xml' libs from '[microcontainer_HOME]\thirdparty\apache-xerces\lib'?

            I have these:
            - resolver
            - xml-apis
            - xercesImpl (which I think you also have)

            • 3. Re: What libraries are needed to run JBoss MC?

              The 3rd-party folder seems to have been removed when MC 2 was moved to Maven. So I couldn't directly try your suggestion.

              I just tried with the files coming from the 3rd party folder of jbossmc2_beta3 (the last tagged version before the move to Maven) but to no avail...

              I get the same error...

              • 4. Re: What libraries are needed to run JBoss MC?
                alesj

                Uf, it looks like some weird XML exception.
                So you are able to get 3rd party libs from branch version?
                If you could go through the libs, and see which one's are xml-ish.
                I see there is some jaxb (probably not what we are looking for) and there is some stax-api which looks like xml stuff.

                • 5. Re: What libraries are needed to run JBoss MC?
                  genman

                  I've seen this, it's because of the xercesImpl.jar isn't getting loaded for some reason, and the parser that is doesn't support xinclude...

                  • 6. Re: What libraries are needed to run JBoss MC?

                    Ok, Thanks for your comments, it did help me in finding out what happened.

                    Yes, the xercesImpl.jar isn't properly loaded and the reason was because I launched the application from Ant, and Ant uses its own XML parser, which was conflicting the ones used by JBoss MC.

                    When I manually start it then it works ok (or at least it gets futher ;-) but I will post that onto a different thread unless it appears to be a library problem).

                    I am also thinking I will try and check if I could change the bootstrap classloader code to see if it could isolate itself from any environment it is started from (defining the parent CL as null)...

                    Thanks again for your help.

                    Gilles.