7 Replies Latest reply on Apr 7, 2006 9:13 AM by earniedyke

    Deploying a service AFTER a related jar

    earniedyke

      Greetings,

      I have a jar that contains a number of support classes and several EJBs along with their related interfaces. I need to deploy a scheduled MBean after this jar is deployed as the MBean uses classes in the jar. How can I do this? My .sar is being deployed first, as expected, and it fails because it can't find the home interfaces of one of the EJBs. I have tried adding a depends to the MBean but that does not help.

      Any and all suggestions are welcome!

      Thanks!

      Earnie!

        • 1. Re: Deploying a service AFTER a related jar
          jaikiran
          • 2. Re: Deploying a service AFTER a related jar
            earniedyke

            jaikiran,

            I tried this with the same result. Here is the log error and my jboss-service.xml from my .sar file.

            Any other ideas?

            Earnie!

            Caused by: java.lang.NoClassDefFoundError: com/vrs/enterpriseintegrator/rims/session/interfaces/RIMSTransactionProcessorHome
            at java.lang.Class.getDeclaredConstructors0(Native Method)
            at java.lang.Class.privateGetDeclaredConstructors(Class.java:2328)
            at java.lang.Class.getConstructor0(Class.java:2640)
            at java.lang.Class.getConstructor(Class.java:1629)

            <?xml version="1.0" encoding="UTF-8"?>
            
            <server>
             <mbean code="com.vrs.enterpriseintegrator.mbean.ScheduledRIMSTransactionProcessor"
             name="vrs:service=RIMSTransactionProcessor">
             <depends>jboss.j2ee:module=EnterpriseIntegrator.jar,service=EjbModule</depends>
             </mbean>
            <mbean code="org.jboss.varia.scheduler.SingleScheduleProvider"
             name="jboss:service=HASingleScheduleProvider">
            <!-- <depends>jboss:service=DefaultPartition</depends> -->
             <depends>jboss:service=ScheduleManager</depends>
             <depends>vrs:service=RIMSTransationProcessor</depends>
             <attribute name="HASingleton">false</attribute>
             <attribute name="ScheduleManagerName">jboss:service=ScheduleManager</attribute>
             <attribute name="TargetName">jboss:service=RIMSTransactionProcessor</attribute>
             <attribute name="TargetMethod">
             ;perform( NOTIFICATION, DATE, REPETITIONS, SCHEDULER_NAME, java.lang.String )
             </attribute>
             <attribute name="DateFormat">yyyyMMdd hhmm</attribute>
             <attribute name="StartDate">20060404 1515</attribute>
             <attribute name="Period">10000</attribute>
             <attribute name="Repetitions">10</attribute>
            </mbean>
            </server>
            


            • 3. Re: Deploying a service AFTER a related jar
              jaikiran

              The reason for the :

              java.lang.NoClassDefFoundError: com/vrs/enterpriseintegrator/rims/session/interfaces/RIMSTransactionProcessorHome


              is that the class(es) reffered by com/vrs/enterpriseintegrator/rims/session/interfaces/RIMSTransactionProcessorHome, through its imports or extends statement or through some other means are not present in the classpath. Place these class(es)/jars in the classpath and try it out.


              • 4. Re: Deploying a service AFTER a related jar
                earniedyke

                This is the problem: the classes that this references are in the .jar which hasn't been deployed yet. Should not the DEPENDS prevent this from happening? Or does the DEPENDS only apply to execution of a load .sar?

                Earnie!

                • 5. Re: Deploying a service AFTER a related jar
                  earniedyke

                  Will dropping this .sar in deploy.last directory do what I want?

                  Earnie!

                  • 6. Re: Deploying a service AFTER a related jar
                    starksm64

                    Depends does not work with class loader level dependencies. Dependency is about post object instance create/start/stop/destroy callback synchronization. If you need those classes your service classpath should reference them.

                    jboss5 will introduce type level dependencies that do allow one to depend on a source of a class.

                    You can try the deploy.last trick. I don't remember its details off the top of my head.

                    • 7. Re: Deploying a service AFTER a related jar
                      earniedyke

                      deploy.last was the answer.

                      Thanks for the help!

                      Earnie!