8 Replies Latest reply on Jul 22, 2004 2:36 AM by Scott Stark

    loader repository problem

    wtff Newbie

      Specifying a loader-repository for an EAR causes JBoss to throw a ClassCastException.
      (using Jboss 3.2.5, JBoss 3.2.3 behaves the same)

      I have created a very simple "HelloWorld" EAR application containing only one single
      stateless local session bean with one helloWorld method in it.

      This application deploys and runs fine if I do not choose to specify a loader-repository.
      If I do, JBoss throws a ClassCastException from within ITS code.

      I do not have any other applications installed. Below I copied the XML descriptor fragments
      I am using and the StackTrace of the exception.

      I spent hours on investigating application isolation, read documentations over documentations
      and tried to find a sample application demonstrating the use of loader-repositories but
      didn't find any.

      Also, I tried to vary all kinds of things, specifying the loader-repository in both the ear and
      the ejb-jar or only within the ear and so on but nothing helped.


      Can someone provide me with a proof of concept that the loader-repositories actually
      work? Is there something wrong with my descriptors?
      It would be nice if someone knew of a sample application that showcasea how to set up
      an ear with a separate loader-repository (and containing an ejb).


      Thanks


      ---

      application.xml


      <display-name>Test Application</display-name>

      test.jar



      ---
      jboss-app.xml

      <jboss-app>
      <loader-repository>whatever:loader=test</loader-repository>
      </jboss-app>

      ---
      ejb-jar.xml

      <ejb-jar>
      -
      <display-name>Test Component</display-name>
      <enterprise-beans>

      -
      <display-name>Test Component</display-name>
      <ejb-name>Test</ejb-name>
      <local-home>test.TestHome</local-home>
      test.Test
      <ejb-class>test.TestEJB</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>

      </enterprise-beans>
      </ejb-jar>

      ---
      jboss.xml


      <loader-repository>whatever:loader=test</loader-repository>


      ---


      2004-07-14 18:11:22,481 INFO [org.jboss.deployment.EARDeployer] Init J2EE application: file:/blabla/jboss325/server/default/deploy/apps/test3.ear/
      2004-07-14 18:11:22,543 WARN [org.jboss.deployment.DeploymentInfo] Only the root deployment can set the loader repository, ingoring config=LoaderRepositoryConfig(repositoryName: whatever:loader=test, repositoryClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3, configParserClassName: null, repositoryConfig: null)
      2004-07-14 18:11:22,778 INFO [org.jboss.ejb.EjbModule] Deploying Test
      2004-07-14 18:11:22,856 ERROR [org.jboss.ejb.StatelessSessionContainer] Initialization failed jboss.j2ee:jndiName=java%3aejb/Test,service=EJB
      java.lang.ClassCastException
      at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.getEJBLocalHome(BaseLocalProxyFactory.java:210)
      at org.jboss.ejb.Container.createService(Container.java:581)
      at org.jboss.ejb.StatelessSessionContainer.createService(StatelessSessionContainer.java:133)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:237)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:219)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:837)
      at $Proxy17.create(Unknown Source)
      at org.jboss.system.ServiceController.create(ServiceController.java:283)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy43.create(Unknown Source)
      at org.jboss.ejb.EjbModule.createService(EjbModule.java:337)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:237)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:219)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:837)
      at $Proxy17.create(Unknown Source)
      at org.jboss.system.ServiceController.create(ServiceController.java:283)
      at org.jboss.system.ServiceController.create(ServiceController.java:216)
      at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy14.create(Unknown Source)
      at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:549)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:790)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:782)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:644)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:608)
      at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy7.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:304)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:460)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:212)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:191)
      2004-07-14 18:11:22,871 WARN [org.jboss.system.ServiceController] Problem creating service jboss.j2ee:jndiName=java%3aejb/Test,service=EJB
      RuntimeMBeanException: java.lang.ClassCastException

      Cause: java.lang.ClassCastException
      at org.jboss.mx.server.ReflectedDispatcher.handleInvocationExceptions(ReflectedDispatcher.java:82)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:64)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:837)
      at $Proxy17.create(Unknown Source)
      at org.jboss.system.ServiceController.create(ServiceController.java:283)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy43.create(Unknown Source)
      at org.jboss.ejb.EjbModule.createService(EjbModule.java:337)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:237)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:219)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:837)
      at $Proxy17.create(Unknown Source)
      at org.jboss.system.ServiceController.create(ServiceController.java:283)
      at org.jboss.system.ServiceController.create(ServiceController.java:216)
      at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy14.create(Unknown Source)
      at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:549)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:790)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:782)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:644)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:608)
      at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy7.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:304)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:460)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:212)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:191)
      Caused by: java.lang.ClassCastException
      at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.getEJBLocalHome(BaseLocalProxyFactory.java:210)
      at org.jboss.ejb.Container.createService(Container.java:581)
      at org.jboss.ejb.StatelessSessionContainer.createService(StatelessSessionContainer.java:133)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:237)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:219)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      ... 69 more
      2004-07-14 18:11:22,887 INFO [org.jboss.ejb.EJBDeployer] Deployed: file:/blabla/jboss325/server/default/deploy/apps/test3.ear/test.jar/
      2004-07-14 18:11:22,934 INFO [org.jboss.deployment.EARDeployer] Started J2EE application: file:/blabla/jboss325/server/default/deploy/apps/test3.ear/
      2004-07-14 18:13:57,966 INFO [org.jboss.ejb.EJBDeployer] Undeploying: file:/blabla/jboss325/server/default/deploy/apps/test3.ear/test.jar/
      2004-07-14 18:13:57,966 INFO [org.jboss.deployment.EARDeployer] Undeploying J2EE application, destroy step: file:/blabla/jboss325/server/default/deploy/apps/test3.ear/
      2004-07-14 18:13:57,982 WARN [org.jboss.deployment.DeploymentInfo] Could not delete file:/blabla/jboss325/server/default/tmp/deploy/tmp11592j2ee.jar restart will delete it
      2004-07-14 18:13:57,997 INFO [org.jboss.deployment.EARDeployer] Init J2EE application: file:/blabla/jboss325/server/default/deploy/apps/test3.ear/
      2004-07-14 18:13:58,044 WARN [org.jboss.deployment.DeploymentInfo] Only the root deployment can set the loader repository, ingoring config=LoaderRepositoryConfig(repositoryName: whatever:loader=test, repositoryClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3, configParserClassName: null, repositoryConfig: null)
      2004-07-14 18:13:58,247 INFO [org.jboss.ejb.EjbModule] Deploying Test
      2004-07-14 18:13:58,279 ERROR [org.jboss.ejb.StatelessSessionContainer] Initialization failed jboss.j2ee:jndiName=java%3aejb/Test,service=EJB
      java.lang.ClassCastException
      at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.getEJBLocalHome(BaseLocalProxyFactory.java:210)
      at org.jboss.ejb.Container.createService(Container.java:581)
      at org.jboss.ejb.StatelessSessionContainer.createService(StatelessSessionContainer.java:133)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:237)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:219)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:837)
      at $Proxy17.create(Unknown Source)
      at org.jboss.system.ServiceController.create(ServiceController.java:283)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy47.create(Unknown Source)
      at org.jboss.ejb.EjbModule.createService(EjbModule.java:337)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:237)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:219)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:837)
      at $Proxy17.create(Unknown Source)
      at org.jboss.system.ServiceController.create(ServiceController.java:283)
      at org.jboss.system.ServiceController.create(ServiceController.java:216)
      at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy14.create(Unknown Source)
      at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:549)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:790)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:782)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:644)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:608)
      at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy7.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:304)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:460)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:212)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:191)
      2004-07-14 18:13:58,279 WARN [org.jboss.system.ServiceController] Problem creating service jboss.j2ee:jndiName=java%3aejb/Test,service=EJB
      RuntimeMBeanException: java.lang.ClassCastException

      Cause: java.lang.ClassCastException
      at org.jboss.mx.server.ReflectedDispatcher.handleInvocationExceptions(ReflectedDispatcher.java:82)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:64)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:837)
      at $Proxy17.create(Unknown Source)
      at org.jboss.system.ServiceController.create(ServiceController.java:283)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy47.create(Unknown Source)
      at org.jboss.ejb.EjbModule.createService(EjbModule.java:337)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:237)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:219)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:837)
      at $Proxy17.create(Unknown Source)
      at org.jboss.system.ServiceController.create(ServiceController.java:283)
      at org.jboss.system.ServiceController.create(ServiceController.java:216)
      at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy14.create(Unknown Source)
      at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:549)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:790)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:782)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:644)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:608)
      at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
      at $Proxy7.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:304)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:460)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:212)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:191)
      Caused by: java.lang.ClassCastException
      at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.getEJBLocalHome(BaseLocalProxyFactory.java:210)
      at org.jboss.ejb.Container.createService(Container.java:581)
      at org.jboss.ejb.StatelessSessionContainer.createService(StatelessSessionContainer.java:133)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:237)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:219)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
      ... 69 more
      2004-07-14 18:13:58,310 INFO [org.jboss.ejb.EJBDeployer] Deployed: file:/blabla/jboss325/server/default/deploy/apps/test3.ear/test.jar/

      ---

      18:32:52,834 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
      MBeans waiting for other MBeans:
      ObjectName: jboss.j2ee:jndiName=java%3aejb/Test,service=EJB
      state: FAILED
      I Depend On:
      Depends On Me: RuntimeMBeanException: java.lang.ClassCastException
      Cause: java.lang.ClassCastException

      MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM:
      ObjectName: jboss.j2ee:jndiName=java%3aejb/Test,service=EJB
      state: FAILED
      I Depend On:
      Depends On Me: RuntimeMBeanException: java.lang.ClassCastException
      Cause: java.lang.ClassCastException

        • 1. Re: loader repository problem
          wtff Newbie

          the descriptor fragments above are not being display correctly.
          Second try:

          ---
          
           application.xml
          
           <application>
           <display-name>Test Application</display-name>
           <module>
           <ejb>test.jar</ejb>
           </module>
           </application>
          
          ---
           jboss-app.xml
          
           <jboss-app>
           <loader-repository>whatever:loader=test</loader-repository>
           </jboss-app>
          
          ---
           ejb-jar.xml
          
           <ejb-jar>
           <description>-</description>
           <display-name>Test Component</display-name>
           <enterprise-beans>
           <session>
           <description>-</description>
           <display-name>Test Component</display-name>
           <ejb-name>Test</ejb-name>
           <local-home>test.TestHome</local-home>
           <local>test.Test</local>
           <ejb-class>test.TestEJB</ejb-class>
           <session-type>Stateless</session-type>
           <transaction-type>Container</transaction-type>
           </session>
           </enterprise-beans>
           </ejb-jar>
          
          ---
           jboss.xml
          
           <jboss>
           <loader-repository>whatever:loader=test</loader-repository>
           </jboss>
          
          ---


          • 2. Re: loader repository problem
            jae Master

            look at the error message that was thrown w/ the exception.

            you only define the loader-repository tag inside the jboss-app.xml file. you need to remove that entry from the jboss.xml file that is packaged w/ your ejb.

            • 3. Re: loader repository problem
              wtff Newbie

              thanks for your reply, but I tried this as well and it doesn't work either.

              If I leave the jboss file out nothing changes.

              that is what is puzzling me so hard. I've created the smallest possible application which runs perfectly and just by adding the loader-repository fragment to the jboss-app.xml I can make it crash during deployment.

              • 4. Re: loader repository problem
                jae Master

                what is the new error that you get? if you removed the jboss.xml file and you aren't duplicating the load-repository definition anywhere else, i would think you'd also be getting a new error.

                • 5. Re: loader repository problem
                  wtff Newbie

                  well, the warning about only the root deployer being allowed to set the loader-repository goes away, but the error remains. Stack trace looks the same to me, here are the first lines:

                  2004-07-15 12:41:41,498 INFO [org.jboss.deployment.EARDeployer] Init J2EE application: file:/blabla/jboss325/server/default/deploy/apps/test3.ear/
                  2004-07-15 12:41:41,998 INFO [org.jboss.ejb.EjbModule] Deploying Test
                  2004-07-15 12:41:42,217 ERROR [org.jboss.ejb.StatelessSessionContainer] Initialization failed jboss.j2ee:jndiName=java%3aejb/Test,service=EJB
                  java.lang.ClassCastException
                  at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.getEJBLocalHome(BaseLocalProxyFactory.java:210)
                  at org.jboss.ejb.Container.createService(Container.java:581)
                  at org.jboss.ejb.StatelessSessionContainer.createService(StatelessSessionContainer.java:133)
                  at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:237)


                  Let me also mention the following:

                  - if the EAR only contains a war archive and the bean is its own top-level deployment unit, setting a loader-repository within the EAR does not cause the error. However, I would like to have EARs containing EJBs and having their own loader-rep.

                  - on the one hand, what I understand from the (purchased) jboss documentation is that setting the loader-rep within the jboss-app descriptor sets this loader for all subcomponents within this ear. On the other hand the jboss-web and jboss descriptors also allow for the specification of a loader-rep, so I tried to play around with this feature as well.

                  - when I download jboss3.2.5, extract it and start it without having made any modification to it, it would also give me a warning about only root deployers being allowed to set a loader-rep:
                  2004-07-15 12:47:29,643 INFO [org.apache.catalina.startup.Catalina] Server startup in 110 ms
                  2004-07-15 12:47:29,768 WARN [org.jboss.deployment.DeploymentInfo] Only the root deployment can set the loader repository, ingoring config=null
                  2004-07-15 12:47:29,783 INFO [org.jboss.web.tomcat.tc5.TomcatDeployer] deploy, ctxPath=/invoker, warUrl=file:/blabla/jboss325/server/default/deploy/management/http-invoker.sar/invoker.war/

                  - I'm no novice to J2EE. The company I'm working for is using Jboss to run several EARs covering all of J2EE: JMS, JCA, JDBC, all EJB types etc.
                  Now I'm trying to investigate four features that are becoming more and more crucial to us:
                  - we need to be able to isolate the EARs from one another
                  - we need to be able to specify alternative deployment descriptors within
                  the application.ear archive
                  - we need to be able to reload an EJB without having to reload all other deployment units that depend on it.
                  - we would like to be able to deploy several different
                  ejb-implementation-classes for the same ejb-home and
                  ejb-object interface

                  However, I can get NONE of the above usecases to work. No matter how hard or how long I try.

                  I know that the JBoss group offers commercial support. What my team needs whout be to submit detailed descriptions of the above use-cases to a JBoss support agent and get back one simple "hello-world" example application per use-case, showcasing that the JBoss server is actually capable of fullfilling the specified requirements of the respective use-case.

                  • 6. Re: loader repository problem
                    jae Master

                    you should definately read this wiki page: http://www.jboss.org/wiki/Wiki.jsp?page=HotDeployClassCastExceptions

                    some of the information contained w/in will be relevant to you. can you send me the ear you're working w/ (jgangemi at yahoo dot com) and i'll take a look at it locally.

                    also, are you planning on having any of these isolated ears communicate w/ each other?

                    • 7. Re: loader repository problem
                      wtff Newbie

                      Thanks a lot for your support. Meanwhile I figured out the reason for the exception: there was a j2ee.jar somewhere within a subdirectory of my ejb-archive. I thought that jboss would only grap jar files located at the root level directory of a jar or ear...

                      Isolating deployments from one another works well now.

                      Thanks as well for the artical you posted.
                      Yes, I have the need to let several isolated deployments talk to one another.
                      I tested the approach from the artical and it worked, however, I'm not satisfied with the approach proposed there.
                      I would have thought that one could achieve the same with the following packaging structure for the scenario of invoking an EJB in scoped ear A from within a scoped ear B:

                      scoped ear A
                      Implementation class of EJB ONE
                      Interface classes of EJB ONE

                      scoped ear B
                      other EJBs, Wars..
                      Interface classes of EJB ONE

                      However this doesn work.
                      I also tried setting the call-by-value field to true within the EJB jar but it still didn't work.

                      Even with the approach mentioned in the artical, I wonder how this sort of bean communication works in clustered environments?

                      Isn't there a way to configure JBoss to handle Bean invocations without needing to instantiate classes for his own use? The only classes to be shares by applications are the interface classes.
                      If Jboss created Dynamic Proxy classes for all ejb interface classes for all ejbs referenced from ejb-ref or ejb-local ref elements within a scoped ear and then let these proxy classes speak to the bean proxy class registered within the JNDI context, it should be possible to completely prevent classloading issues because the JBoss proxy classes could be made to communicate with another using a loosely coupled serialization mechanism - at least as a special case for cross communication between isolated deployment units.

                      If this cannot be made to work, we would have to switch towards XML communication between different deployment units, but it would be much nicer if this could be done transparently.

                      • 8. Re: loader repository problem
                        Scott Stark Master

                        The call-by-value element was not being read correctly. This is simply a shortcut for specifying the call by value invoker interceptor stack. This example from the testsuite shows the custom call-by-value-jrmp invoker-proxy-binding that serializes calls between components:

                        <?xml version="1.0" encoding="UTF-8"?>
                        
                        <jboss>
                         <enterprise-beans>
                         <session>
                         <ejb-name>CalleeSessionBean</ejb-name>
                         <jndi-name>ejbcts2/CalleeSessionHome</jndi-name>
                         <invoker-bindings>
                         <invoker>
                         <invoker-proxy-binding-name>call-by-value-jrmp</invoker-proxy-binding-name>
                         </invoker>
                         </invoker-bindings>
                         </session>
                         </enterprise-beans>
                        
                         <invoker-proxy-bindings>
                         <invoker-proxy-binding>
                         <name>call-by-value-jrmp</name>
                         <invoker-mbean>jboss:service=invoker,type=jrmp</invoker-mbean>
                         <proxy-factory>org.jboss.proxy.ejb.ProxyFactory</proxy-factory>
                         <proxy-factory-config>
                         <client-interceptors>
                         <home>
                         <interceptor>org.jboss.proxy.ejb.HomeInterceptor</interceptor>
                         <interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>
                         <interceptor>org.jboss.proxy.TransactionInterceptor</interceptor>
                         <interceptor>org.jboss.invocation.ByValueInvokerInterceptor</interceptor>
                         </home>
                         <bean>
                         <interceptor>org.jboss.proxy.ejb.StatelessSessionInterceptor</interceptor>
                         <interceptor>org.jboss.proxy.SecurityInterceptor</interceptor>
                         <interceptor>org.jboss.proxy.TransactionInterceptor</interceptor>
                         <interceptor>org.jboss.invocation.ByValueInvokerInterceptor</interceptor>
                         </bean>
                         </client-interceptors>
                         </proxy-factory-config>
                         </invoker-proxy-binding>
                         </invoker-proxy-bindings>
                        
                        </jboss>