5 Replies Latest reply on Apr 11, 2003 12:05 AM by chanomie

    Making Scheduler MBean Depend on EAR

    chanomie

      I have an EAR application I'm deploying in jBoss. I also have a Scheduler MBean I'm deploying that makes a class against a Scheduable class inside a JAR inside the EAR.

      It works great when I deploy the EAR and then deploy the Scheduler MBean.

      But when I start up jBoss it deploys the Scheduler MBean first and I get an error because it can't find the class it's trying to execute.

      I know that I can add a tag inside of my Scheduler MBean, but I cannot figure out how to reference the J2EE application that must be deployed first.

      How do I get the proper name of the EAR (or specifically the JAR inside the EAR) that goes in the depends tag?

        • 1. Re: Making Scheduler MBean Depend on EAR
          mallsub

          I have same problem. Did you solve the problem?
          please help.

          • 2. Re: Making Scheduler MBean Depend on EAR
            mcervantes

            Something to consider is packaging the scheduler mbean *within* the ear as a sar. (Coincidentally, I just did this 5 minutes ago.)

            All you have to do is:

            Build a .sar file that includes the schedulable class and a jboss-service.xml file in the META-INF directory. This file can look exactly like scheduler-service.xml.

            Include a jboss-app.xml file in the META-INF of the ear. The format of the file is:

            <jboss-app>
            whatever.sar
            </jboss-app>


            On my system with this setup, Jboss deploys the EJBs before the scheduler service and everything works great.

            • 3. Re: Making Scheduler MBean Depend on EAR
              mlange

              That worked for me too. But there is one disadvantage: you cannot change the scheduler config at runtime.

              • 4. Re: Making Scheduler MBean Depend on EAR
                mallsub

                I created sar file. But still i have problem. I am attaching my jboss
                <?xml version="1.0" encoding="UTF-8"?>
                <!DOCTYPE server>




                <!-- classpath codebase="lib" archives="*" -->

                <depends optional-attribute-name="EJBDEployer">jboss.ejb:service=EJBDeployer





                • 5. Re: Making Scheduler MBean Depend on EAR
                  chanomie

                  All right, I packaged the Scheduler service inside as a .SAR and it works great. The scheduable class is actually still in the main application JAR, but it looks like SAR format is honoring the Class-Path: in the manifest.

                  -jdr