10 Replies Latest reply on Dec 10, 2009 8:43 PM by Vicky Kak

    RAR classloading inversion

    André Dantas Rocha Newbie

      Hi all,

      I know that I can use jboss-web.xml in WAR applications and jboss-app.xml in EAR in order to configure classoading.

      But how about RAR files? is that a way to do this?

      Thanks,

      Andre

        • 1. Re: RAR classloading inversion
          Vicky Kak Master

           

          "ad-rocha" wrote:

          But how about RAR files? is that a way to do this?

          There is not direct way to do so for Jboss4.x series but you should be able to do it via jboss-classloading.xml in Jboss5.

          • 2. Re: RAR classloading inversion
            André Dantas Rocha Newbie

            Hi Vicky,

            Thank you for your reply.

            I'm using JBoss 5 :-) Where can I find more details about this approach?

            Regards,

            Andre

            • 3. Re: RAR classloading inversion
              André Dantas Rocha Newbie

              I found some tips here: http://java.dzone.com/articles/jboss-microcontainer-classloading, but I still don't know how to use jboss-classloading.xml in RAR files...

              Any idea?

              Thanks again,

              Andre

              • 4. Re: RAR classloading inversion
                Vicky Kak Master

                 

                "ad-rocha" wrote:
                I found some tips here: http://java.dzone.com/articles/jboss-microcontainer-classloading, but I still don't know how to use jboss-classloading.xml in RAR files...

                Just place the jboss-classloading.xml inside the RAR/META-INF and see if the corresponding classloading domain as defined in the jboss-classloading.xml gets created.
                Also the RAR deployment details via the jmx-console should point to the domain name as specified in the jboss-classloading.xml.

                PS: I have not tried all this, let me know if you don't get things working I will give it a try.

                • 5. Re: RAR classloading inversion
                  Ronald van Kuijk Master

                  Env:
                  - JBoss AS 5.1.0.GA
                  - JDK 1.6.0_12
                  - Windows XP

                  I'm trying to create a rar for the filesystem jca example that I pointed to in my other post The rar gets deployed, but when I try to create a corresponding -service.xml file, I get classloading errors.

                  The error I get is :

                  Caused by: java.lang.ClassNotFoundException: org.jboss.resource.connectionmanager.XATxConnectionManager

                  The logging (on level trace for the classloader) when deploying the fs-service.xml file, the fs-service.xml file itself are given below.

                  It does not make a difference if I deploy this either in 'deploy' or in e.g. 'deploy/fs'.

                  My fs-service.xml file

                  <server>
                   <mbean code="org.jboss.resource.connectionmanager.XATxConnectionManager"
                   name="jboss.jca:service=XATxCM,name=filesystem">
                   <depends>jboss.jca:service=RARDeployer</depends>
                   <depends optional-attribute-name="ManagedConnectionFactoryName">
                   <mbean code="org.jboss.resource.connectionmanager.RARDeployment"
                   name="jboss.jca:service=XATxFS,name=filesystem">
                   <depends optional-attribute-name="OldRarDeployment">
                   jboss.jca:service=RARDeployment,name=jca-filesystem-1.0.0-SNAPSHOT.rar
                   </depends>
                   <attribute name="ManagedConnectionFactoryProperties">
                   <properties>
                   <config-property>
                   <config-property-name>path</config-property-name>
                   <config-property-type>java.lang.String</config-property-type>
                   <config-property-value>/tmp/as/fs_store</config-property-value>
                   </config-property>
                   </properties>
                   </attribute>
                   <attribute name="ManagedConnectionFactoryClass">org.ewe.jca.fs.impl.FsManagedConnectionFactory</attribute>
                   <!--<attribute name="JndiName">TransFS</attribute>-->
                   </mbean>
                   </depends>
                   <depends optional-attribute-name="ManagedConnectionPool">
                   <mbean
                   code="org.jboss.resource.connectionmanager.JBossManagedConnectionPool"
                   name="jboss.jca:service=ManagedConnectionPool,name=filesystem">
                   <attribute name="ManagedConnectionFactoryName">jboss.jca:service=XATxFS,name=filesystem</attribute>
                   <attribute name="MinSize">0</attribute>
                   <attribute name="MaxSize">50</attribute>
                   <attribute name="BlockingTimeoutMillis">5000</attribute>
                   <attribute name="IdleTimeoutMinutes">15</attribute>
                   <attribute name="Criteria">ByContainer</attribute>
                   </mbean>
                   </depends>
                   <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager</depends>
                   <depends optional-attribute-name="JaasSecurityManagerService">jboss.security:service=JaasSecurityManager</depends>
                  </server>
                  


                  Logging on trace level (stacktraces shortend for readbility, do not show any (believe me) usable information)

                  2009-12-09 14:29:54,422 DEBUG [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] (HDScanner) Creating jboss.jca:service=ManagedConnectionPool,name=filesystem
                  2009-12-09 14:29:54,422 DEBUG [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] (HDScanner) Created jboss.jca:service=ManagedConnectionPool,name=filesystem
                  2009-12-09 14:29:54,422 DEBUG [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] (HDScanner) Starting jboss.jca:service=ManagedConnectionPool,name=filesystem
                  2009-12-09 14:29:54,422 DEBUG [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] (HDScanner) Started jboss.jca:service=ManagedConnectionPool,name=filesystem
                  2009-12-09 14:29:54,422 TRACE [org.jboss.classloader.spi.ClassLoaderDomain] (HDScanner) ClassLoaderDomain@9b1670{DefaultDomain} org.jboss.resource.connectionmanager.XATxConnectionManager matches parent beforeFilter=<EVERYTHING>
                  2009-12-09 14:29:54,422 TRACE [org.jboss.classloader.spi.ClassLoaderDomain] (HDScanner) ClassLoaderDomain@9b1670{DefaultDomain} load class from parent org.jboss.resource.connectionmanager.XATxConnectionManager parent=org.jboss.bootstrap.NoAnnotationURLClassLoader@e5855a
                  2009-12-09 14:29:54,422 TRACE [org.jboss.classloader.spi.base.BaseClassLoaderDomain] (HDScanner) ClassLoaderDomain@9b1670{DefaultDomain} findLoader org/jboss/resource/connectionmanager/XATxConnectionManager.class classLoader=BaseClassLoader@168b2b6{vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml} allExports=false findInParent=false
                  2009-12-09 14:29:54,422 TRACE [org.jboss.classloader.spi.base.BaseClassLoaderDomain] (HDScanner) ClassLoaderDomain@9b1670{DefaultDomain} trying to load org/jboss/resource/connectionmanager/XATxConnectionManager.class from all exports of package org.jboss.resource.connectionmanager [VFSClassLoaderPolicy@30e4a7{vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/conf/jboss-service.xml}]
                  2009-12-09 14:29:54,422 TRACE [org.jboss.classloader.spi.filter.FilteredDelegateLoader] (HDScanner) FilteredDelegateLoader@b7195c{delegate=VFSClassLoaderPolicy@30e4a7{vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/conf/jboss-service.xml}} org/jboss/resource/connectionmanager/XATxConnectionManager.class matches resource filter=<EVERYTHING>
                  2009-12-09 14:29:54,422 TRACE [org.jboss.classloader.spi.base.BaseClassLoaderDomain] (HDScanner) ClassLoaderDomain@9b1670{DefaultDomain} not loading org/jboss/resource/connectionmanager/XATxConnectionManager.class from imports it has no delegates
                  2009-12-09 14:29:54,422 TRACE [org.jboss.classloader.spi.base.BaseClassLoaderDomain] (HDScanner) ClassLoaderDomain@9b1670{DefaultDomain} trying to load org/jboss/resource/connectionmanager/XATxConnectionManager.class from requesting BaseClassLoader@168b2b6{vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml}
                  2009-12-09 14:29:54,422 TRACE [org.jboss.classloader.spi.ClassLoaderDomain] (HDScanner) ClassLoaderDomain@9b1670{DefaultDomain} org.jboss.resource.connectionmanager.XATxConnectionManager does NOT match parent afterFilter=<NOTHING>
                  2009-12-09 14:29:54,422 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (HDScanner) Error installing to Instantiated: name=jboss.jca:name=filesystem,service=XATxCM state=Described mode=Manual requiredState=Configured
                  java.lang.ClassNotFoundException: org.jboss.resource.connectionmanager.XATxConnectionManager from BaseClassLoader@168b2b6{VFSClassLoaderPolicy@acee53{name=vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml domain=ClassLoaderDomain@9b1670{name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.bootstrap.NoAnnotationURLClassLoader@e5855a} roots=[MemoryContextHandler@22198957[path= context=vfsmemory://4p72304e-7ssefn-g300k9ql-1-g3050ic6-ap real=vfsmemory://4p72304e-7ssefn-g300k9ql-1-g3050ic6-ap]] delegates=null exported=[] <IMPORT-ALL>NON_EMPTY}}
                   at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:448)
                   at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
                   ...
                   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
                   at java.lang.Thread.run(Thread.java:619)
                  2009-12-09 14:29:54,422 DEBUG [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] (HDScanner) Stopping jboss.jca:service=ManagedConnectionPool,name=filesystem
                  2009-12-09 14:29:54,422 DEBUG [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] (HDScanner) Stopped jboss.jca:service=ManagedConnectionPool,name=filesystem
                  2009-12-09 14:29:54,422 DEBUG [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] (HDScanner) Destroying jboss.jca:service=ManagedConnectionPool,name=filesystem
                  2009-12-09 14:29:54,422 DEBUG [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] (HDScanner) Destroyed jboss.jca:service=ManagedConnectionPool,name=filesystem
                  2009-12-09 14:29:54,423 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (HDScanner) Error installing to Real: name=vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml state=PreReal mode=Manual requiredState=Real
                  org.jboss.deployers.spi.DeploymentException: Error deploying: jboss.jca:service=XATxCM,name=filesystem
                   at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
                   at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:118)
                   ...
                   at java.lang.Thread.run(Thread.java:619)
                  Caused by: java.lang.ClassNotFoundException: org.jboss.resource.connectionmanager.XATxConnectionManager from BaseClassLoader@168b2b6{VFSClassLoaderPolicy@acee53{name=vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml domain=ClassLoaderDomain@9b1670{name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.bootstrap.NoAnnotationURLClassLoader@e5855a} roots=[MemoryContextHandler@22198957[path= context=vfsmemory://4p72304e-7ssefn-g300k9ql-1-g3050ic6-ap real=vfsmemory://4p72304e-7ssefn-g300k9ql-1-g3050ic6-ap]] delegates=null exported=[] <IMPORT-ALL>NON_EMPTY}}
                   at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:448)
                   ...
                   at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:90)
                   ... 29 more
                  2009-12-09 14:29:54,423 DEBUG [org.jboss.classloader.spi.base.BaseClassLoaderDomain] (HDScanner) ClassLoaderDomain@9b1670{DefaultDomain} unregisterClassLoader BaseClassLoader@168b2b6{vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml}
                  2009-12-09 14:29:54,423 DEBUG [org.jboss.classloader.spi.base.BaseClassLoaderPolicy] (HDScanner) VFSClassLoaderPolicy@acee53{vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml} shutdown!
                  2009-12-09 14:29:54,423 DEBUG [org.jboss.classloader.spi.base.BaseClassLoader] (HDScanner) BaseClassLoader@168b2b6{vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml} shutdown!
                  2009-12-09 14:29:54,423 TRACE [org.jboss.resource.deployers.RARParserDeployer] (HDScanner) Undeploying: vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml
                  2009-12-09 14:29:54,423 TRACE [org.jboss.resource.deployers.RARParserDeployer] (HDScanner) Undeployed: vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml
                  2009-12-09 14:29:54,423 TRACE [org.jboss.resource.deployers.ManagedConnectionFactoryParserDeployer] (HDScanner) Undeploying: vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml
                  2009-12-09 14:29:54,423 TRACE [org.jboss.resource.deployers.ManagedConnectionFactoryParserDeployer] (HDScanner) Undeployed: vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml
                  2009-12-09 14:29:54,423 WARN [org.jboss.system.server.profileservice.hotdeploy.HDScanner] (HDScanner) Failed to process changes
                  org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
                  
                  *** DEPLOYMENTS IN ERROR: Name -> Error
                  
                  vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml -> org.jboss.deployers.spi.DeploymentException: Error deploying: jboss.jca:service=XATxCM,name=filesystem
                  
                  
                  DEPLOYMENTS IN ERROR:
                   Deployment "vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml" is in error due to the following reason(s): java.lang.ClassNotFoundException: org.jboss.resource.connectionmanager.XATxConnectionManager from BaseClassLoader@168b2b6{VFSClassLoaderPolicy@acee53{name=vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml domain=ClassLoaderDomain@9b1670{name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.bootstrap.NoAnnotationURLClassLoader@e5855a} roots=[MemoryContextHandler@22198957[path= context=vfsmemory://4p72304e-7ssefn-g300k9ql-1-g3050ic6-ap real=vfsmemory://4p72304e-7ssefn-g300k9ql-1-g3050ic6-ap]] delegates=null exported=[] <IMPORT-ALL>NON_EMPTY}}
                  
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)
                   ...
                   at java.lang.Thread.run(Thread.java:619)
                  
                  


                  Now I also read the DZone article about classloading and tried a jboss-classloading.xml file: (the 'big-ball-o-mud')

                  <classloading xmlns="urn:jboss:classloading:1.0"
                   domain="IsolatedDomain"
                   export-all="NON_EMPTY"
                   import-all="true">
                  </classloading>


                  and put this in META-INF in my RAR file.

                  The Error is the same, but I do see differences in the classloading:

                  2009-12-09 15:31:19,405 DEBUG [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] (HDScanner) Creating jboss.jca:service=ManagedConnectionPool,name=filesystem
                  2009-12-09 15:31:19,405 DEBUG [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] (HDScanner) Created jboss.jca:service=ManagedConnectionPool,name=filesystem
                  2009-12-09 15:31:19,405 DEBUG [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] (HDScanner) Starting jboss.jca:service=ManagedConnectionPool,name=filesystem
                  2009-12-09 15:31:19,406 DEBUG [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] (HDScanner) Started jboss.jca:service=ManagedConnectionPool,name=filesystem
                  2009-12-09 15:31:19,406 TRACE [org.jboss.classloader.spi.base.BaseClassLoader] (HDScanner) BaseClassLoader@1218ac4{vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml} loadClass org.jboss.resource.connectionmanager.XATxConnectionManager resolve=false
                  2009-12-09 15:31:19,406 TRACE [org.jboss.classloader.spi.base.BaseClassLoader] (HDScanner) BaseClassLoader@1218ac4{vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml} aquireLockFairly Thread[HDScanner,5,jboss]
                  2009-12-09 15:31:19,407 TRACE [org.jboss.classloader.spi.base.BaseClassLoader] (HDScanner) BaseClassLoader@1218ac4{vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml} aquiredLock Thread[HDScanner,5,jboss] holding=1
                  2009-12-09 15:31:19,407 TRACE [org.jboss.classloader.spi.base.BaseClassLoader] (HDScanner) BaseClassLoader@1218ac4{vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml} load from domain org.jboss.resource.connectionmanager.XATxConnectionManager domain=ClassLoaderDomain@9b1670{DefaultDomain}
                  2009-12-09 15:31:19,407 TRACE [org.jboss.classloader.spi.ClassLoaderDomain] (HDScanner) ClassLoaderDomain@9b1670{DefaultDomain} org.jboss.resource.connectionmanager.XATxConnectionManager matches parent beforeFilter=<EVERYTHING>
                  2009-12-09 15:31:19,407 TRACE [org.jboss.classloader.spi.ClassLoaderDomain] (HDScanner) ClassLoaderDomain@9b1670{DefaultDomain} load class from parent org.jboss.resource.connectionmanager.XATxConnectionManager parent=org.jboss.bootstrap.NoAnnotationURLClassLoader@e5855a
                  2009-12-09 15:31:19,407 TRACE [org.jboss.classloader.spi.base.BaseClassLoaderDomain] (HDScanner) ClassLoaderDomain@9b1670{DefaultDomain} findLoader org/jboss/resource/connectionmanager/XATxConnectionManager.class classLoader=BaseClassLoader@1218ac4{vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml} allExports=false findInParent=false
                  2009-12-09 15:31:19,407 TRACE [org.jboss.classloader.spi.base.BaseClassLoaderDomain] (HDScanner) ClassLoaderDomain@9b1670{DefaultDomain} trying to load org/jboss/resource/connectionmanager/XATxConnectionManager.class from all exports of package org.jboss.resource.connectionmanager [VFSClassLoaderPolicy@18297fe{vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/conf/jboss-service.xml}]
                  2009-12-09 15:31:19,407 TRACE [org.jboss.classloader.spi.filter.FilteredDelegateLoader] (HDScanner) FilteredDelegateLoader@1c8f644{delegate=VFSClassLoaderPolicy@18297fe{vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/conf/jboss-service.xml}} org/jboss/resource/connectionmanager/XATxConnectionManager.class matches resource filter=<EVERYTHING>
                  2009-12-09 15:31:19,407 TRACE [org.jboss.classloader.spi.base.BaseClassLoader] (HDScanner) BaseClassLoader@165d118{vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/conf/jboss-service.xml} get resource locally org/jboss/resource/connectionmanager/XATxConnectionManager.class
                  2009-12-09 15:31:19,407 TRACE [org.jboss.classloader.spi.base.BaseClassLoader] (HDScanner) BaseClassLoader@165d118{vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/conf/jboss-service.xml} resource is blacklisted org/jboss/resource/connectionmanager/XATxConnectionManager.class
                  2009-12-09 15:31:19,407 TRACE [org.jboss.classloader.spi.base.BaseClassLoaderDomain] (HDScanner) ClassLoaderDomain@9b1670{DefaultDomain} not loading org/jboss/resource/connectionmanager/XATxConnectionManager.class from imports it has no delegates
                  2009-12-09 15:31:19,407 TRACE [org.jboss.classloader.spi.base.BaseClassLoaderDomain] (HDScanner) ClassLoaderDomain@9b1670{DefaultDomain} trying to load org/jboss/resource/connectionmanager/XATxConnectionManager.class from requesting BaseClassLoader@1218ac4{vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml}
                  2009-12-09 15:31:19,407 TRACE [org.jboss.classloader.spi.base.BaseClassLoader] (HDScanner) BaseClassLoader@1218ac4{vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml} get resource locally org/jboss/resource/connectionmanager/XATxConnectionManager.class
                  2009-12-09 15:31:19,407 TRACE [org.jboss.classloader.spi.base.BaseClassLoader] (HDScanner) BaseClassLoader@1218ac4{vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml} resource not found locally org/jboss/resource/connectionmanager/XATxConnectionManager.class
                  2009-12-09 15:31:19,407 TRACE [org.jboss.classloader.spi.ClassLoaderDomain] (HDScanner) ClassLoaderDomain@9b1670{DefaultDomain} org.jboss.resource.connectionmanager.XATxConnectionManager does NOT match parent afterFilter=<NOTHING>
                  2009-12-09 15:31:19,407 TRACE [org.jboss.classloader.spi.base.BaseClassLoader] (HDScanner) BaseClassLoader@1218ac4{vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml} unlock Thread[HDScanner,5,jboss] holding=1
                  2009-12-09 15:31:19,407 TRACE [org.jboss.classloader.spi.base.BaseClassLoader] (HDScanner) BaseClassLoader@1218ac4{vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml} class not found org.jboss.resource.connectionmanager.XATxConnectionManager
                  2009-12-09 15:31:19,407 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (HDScanner) Error installing to Instantiated: name=jboss.jca:name=filesystem,service=XATxCM state=Described mode=Manual requiredState=Configured
                  java.lang.ClassNotFoundException: org.jboss.resource.connectionmanager.XATxConnectionManager from BaseClassLoader@1218ac4{VFSClassLoaderPolicy@11d6415{name=vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml domain=ClassLoaderDomain@9b1670{name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.bootstrap.NoAnnotationURLClassLoader@e5855a} roots=[MemoryContextHandler@9817980[path= context=vfsmemory://a22s4p-872h67-g306fh47-1-g3077hoq-ab real=vfsmemory://a22s4p-872h67-g306fh47-1-g3077hoq-ab]] delegates=null exported=[] <IMPORT-ALL>NON_EMPTY}}
                   at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:448)
                   ...
                   at java.lang.Thread.run(Thread.java:619)
                  2009-12-09 15:31:19,409 DEBUG [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] (HDScanner) Stopping jboss.jca:service=ManagedConnectionPool,name=filesystem
                  2009-12-09 15:31:19,409 DEBUG [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] (HDScanner) Stopped jboss.jca:service=ManagedConnectionPool,name=filesystem
                  2009-12-09 15:31:19,409 DEBUG [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] (HDScanner) Destroying jboss.jca:service=ManagedConnectionPool,name=filesystem
                  2009-12-09 15:31:19,409 DEBUG [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] (HDScanner) Destroyed jboss.jca:service=ManagedConnectionPool,name=filesystem
                  2009-12-09 15:31:19,416 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (HDScanner) Error installing to Real: name=vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml state=PreReal mode=Manual requiredState=Real
                  org.jboss.deployers.spi.DeploymentException: Error deploying: jboss.jca:service=XATxCM,name=filesystem
                   at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
                   ...
                   at java.lang.Thread.run(Thread.java:619)
                  Caused by: java.lang.ClassNotFoundException: org.jboss.resource.connectionmanager.XATxConnectionManager from BaseClassLoader@1218ac4{VFSClassLoaderPolicy@11d6415{name=vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml domain=ClassLoaderDomain@9b1670{name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.bootstrap.NoAnnotationURLClassLoader@e5855a} roots=[MemoryContextHandler@9817980[path= context=vfsmemory://a22s4p-872h67-g306fh47-1-g3077hoq-ab real=vfsmemory://a22s4p-872h67-g306fh47-1-g3077hoq-ab]] delegates=null exported=[] <IMPORT-ALL>NON_EMPTY}}
                   at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:448)
                   ...
                   at org.jboss.system.ServiceController.install(ServiceController.java:274)
                   at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:90)
                   ... 29 more
                  2009-12-09 15:31:19,421 DEBUG [org.jboss.classloader.spi.base.BaseClassLoaderDomain] (HDScanner) ClassLoaderDomain@9b1670{DefaultDomain} unregisterClassLoader BaseClassLoader@1218ac4{vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml}
                  2009-12-09 15:31:19,422 DEBUG [org.jboss.classloader.spi.base.BaseClassLoaderPolicy] (HDScanner) VFSClassLoaderPolicy@11d6415{vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml} shutdown!
                  2009-12-09 15:31:19,422 DEBUG [org.jboss.classloader.spi.base.BaseClassLoader] (HDScanner) BaseClassLoader@1218ac4{vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml} shutdown!
                  2009-12-09 15:31:19,423 WARN [org.jboss.system.server.profileservice.hotdeploy.HDScanner] (HDScanner) Failed to process changes
                  org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
                  
                  *** DEPLOYMENTS IN ERROR: Name -> Error
                  
                  vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml -> org.jboss.deployers.spi.DeploymentException: Error deploying: jboss.jca:service=XATxCM,name=filesystem
                  
                  
                  DEPLOYMENTS IN ERROR:
                   Deployment "vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml" is in error due to the following reason(s): java.lang.ClassNotFoundException: org.jboss.resource.connectionmanager.XATxConnectionManager from BaseClassLoader@1218ac4{VFSClassLoaderPolicy@11d6415{name=vfsfile:/C:/Users/rvkuijk.OFFICE/applicaties/jboss-5.1.0.GA/server/default/deploy/fs-service.xml domain=ClassLoaderDomain@9b1670{name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.bootstrap.NoAnnotationURLClassLoader@e5855a} roots=[MemoryContextHandler@9817980[path= context=vfsmemory://a22s4p-872h67-g306fh47-1-g3077hoq-ab real=vfsmemory://a22s4p-872h67-g306fh47-1-g3077hoq-ab]] delegates=null exported=[] <IMPORT-ALL>NON_EMPTY}}
                  
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)
                   at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)
                   at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873)
                   at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:128)
                   at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:369)
                   at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
                   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
                   at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
                   at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
                   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
                   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
                   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
                   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
                   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
                   at java.lang.Thread.run(Thread.java:619)
                  
                  


                  In both situations it finds the class initally on a 'parent' level, but filters it out ('blacklisted' in te second case). I tried many different configurations of jboss-classloading.xml but without sucess.

                  Does anybody have an idea what I do wrong?

                  • 6. Re: RAR classloading inversion
                    jaikiran pai Master

                     

                    <mbean code="org.jboss.resource.connectionmanager.XATxConnectionManager"
                    

                    java.lang.ClassNotFoundException: org.jboss.resource.connectionmanager.XATxConnectionManager


                    That looks like a genuine CNFE and not related to any classloading configurations. I don't see that class being shipped in the AS. Infact, i see a thread where a user has mentioned that it's not even shipped in AS-4.2.x (actually the LocalTxConnectionManager) http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4063708

                    • 7. Re: RAR classloading inversion
                      Ronald van Kuijk Master

                      Yes, I noticed the relation ;-) In the debug/trace logging, you can see it is found, at least that was my interpretation, in combination with things like 'blacklisted' etc... but that could be 'matching generic filters e.g. org.jboss.* ;-(

                      I read many posts about this subject, but the one you refer to was not one of them, thanks.

                      And I did notice of the JBoss JCA example on the internet was for 4.2 but I saw it in some 5.0 docs as well. It might be that it is indeed just not there (anymore). I'll try to find out, thanks. (LocalTx, NoTx also do not work). Makes me wonder though what the alternative is. Tx? I do want to use 'pooling' in my RAR.

                      Thanks again.

                      • 8. Re: RAR classloading inversion
                        Vicky Kak Master

                         

                        "kukeltje" wrote:

                        Makes me wonder though what the alternative is. Tx? I do want to use 'pooling' in my RAR.


                        In JBoss4.x the xsl deployer creates a set of MBeans which contains the JCA infrastruture MBeans(pooling/tm), the same set of MBeans can be configured explicitly in service( -service.xml file) also.
                        In older version of JBoss somewhere in JBoss3 days the datasource deployment was not done using -ds.xml but by deploying the service i.e -service.xml.
                        The -ds.xml configuration was easier than the -service.xml pattern which would simply contain the mbean definitions.
                        It seems you wanted to deploy the RA with the corresponding -service.xml and not with -ds.xml pattern.
                        You should be able to search the entry as "DEBUG [org.jboss.deployment.XSLSubDeployer] transformed into doc:" in the JBoss4.* , it would contain the generated xml which would be deployed by the service deployer.
                        With JBoss5 there is no xsl transformation and you would not see the same in the server.log.

                        So with JBoss4 you have
                        -ds.xml --xsl transformation--> -service.xml ----> 4 Means per -ds.xml configuration

                        and with JBoss5 you will have
                        -ds.xml ---------------------------------------------------> 4 Means per -ds.xml configuration

                        In Jboss4 the xsl transformation creates the contents of -service.xml which can been seen in server.log e.g

                        DEBUG [org.jboss.deployment.XSLSubDeployer] transformed into doc: <server>
                         <mbean code='org.jboss.resource.connectionmanager.TxConnectionManager' display-name='ConnectionManager for DataSource OracleDS' name='jboss.jca:service=LocalTxCM,name=OracleDS'>
                         <attribute name='TrackConnectionByTx'>true</attribute>
                         <attribute name='LocalTransactions'>true</attribute>
                         <depends optional-attribute-name='ManagedConnectionPool'>


                        You could also deploy the JCA infrastructure via the -service.xml and avoid xsl transformation, but this is difficult to manage and thus the -ds.xmll deployment notion was introduced.

                        With Jboss5 I would not recommend you to deploy the -service.xml and would recommend to write -ds.xml defining the connection factories as explained in the jca docs here
                        http://docs.jboss.org/jbossas/jboss4guide/r5/html/

                        And if you still want to use the -service.xml pattern which was used in Jboss3 days(IIRC) then you should use org.jboss.resource.connectionmanager.TxConnectionManager entry instead of
                        org.jboss.resource.connectionmanager.XATxConnectionManager

                        To have better understanding of what MBean should be in the -service.xml I would recommend you to take a look at the xml getting generated in server.xml from the xsl transformation. You can search for "DEBUG [org.jboss.deployment.XSLSubDeployer] transformed into doc: " in server.log.


                        • 9. Re: RAR classloading inversion
                          Ronald van Kuijk Master

                          Ok this helps... I did know about the transformations of -ds.xml to -service.xml but still was under the impression a basic -service.xml, overridden (where needed) with the generated one.

                          The docs you refer to (and later versions) are what I used. Read them from front to back and reverse, top-left to bottom right and reverse. These are also the docs that mention XATxConnectionManager class, so that is why I still thought it was needed. That confuses a lot, getting refered (not specifically by you, more in general) to use these docs but if the info in it is 'obsolete' (there is a JBoss 5 doc which also still has this chapter)

                          I'll certainly go for the JBoss 5 only solution, but trying the TXConnectionManager first is my quickest win.

                          Thanks again, I'll make sure to blog about this if I get it to work (and I do not see a reason why I wouldn't)

                          • 10. Re: RAR classloading inversion
                            Vicky Kak Master

                             

                            "kukeltje" wrote:

                            The docs you refer to (and later versions) are what I used. Read them from front to back and reverse, top-left to bottom right and reverse. These are also the docs that mention XATxConnectionManager class, so that is why I still thought it was needed. That confuses a lot, getting refered (not specifically by you, more in general) to use these docs but if the info in it is 'obsolete' (there is a JBoss 5 doc which also still has this chapter)

                            Yes I agree that the documents which I had pointed are obsolete, the XATxConnectionManager is no longer used in latest JBoss4.
                            And if this is present in the JBoss5 docs it needs to be corrected there !