1 Reply Latest reply on Apr 5, 2003 10:36 AM by David Jencks

    Datasource configuration for startup classes

    sameer_inn Newbie

      Hello Sir
      I have configured datasource for sample application and it was working fine

      now i made a startup class using MBean
      called Monitor. i have written Datasource
      connection for Monitor and configured oracle-service.xml file

      DataSource txDs = (javax.sql.DataSource)cc.lookup("java:/OracleDS");
      when the run the application it's throws
      OracleDS not bound exception


      when i run the same class as a normal client
      not as startup classes it's working fine
      and updating the record

      i have a doubt i saw Jboss initializes startup classes
      before loading all service.xml files

      so may be due to that reason
      the datasource is not bond in startup classes

      please do provide me suggestion regarding
      Datasource configuration for startup classes

      regads
      Asad

        • 1. Re: Datasource configuration for startup classes
          David Jencks Master

          You need to

          1. Use the jboss specific *-service.xml file to deploy your mbean (rather than using mlets or some other way I can't think of)
          2. Use the mbean dependency mechanism to make your mbean wait for the datasource mbeans to deploy.

          The simplest way to do this is to look in jmx-console for the connection manager mbean for your datasource config: lets pretend it is jboss.jca:service=LocalTxCM,name=OracleDS

          Then include in your mbean config

          jboss.jca:service=LocalTxCM,name=OracleDS