2 Replies Latest reply on Jun 2, 2006 12:02 PM by fkhan

    my-service.xml having access to local ejbs

    fkhan

      My app has muliple MBean services all defined through thier own *-service.xml located at the same level in the deployment as the EAR file. One of the services is a schedulable service that starts a thread outside the EAR and attempts to use a local ejb within the EAR that has only a local interface. I don't want to make the ejb remotely accessible.

      How can I make the ear's local ejb's accessible to this service? ejb-local-ref?

      Alternatively, how can I include all the *-service.xml within my EAR so the services have local access to all the local ejbs?

      -fazle

        • 1. Re: my-service.xml having access to local ejbs
          fkhan

          I have included the the service withing the ear by added a jboss-app.xml to to the META-INF directory. This new jboss-app.xml

          <!DOCTYPE jboss-app PUBLIC "-//JBoss//DTD J2EE Application 1.4//EN"
           "http://www.jboss.org/j2ee/dtd/jboss-app_4_0.dtd">
          <jboss-app>
           <!-- The service element specifies a service archive (SAR) to deploy. -->
           <module>
           <service>ambient.sar</service>
           </module>
          </jboss-app>
          


          I then added to the root of the exploded ear an directory called ambient.sar that only contained one file a jboss-service.xml located in the META-INF subdirectory (ext.ear/ambient.sar/META-INF/jboss-service.xml)

          Now within the jboss-service.xml the previously seperately defined services are defined


          <?xml version="1.0" encoding="UTF-8"?>
          
          <server>
           <mbean code="com.ambientdevices.wine.devicetype.devices.Orb" name="jboss:service=Orb">
           <attribute name="DeviceName">orb</attribute>
           <depends>jboss:service=Naming</depends>
           </mbean>
          
           <mbean code="com.ambientdevices.wine.devicetype.devices.Dashboard" name="jboss:service=Dashboard">
           <attribute name="DeviceName">dashboard</attribute>
           <depends>jboss:service=Naming</depends>
           </mbean>
          
           <mbean code="com.ambientdevices.wine.devicetype.devices.MarketWatcher" name="jboss:service=MarketWatcher">
           <attribute name="DeviceName">marketWatcher</attribute>
           <depends>jboss:service=Naming</depends>
           </mbean>
          
           <mbean code="com.ambientdevices.wine.devicetype.devices.WeatherGlass" name="jboss:service=WeatherGlass">
           <attribute name="DeviceName">weatherGlass</attribute>
           <depends>jboss:service=Naming</depends>
           </mbean>
          
           <mbean code="com.ambientdevices.wine.devicetype.devices.WeatherWizard" name="jboss:service=WeatherWizard">
           <attribute name="DeviceName">weatherWizard</attribute>
           <depends>jboss:service=Naming</depends>
           </mbean>
          
           <mbean code="com.ambientdevices.wine.billing.BillingServer" name="jboss:type=billing,name=Billing">
           <attribute name="JndiName">ambient/billing/BillingServer</attribute>
           <depends>jboss:service=Naming</depends>
           </mbean>
          
           <mbean code="org.jboss.varia.scheduler.Scheduler" name="jboss:service=DailyBillingService">
           <attribute name="StartAtStartup">true</attribute>
           <attribute name="SchedulableMBean">jboss:type=billing,name=Billing</attribute>
           <attribute name="SchedulableMBeanMethod">doDailyBilling()</attribute>
           <attribute name="InitialStartDate">NOW</attribute>
           <attribute name="SchedulePeriod">21600000</attribute>
           <attribute name="InitialRepetitions">1</attribute>
           </mbean>
          
          </server>
          
          


          Now when the schedulable thread executes an error occurs with Spring but that seems like a sperate issue

          • 2. Re: my-service.xml having access to local ejbs
            fkhan

            The above does not actually solve the problem of addressing local ejbs from an Schedulable MBean. Any advice would be apprieciated.