7 Replies Latest reply on Apr 28, 2009 5:53 AM by Jeff Mesnil

    AS 5 profiles must have empty configuration, Java EE example

    Jeff Mesnil Master

      Currently, our Java EE examples relies on JMS resources defined by default in the profile (in jbm-queues.xml + jbm-jms.xml).

      However, we must not provide JMS resources by default in AS 5 profiles.

      I'll remove them from the profiles generated by JBM2 and update the examples so that they provide their own config.
      I'll remove both jbm-queues.xml and jbm-jms.xml.

      E.g. for the MDB example,

      When the example is run (ant run), I copy the configuration required by the example (1 CF + 1 queue) to $JBOSS_HOME/default-with-jbm2/deploy/messaging.sar and I wait 5 seconds to let the deployer deploy the resources.
      Then I run the MDB example.
      Finally, I remove the configurations file I just copied to let the profile in the state it was before.

      I'll update the others examples so they follow the same model.

        • 1. Re: AS 5 profiles must have empty configuration, Java EE exa
          Clebert Suconic Master

          This won't work for the MDB example.

          On the MDB case.. you could have example/deploy installing everything we need... waiting 5 seconds and finally deploying


           on /example/build.xml
           <target name="deploy">
           <copy stuff to /messaging.sar
           <wait 5 or 6 seconds
           <antcall target="do-deploy">
           </target>
          


          • 2. Re: AS 5 profiles must have empty configuration, Java EE exa
            Jeff Mesnil Master

            this does work for the MDB example, I've just checked.

            but you're right, it'd be better to deploy the queues before deploying the MDB.

            • 3. Re: AS 5 profiles must have empty configuration, Java EE exa
              Clebert Suconic Master

              I meant to say.. "it would be better" instead of "it doesn't work"

              We need the destinations deployed before the EAR is installed.

              Also, Just an idea that would be exclusive for JBAS users.

              Why we don't provide the user the possibility of also deploying Beans that will deploy destinations.

              The user would be able to specify a XML like:

               <bean name="DestinationA" class="org.jboss.CreateDestination">
               <constructor>
               <parameter>
               <inject bean="MessaginServer"/>
               </parameter>
               <parameter>Topic
               </parameter>
               <parameter>Destination
               </parameter>
               </bean>



              That would be really easy to do. Even the user could develop its own bean for that... so why not creating a standard way of doing it?

              • 4. Re: AS 5 profiles must have empty configuration, Java EE exa
                Tim Fox Master

                Keep it simple.

                This needs to be completed today.

                • 5. Re: AS 5 profiles must have empty configuration, Java EE exa
                  Clebert Suconic Master

                  For the Beans idea I'm not talking about doing that today.

                  IMO pretty soon users will be asking that kind of thing.


                  If you agree we open a JIRA and do it when we can.

                  • 7. Re: AS 5 profiles must have empty configuration, Java EE exa
                    Jeff Mesnil Master

                    i've updated the Java EE examples so they have their own resources files (jbm-queues.xml, jbm-jms.xml + other specific to the example).

                    I've only one warning in the mdb-remote when I undeploy the resources:

                    5:42:04,022 INFO [JBMResourceAdapter] JBoss Messaging resource adapter stopped
                    15:42:04,050 INFO [ConnectionFactoryBindingService] Unbound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=RemoteJmsXA' from JNDI name 'java:RemoteJmsXA'
                    15:42:04,074 INFO [SessionSpecContainer] Stopping jboss.j2ee:ear=mdb-example.ear,jar=mdb-example.jar,name=StatelessSender,service=EJB3
                    15:42:04,086 INFO [EJBContainer] STOPPED EJB: org.jboss.javaee.example.server.StatelessSender ejbName: StatelessSender
                    15:42:04,162 WARN [JBossMessageEndpointFactory] Endpoint activation failed ra=jboss.jca:service=RARDeployment,name='example-jbm-ra.rar' activationSpec=org.jboss.messaging.ra.inflow.JBMActivationSpec(ra=org.jboss.messaging.ra.JBMResourceAdapter@262428b4 destination=queue/B destinationType=javax.jms.Queue tx=true durable=false user=null maxMessages=1 minSession=1 maxSession=15 keepAlive=60000)
                    javax.management.InstanceNotFoundException: jboss.jca:service=RARDeployment,name='example-jbm-ra.rar' is not registered.
                     at org.jboss.mx.server.registry.BasicMBeanRegistry.get(BasicMBeanRegistry.java:526)
                     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:662)
                     at org.jboss.ejb3.JmxClientKernelAbstraction.invoke(JmxClientKernelAbstraction.java:58)
                     at org.jboss.ejb3.mdb.inflow.JBossMessageEndpointFactory.deactivate(JBossMessageEndpointFactory.java:363)
                     at org.jboss.ejb3.mdb.inflow.JBossMessageEndpointFactory.stop(JBossMessageEndpointFactory.java:221)
                     at org.jboss.ejb3.mdb.MessagingContainer.stopProxies(MessagingContainer.java:338)
                     at org.jboss.ejb3.mdb.MessagingContainer.lockedStop(MessagingContainer.java:326)
                     at org.jboss.ejb3.EJBContainer.stop(EJBContainer.java:923)
                     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:585)
                     at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
                     at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
                     at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
                     at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
                     at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
                     at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)
                     at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)
                     at org.jboss.kernel.plugins.dependency.LifecycleAction.uninstallActionInternal(LifecycleAction.java:249)
                     at org.jboss.kernel.plugins.dependency.InstallsAwareAction.uninstallAction(InstallsAwareAction.java:157)
                     at org.jboss.kernel.plugins.dependency.InstallsAwareAction.uninstallAction(InstallsAwareAction.java:42)
                     at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleUninstallAction(SimpleControllerContextAction.java:79)
                     at org.jboss.dependency.plugins.action.AccessControllerContextAction.uninstall(AccessControllerContextAction.java:131)
                     at org.jboss.dependency.plugins.AbstractControllerContextActions.uninstall(AbstractControllerContextActions.java:58)
                     at org.jboss.dependency.plugins.AbstractControllerContext.uninstall(AbstractControllerContext.java:354)
                     at org.jboss.dependency.plugins.AbstractController.uninstall(AbstractController.java:1664)
                     at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1275)
                     at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1179)
                     at org.jboss.dependency.plugins.AbstractController.uninstall(AbstractController.java:655)
                     at org.jboss.dependency.plugins.AbstractController.uninstall(AbstractController.java:568)
                     at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.undeploy(BeanMetaDataDeployer.java:153)
                     at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.undeploy(BeanMetaDataDeployer.java:51)
                     at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalUndeploy(AbstractSimpleRealDeployer.java:69)
                     at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.undeploy(AbstractRealDeployer.java:112)
                     at org.jboss.deployers.plugins.deployers.DeployerWrapper.undeploy(DeployerWrapper.java:196)
                     at org.jboss.deployers.plugins.deployers.DeployersImpl.doUndeploy(DeployersImpl.java:1469)
                     at org.jboss.deployers.plugins.deployers.DeployersImpl.doUninstallParentLast(DeployersImpl.java:1376)
                     at org.jboss.deployers.plugins.deployers.DeployersImpl.doUninstallParentLast(DeployersImpl.java:1369)
                     at org.jboss.deployers.plugins.deployers.DeployersImpl.doUninstallParentLast(DeployersImpl.java:1356)
                     at org.jboss.deployers.plugins.deployers.DeployersImpl.uninstall(DeployersImpl.java:1331)
                     at org.jboss.dependency.plugins.AbstractControllerContext.uninstall(AbstractControllerContext.java:354)
                     at org.jboss.dependency.plugins.AbstractController.uninstall(AbstractController.java:1664)
                     at org.jboss.dependency.plugins.AbstractController.uninstallContext(AbstractController.java:1275)
                     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:827)
                     at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                     at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:694)
                     at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679)
                     at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
                     at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:338)
                     at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:231)
                     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
                     at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
                     at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
                     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
                     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:142)
                     at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:166)
                     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
                     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
                     at java.lang.Thread.run(Thread.java:613)
                    15:42:04,165 INFO [EJBContainer] STOPPED EJB: org.jboss.javaee.example.server.MDBQueueB ejbName: MDB_QueueB
                    15:42:04,268 INFO [EJBContainer] STOPPED EJB: org.jboss.javaee.example.server.MDBQueueA ejbName: MDB_QueueA
                    


                    I guess I undeploy resources in an incorrect order but I don't know what is wrong.
                    Clebert, if you have some time, could you check the "undeploy" target in mdb-remote/build.xml to see if I've missed something?