4 Replies Latest reply on Jul 19, 2003 6:35 AM by Otto Fjoesne

    Multiple EARs and pass-by-value

    Otto Fjoesne Newbie

      Jboss version: [3.0.7 (CVSTag=JBoss_3_0_7 Date=200304081816)
      JDK version: 1.4.2
      OS: Win2K

      Background:
      -The Class Loading Architecture of JBoss 3.0.7 and JBoss 3.2
      -Discussion about the JBoss and J2EE Compatibility (http://developer.sys-con.com/viewitem.cfm?thread=7335)
      -I have bought and red most of the JBoss documentation. Good work!

      Problem description:
      I have 2 different EARs: metro2-commons-j2ee.ear and metro2-origo-j2ee.ear. The former contains common classes needed by several other EARs. I have modified the jboss-app.xml in order to scope the classloading for each EAR and tried to configrure JBoss to pass-by-value by configuring jboss.xml/standardjboss.xml.

      However, I still get a ClassCastException exactly when perfoming a lookup from the latter EAR to the former.
      The following files are attached:
      -server.log (TRACE level)
      -ucl.log
      -jboss-app.xml
      -jboss.xml

      (On JBoss 3.2.1 I didn't figure out how to specify pass-by-value due to a change in the jboss.dtd from 3.0.7 to 3.2.1.)

      Question:
      -Is this supposed to work on JBoss 3.0.7/3.2.1/4.0?
      -How is this configured on JBoss 3.x?

      Thanks,
      Otto

        • 1. Re: Multiple EARs and pass-by-value
          Bernd Zeitler Expert

          Example to use the by-value-invoker with JB 3.2
          [pre]
          jboss.xml:
          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE jboss PUBLIC
          "-//JBoss//DTD JBOSS 3.0//EN"
          "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">

          <enterprise-beans>

          <ejb-name>test/Bean1</ejb-name>
          <jndi-name>test/Bean1</jndi-name>
          <configuration-name>Standard Stateless SessionBean</configuration-name>
          <invoker-bindings>

          <invoker-proxy-binding-name>by-value-stateless-rmi-invoker</invoker-proxy-binding-name>

          </invoker-bindings>

          </enterprise-beans>

          <invoker-proxy-bindings>
          <invoker-proxy-binding>
          by-value-stateless-rmi-invoker
          <invoker-mbean>jboss:service=invoker,type=jrmp</invoker-mbean>
          <proxy-factory>org.jboss.proxy.ejb.ProxyFactory</proxy-factory>
          <proxy-factory-config>
          <client-interceptors>

          org.jboss.proxy.ejb.HomeInterceptor
          org.jboss.proxy.SecurityInterceptor
          org.jboss.proxy.TransactionInterceptor
          org.jboss.invocation.ByValueInvokerInterceptor


          org.jboss.proxy.ejb.StatelessSessionInterceptor
          org.jboss.proxy.SecurityInterceptor
          org.jboss.proxy.TransactionInterceptor
          org.jboss.invocation.ByValueInvokerInterceptor

          </client-interceptors>
          </proxy-factory-config>
          </invoker-proxy-binding>
          </invoker-proxy-bindings>


          [/pre]

          Be sure you configured both ears with its own repository and JavaToParentDelegation=false. Be sure every jar has ALL needed resources with it (and the same version of course). If the ears don't share any ressources by reference, you won't ever get a ClassCastException.

          Greetings,
          Frito

          • 2. Re: Multiple EARs and pass-by-value
            Otto Fjoesne Newbie

            Thanks for your quick response!
            Could you please send me an example of your jboss-app.xml too?
            I tried to read jboss-app_3_2.dtd, but I didn't figure out how to set it up.

            Is the by-value-stateless-rmi-invoker a standard JBoss invoker/container setup?

            Otto.

            • 3. Re: Multiple EARs and pass-by-value
              Bernd Zeitler Expert

              You can see an example here:
              http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t= .

              The by-value-invoker is not configured with jboss out of the box. But you can take the example above and deploy it with your beans or write just the same configuration into your standardjboss.xml file in the conf directory. Don't forget to configure the stateful invoker, too, if you need it...

              Greetings,
              Frito

              • 4. Re: Multiple EARs and pass-by-value
                Otto Fjoesne Newbie

                Sorry, I still have the same problem.
                Updated logs are attached:
                -ucl.log
                -server.log
                -jboss-app.xml (for both EARs)
                -jboss.xml (for stateless sessionbean in both EARs)

                Thanks,
                Otto.