5 Replies Latest reply on Apr 29, 2004 10:31 AM by starksm64

    3.2.3 Only the root deployment can set the loader repository

    guy_rouillier

      Trying to solve a ClassCastException I'm receiving when looking up an MBean from within an MDB, I put both into a SAR. I'm trying to specify the following scope in jboss-service.xml:

      <loader-repository>rodent.masergy.com:loader=rodent.sar</loader-repository>

      At deployment time I'm receiving the subject message. I've searched the paid documentation and these online forums to no avail. What is this telling me, and how do I do this properly? Thanks.

        • 1. Re: 3.2.3 Only the root deployment can set the loader reposi
          starksm64

          Need more info on what the sar looks like and what the exception trace is. This error means a child deployment is trying to set the class loader repository and this is not allowed. Only the top level deployment can specified a scoped class loading model.

          • 2. Re: 3.2.3 Only the root deployment can set the loader reposi
            guy_rouillier

            Scott, thanks as always for your willingness to help. The deployment warning I receive is this:

            [org.jboss.deployment.DeploymentInfo] Only the root deployment can set
            the loader repository, ingoring
            config=LoaderRepositoryConfig(repositoryName:
            rodent.masergy.com:loader=rodent.sar, repositoryClassName:
            org.jboss.mx.loading.HeirarchicalLoaderRepository3,
            configParserClassName: null, repositoryConfig: null)

            My rodent.sar looks like this:

            META-INF/
            META-INF/MANIFEST.MF
            com/
            com/masergy/
            com/masergy/rodent/
            com/masergy/rodent/ejb/
            com/masergy/rodent/ejb/RodentServerMBean.class
            com/masergy/rodent/ejb/DataCollector.class
            com/masergy/rodent/ejb/RumbaInsertRawDataPoolMBean.class
            com/masergy/rodent/ejb/RumbaInsertUpdate5MinSamplePool.class
            com/masergy/rodent/ejb/RodentServer.class
            com/masergy/rodent/ejb/DataCollectorMBean.class
            com/masergy/rodent/ejb/RumbaInsertUpdate5MinSamplePoolMBean.class
            com/masergy/rodent/ejb/RumbaConnectionPool.class
            com/masergy/rodent/ejb/RumbaInsertRawDataPool.class
            com/masergy/rodent/ejb/RumbaConnectionPoolMBean.class
            META-INF/jboss-service.xml
            rodentEJB.jar

            The nested rodentEjb.jar looks like this:

            META-INF/
            META-INF/MANIFEST.MF
            com/
            com/masergy/
            com/masergy/rodent/
            com/masergy/rodent/ejb/
            com/masergy/rodent/ejb/RawStatsMessageReceiverBean.class
            com/masergy/rodent/ejb/RodentBean.class
            com/masergy/rodent/ejb/RodentHome.class
            com/masergy/rodent/ejb/MediationReceiverBean.class
            com/masergy/rodent/ejb/JuniperMediationReceiverBean.class
            com/masergy/rodent/ejb/Rodent.class
            com/masergy/rodent/ejb/TasmanMediationReceiverBean.class
            META-INF/ejb-jar.xml
            META-INF/jboss.xml

            The top of the jboss-service.xml looks like this:

            <loader-repository>rodent.masergy.com:loader=rodent.sar</loader-repository>


            I'm getting the ClassCastException when the MDB TasmanMediationReceiverBean in the rodentEjb.jar file utilizes a class in /data/java/lib/rodentLib.jar that does a lookup on RodentServer.class in the sar. The lookup looks like this:

            rodentServer = (RodentServer) ctx.lookup("com/masergy/rodent/ejb/RodentServer");

            I've verified that the value coming back from the lookup is non-null. The ClassCastException looks like this:
            java.lang.ClassCastException
            at com.masergy.rodent.mediation.MediationFactory.storeUnprocessedRawData(MediationFactory.java:244)
            at com.masergy.rodent.mediation.tasman.MediationFactoryTasman.mediateMessage(MediationFactoryTasman.java:114)
            at com.masergy.rodent.ejb.TasmanMediationReceiverBean.onMessage(TasmanMediationReceiverBean.java:65)
            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.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:460)
            at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
            at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:62)
            at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
            at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:240)
            at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
            at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:90)
            at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
            at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
            at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:374)
            at org.jboss.ejb.Container.invoke(Container.java:700)
            at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:824)
            at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1114)
            at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:256)
            at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:633)
            at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:433)
            at org.jboss.mq.SpySession.run(SpySession.java:298)
            at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)
            at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:727)
            at java.lang.Thread.run(Thread.java:534)

            • 3. Re: 3.2.3 Only the root deployment can set the loader reposi
              guy_rouillier

              Sorry, looks like my message was too long. The top of my SAR looks like this:


              <loader-repository>rodent.masergy.com:loader=rodent.sar</loader-repository>


              I'm getting the ClassCastException when the MDB TasmanMediationReceiverBean utilizes a class in /data/java/lib/rodentLib.jar to lookup the MBean RodentServer in the SAR. The lookup looks like this:

              rodentServer = (RodentServer) ctx.lookup("com/masergy/rodent/ejb/RodentServer");

              I've verified that a non-null object is returned. Here is the exception stack trace:

              java.lang.ClassCastException
              at com.masergy.rodent.mediation.MediationFactory.storeUnprocessedRawData(MediationFactory.java:244)
              at com.masergy.rodent.mediation.tasman.MediationFactoryTasman.mediateMessage(MediationFactoryTasman.java:114)
              at com.masergy.rodent.ejb.TasmanMediationReceiverBean.onMessage(TasmanMediationReceiverBean.java:65)
              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.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:460)
              at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
              at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:62)
              at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
              at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:240)
              at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
              at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:90)
              at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
              at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
              at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:374)
              at org.jboss.ejb.Container.invoke(Container.java:700)
              at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:824)
              at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1114)
              at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:256)
              at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:633)
              at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:433)
              at org.jboss.mq.SpySession.run(SpySession.java:298)
              at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)
              at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:727)
              at java.lang.Thread.run(Thread.java:534)

              • 4. Re: 3.2.3 Only the root deployment can set the loader reposi
                guy_rouillier

                Sorry! I guess the XML I'm posting is truncating the post. The lookup is:

                rodentServer = (RodentServer) ctx.lookup("com/masergy/rodent/ejb/RodentServer");

                I veriified a non-null object is returned. Here is the stack trace:

                java.lang.ClassCastException
                at com.masergy.rodent.mediation.MediationFactory.storeUnprocessedRawData(MediationFactory.java:244)
                at com.masergy.rodent.mediation.tasman.MediationFactoryTasman.mediateMessage(MediationFactoryTasman.java:114)
                at com.masergy.rodent.ejb.TasmanMediationReceiverBean.onMessage(TasmanMediationReceiverBean.java:65)
                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.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:460)
                at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
                at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:62)
                at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
                at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:240)
                at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
                at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:90)
                at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
                at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
                at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:374)
                at org.jboss.ejb.Container.invoke(Container.java:700)
                at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:824)
                at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1114)
                at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:256)
                at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:633)
                at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:433)
                at org.jboss.mq.SpySession.run(SpySession.java:298)
                at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)
                at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:727)
                at java.lang.Thread.run(Thread.java:534)

                Here is the top of the SAR file, with delimiters replaced so it will hopefully post:

                server [loader-repository]rodent.masergy.com:loader=rodent.sar[loader-repository]

                [classpath codebase="file:/data/java/lib/" archives="*"]

                • 5. Re: 3.2.3 Only the root deployment can set the loader reposi
                  starksm64

                  Put your descriptors in [ code ] ... [ /code ] blocks without the spaces between the [ ] and code to preserve them from getting interpretted as html. Even better, if you can create a bug report on sourceforge with an example sar I can look into it.