3 Replies Latest reply on Jun 7, 2012 11:50 AM by madchedar0

    SAR depending on datasource using jboss-service.xml

    Noa Drach Novice

      Hello,

       

      in my app that runs on 7.1.1.final I have a sar and I want it to be deployed only when a datasource is available.

       

      I tried adding to the jboss-service.xml the following entry

       

      <?xml version="1.0" encoding="UTF-8"?>
      <server>
      
      
                <mbean code="com.my.app.services.WaitForDBService"
                          name="com.my.app.services:service=WaitForDBService">
                          <depends>jboss.as:subsystem=datasources,data-source=ExampleDS</depends>
                </mbean>
      
      
      </server>
      
      

       

      but when I start JBOSS I get

       

      JBAS014775:    New missing/unsatisfied dependencies:
            service jboss.mbean.service."jboss.as:subsystem=datasources,data-source=ExampleDS".create (missing) dependents: [service jboss.mbean.service."com.my.app.services.WaitForDBService:service=WaitForDBService".create]
            service jboss.mbean.service."jboss.as:subsystem=datasources,data-source=ExampleDS".start (missing) dependents: [service jboss.mbean.service."com.my.app.services.WaitForDBService:service=WaitForDBService".start]
      
      

       

       

      I used JConsole to find this MBean name for the data source and I tired to combine it from examples from previous JBOSS versions - but I guess this isn't the right string.

      Can someone refer me to the right definition?

       

      thanks,

      Noa