4 Replies Latest reply on Feb 3, 2006 7:06 AM by ejb3workshop

    Examples

    nholbrook

      Is there an example with separate war accessing ear or ear accessing ear anywhere? I'm still getting class cast exceptions when I do the lookup and cast to the remote interface.

      Here's the setup.

      war
      -- somedomain.jar

      some ear
      -- somedomain.jar
      -- someservices.jar

      other ear
      -- somedomain.jar
      -- otherservices.jar
      -- otherdomain.jar

      The domain.jar contains all the entity beans and the remote interface to the proxy for the services. When I do a lookup inside the main ear, all is well. If I lookup the proxy from the other ear or war, I get ClassCastException. All these are running inside the same jboss. I can access the proxy fine from a standalone client or unit tests. I have changed the settings in the ear-deployer.xml as well as the settings in the jboss-service.xml inside jbossweb/META-INF and nothing seems to be working. I really need to have the wars isolated because if I don't, they seem to be picking up just 1 resource bundle from 1 war and everybody gets it which can cause some problems as you might suspect. Anyway, I plan to add several more wars and ears to this system and I need to get them talking to eachother. I would greatly appreciate any help I can get to figure this out.

      Thanks

      Nic

        • 1. Re: Examples
          bill.burke

          You'll have to isolate JNDI

          look in server/xxx/conf/jboss-service.xml

          look for NamingService

          set attribute CallByValue to true.

          Then you'll have to scope your WARs as defined in our main doco. I have a testcase for this in CVS so I know this works. BTW, you have to communicate through REmote interfaces if you want scoped classloading.

          • 2. Re: Examples
            bill.burke

            FYI, the testcase in cvs is:

            ejb3/src/test/org/jboss/ejb3/test/regression/scopedclassloader

            build-test.xml creates the jars.

            • 3. Re: Examples
              nholbrook

              Thanks for the help. I'll start playing around.

              • 4. Re: Examples
                ejb3workshop

                Have a look at the classpath. You should avoid using the classed / jars from JBOSS_HOME/client.


                Because you patched 4.0.3SP1, the client jars in the jboss-4.0.3SP1/client directory will be invalid. Build your client classpath from:

                1. jboss-4.0.3SP1/lib
                2. jboss-4.0.3SP1/server/all/lib
                3. jboss-4.0.3SP1/server/all/deploy/ejb3.deployer
                4. jboss-4.0.3SP1/server/all/deploy/jboss-aop-jdk50.deployer