0 Replies Latest reply on Feb 27, 2006 12:07 PM by Jens Toerber

    JBoss scoped clasloading, 2 separate ear's each with a war p

    Jens Toerber Newbie

      we are using jboss4.03sp1
      our ear-deployer.xml-snippet

      <!-- EAR deployer, remove if you are not using ear deployments -->

      <!-- A flag indicating if ear deployments should have their own scoped
      class loader to isolate their classes from other deployments.
      <!-- A flag indicating if the ear components should have in VM call
      optimization disabled.

      <mbean code="org.jboss.naming.NamingService"
      <!-- The call by value mode. true if all lookups are unmarshalled using
      the caller's TCL, false if in VM lookups return the value by reference.
      <!-- The listening port for the bootstrap JNP service. Set this to -1
      to run the NamingService without the JNP invoker listening port.

      we have earA and earB with warA in earA and warB in earB.
      In warA we have a classA who loads a classB from a jar from a web url (http://host/warB/jarfile.jar) from web application warB via an URLClassloader.
      This works fine, but:
      In classB we are trying to access an EJB from earB. earA and earB and therefore warA and warB are all in the same JBoss-Container.
      The remote interfaces are also loaded from the warB-URL.

      first problem: we now need a rmisecuritymanager and a policy-file
      ok, we now we use RMISecurityManager if System.getSecurityManager() is null and a policy-file with grant AllPermissions. This works, but we are unhappy about it

      second problem: we are not able to make a lookup to the home-Interface of the ejb because of ejb-remote-home-class not found exception during call of lookup(...).
      we tried to set the codebase to the warB-url which failed, we added jbossall-client.jar to the URLClassloader which failed.
      so in the warB-Url there is:
      ejb-remote-interface, jbossall-client.jar and we use a URLClassloader to load classB and which also gets the ejb- and jboss-jars.
      We can load the home-interface by loadClass(...).

      so we guess it is a rmi stub or something like that problem.

      Any hint would help us.

      Thanks in advance.