4 Replies Latest reply on Apr 29, 2004 3:00 PM by james.clover

    sorting out

    robin2

      sorry for the second post but somehow my title on the previous one got messed up.

      i think my question really comes down to this: is there a way in jboss or tomcat to configure what "application" scope means, toggling between a situation where separate deployed apps share a common set of "application" scope variables and a situation where each deployed app has it's own distinct set of "application" scope variables?

      -robin

        • 1. Re: sorting out
          robin2

          i must look like an idiot here, but it should be known that this particular message boards app does not accept double quotes as part of a post title - it cuts off the title at the first appearance of the double quotes character.

          -robin

          • 2. Re: sorting out
            raja05

            One solution is to have a Mbean that gets deployed which would store all the properties in a collection and store it in JNDI. You can then lookup this JNDI and get the values. This would be equivalent to a common set of variables.

            For individual applications scope, you can do the same

            • 3. Re: sorting out
              robin2

              it seems the easiest way, would be to just make use of one instance of my DBConnectinPool bean, with an "application" scope. my understanding is that application scope is not something that spans across multiple applications - and yet that is what seems to be happening in my case. is this not so? is "application scope" something that is defined as an instantiation context for anything everything deployed by the servlet container, regardless of which particular .ear file, web space, etc.?

              -robin

              • 4. Re: sorting out
                james.clover

                I think your problem is one of configuring your EARs. JBoss, by default, doesn't give your EAR a separate classloader scope. To do this, you need this in your jboss-app.xml in the META-INF directory of your EAR.

                <?xml version="1.0" encoding="ISO-8859-1"?>
                <jboss-app>
                <loader-repository><some name>:loader=<some name></loader-repository>
                <loader-repository-config>java2ParentDelegation=true</loader-repository-config>
                </jboss-app>
                


                This will give your EAR its own class loader and cause your two applications to be separate.