8 Replies Latest reply on Jul 15, 2004 3:02 PM by David

    load-repository to a acheive ear isolation(deployment based

    David Newbie

      I'm attempting to get class isolation by using the hierachical loader repository. My goal is to get unique instances of classes so that each ear can maintain state in static instance variables independent of the other ears. I have two ears, deployed in one JVM. I have tried this with 3.2.3 and 3.2.4RC1

      In my jboss-app.xml I have the following:

      <loader-repository loaderRepositoryClass="org.jboss.mx.loading.HeirachicalLoaderRepository3">
       dave:loader=dave.ear
       <loader-repository-config>
       java2ParentDelegaton=true
       </loader-repository-config>
       </loader-repository>
      


      However I'm getting this error when my ear is deployed:

      2004.05.18 07:27:38.171 EDT WARN [DeploymentInfo] Only the root deployment can set the loader repository, ingoring config=LoaderRepositoryConfig(repositoryName: dave:loader=dave.ear, repositoryClassName: org.jboss.mx.loading.HeirachicalLoaderRepository3, configParserClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3ConfigParser, repositoryConfig: java2ParentDelegaton=true)


      Any idea what I'm doing wrong? The documentation clearly states that this element should be in the jboss-app.xml. Any help would be much appreciated.



        • 1. Re: load-repository to a acheive ear isolation(deployment ba
          Adrian Brock Master

          You can only configure the loader repository in the top level deployment, not
          a nested deployment like an ejb or war inside ear

          • 2. Re: load-repository to a acheive ear isolation(deployment ba
            David Newbie

            Right, thoughat's what the message says, but what is a top level deployment? I thought that an ear qualified as a top level deployment...

            Thanks

            • 3. Re: load-repository to a acheive ear isolation(deployment ba
              Adrian Brock Master

              How do you know the error refers to the ear?
              There is no context in the message you posted and you haven't shown
              surrounding messages.

              JBoss does not think the configuration is against a top level deployment.

              • 4. Re: load-repository to a acheive ear isolation(deployment ba
                David Newbie

                Two things make me think that this error is caused by the ear:
                1) I only get the error when I have the loader-repository specified in the ear
                2) The error messages show up while deploying the ear

                2004.05.18 07:25:07.890 EDT INFO [org.jboss.deployment.MainDeployer] Deployed package: file:/C:/khub/JBossEval/jboss/server/lms1/deploy/deploy.last/
                
                2004.05.18 07:25:07.890 EDT INFO [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/c:/khub/JBossEval/deploy/lms
                
                2004.05.18 07:27:37.953 EDT INFO [org.jboss.deployment.EARDeployer] Init J2EE application: file:/c:/khub/JBossEval/deploy/lms/dave.ear/
                
                2004.05.18 07:27:38.062 EDT INFO [org.jboss.deployment.EARDeployer] Init J2EE application: file:/c:/khub/JBossEval/deploy/lms/dave2.ear/
                
                2004.05.18 07:27:38.140 EDT INFO [org.jboss.deployment.EARDeployer] Init J2EE application: file:/c:/khub/JBossEval/deploy/lms/kauthor.ear/
                
                2004.05.18 07:27:38.171 EDT WARN [org.jboss.deployment.DeploymentInfo] Only the root deployment can set the loader repository, ingoring config=LoaderRepositoryConfig(repositoryName: lmnk:loader=kauthor.ear, repositoryClassName: org.jboss.mx.loading.HeirachicalLoaderRepository3, configParserClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3ConfigParser, repositoryConfig: java2ParentDelegaton=true)
                
                2004.05.18 07:27:38.687 EDT INFO [org.jboss.deployment.EARDeployer] Init J2EE application: file:/c:/khub/JBossEval/deploy/lms/lms.ear/
                
                2004.05.18 07:27:38.750 EDT WARN [org.jboss.deployment.DeploymentInfo] Only the root deployment can set the loader repository, ingoring config=LoaderRepositoryConfig(repositoryName: lmnk:loader=lms.ear, repositoryClassName: org.jboss.mx.loading.HeirachicalLoaderRepository3, configParserClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3ConfigParser, repositoryConfig: java2ParentDelegaton=true)
                
                2004.05.18 07:27:44.734 EDT INFO [STDOUT] May 18, 2004 7:27:44 AM java.util.jar.Attributes read
                
                


                So, the question remains, what qualifies as a top level deployment? Is an ear a top level deployment? The documentation clearly states that this is the appropriate approach to getting scoped classloading.

                Thanks

                • 5. Re: load-repository to a acheive ear isolation(deployment ba
                  David Newbie

                  Just to be clear, this is what I'm attempting to do, from page 71 of JBossBook_322.pdf:

                  To enable an EAR specific loader repository, you need to create a META-INF/jboss-app.xml descriptor as shown in Listing 2-10LISTING 2-10. An example jboss-app.xml descriptor for enabled scoped class loading at the ear level.<jboss-app> <loader-repository>some.dot.com:loader=webtest.ear</loader-repository></jboss-app>The value of the loader-repository element is the JMX ObjectName to assign to the repository created for the EAR. This must be unique and valid JMX ObjectName, but the actual name is not important.

                  In doing this, I get the aforementioned error.

                  • 6. Re: load-repository to a acheive ear isolation(deployment ba
                    Scott Stark Master

                    Some other deployment in the ear is attempting to use its own loader repository scoping. Check the DEBUG level msgs in the server.log to see which one.

                    • 7. Re: load-repository to a acheive ear isolation(deployment ba
                      François Duchatelet Newbie

                      Hi davidmboon

                      I think the problem comes from the fact that you are deploying your ears inside a subdirectory of the deploy directory 'lms'.

                      Did you set the 'RecursiveSearch' attribute of the 'URLDeploymentScanner' mbean to true ?

                      Otherwise, (and that's what looks like) JBoss treat the lms directory as a deployment unit.


                      • 8. Re: load-repository to a acheive ear isolation(deployment ba
                        David Newbie

                        just to follow up, the problem turned out to be that we were missing the trailing slash on our extra deployment url '/'.

                        Thanks