4 Replies Latest reply on Apr 8, 2005 3:45 PM by vasu_suku

    How do i set the depends for a mbean in user-service.xml

      I have a startup class which is defined in the user-service.xml. I also have a oracle-ds.xml which defines a datasource. My startup class depend on the datasource defined in the oracle-ds.xml.

      When the server starts up and is trying to invoke the user-service.xml it throws an error saying the datasource is not yet installed.

      The attributes for the Mbean are
      Domain=jboss.jca
      Service=DataSourceBinding
      name=xactly-dataSource-oraclePool

      How should i specify the depends in the user-service.xml

      ===== oracle-ds.xml ======

      <datasources>
       <local-tx-datasource>
       <jndi-name>xactly-dataSource-oraclePool</jndi-name>
       <use-java-context>false</use-java-context>
       <connection-url>jdbc:oracle:thin:@localhost:1521:SWDB</connection-url>
      
       <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
       <user-name>xactly</user-name>
       <password>xactly</password>
       <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
       <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
       <!-- Checks the Oracle error codes and messages for fatal errors -->
       <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
       <!-- sql to call when connection is created
       <new-connection-sql>some arbitrary sql</new-connection-sql>
       -->
      
       <!-- sql to call on an existing pooled connection when it is obtained from pool - the OracleValidConnectionChecker is prefered
       <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
       -->
      
       </local-tx-datasource>
      
      </datasources>



      ===== user-service.xml =======

      <server>
      
       <classpath codebase="." archives="xstartup.jar"/>
      
       <mbean code="com.xactly.startup.XStartup"
       name="user:service=XStartup">
       <depends>jboss.jca:service=DataSourceBinding</depends>
      
       </mbean>
      
      </server>


        • 1. Re: How do i set the depends for a mbean in user-service.xml

          Try this:

          <depends>jboss.jca:service=LocalTxCM,name=xactly-dataSource-oraclePool
          



          • 2. Re: How do i set the depends for a mbean in user-service.xml

            Or rather:

            <depends>jboss.jca:service=LocalTxCM,name=xactly-dataSource-oraclePool</depends>
            



            • 3. Re: How do i set the depends for a mbean in user-service.xml

              Hi,

              The startup service is invoked before the binding of the datasource and hence my application cannot resolve the datasource. My problem is that my startupclass need to initialize and needs to reference the datasource. In 3.2.4 the user services [user-service.xml] is called after all other services and this works fine but in 4.0 sp1 the user service is called before the binding of data source. I am kind of stuck here. Any help is appreciated.

              ... 110 more
              Caused by: javax.naming.NameNotFoundException: xactly-dataSource-oraclePool not
              bound
              at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)
              at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)
              at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
              at org.jnp.server.NamingServer.lookup(NamingServer.java:278)
              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:544)
              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:520)
              at javax.naming.InitialContext.lookup(InitialContext.java:347)
              at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.jav

              12:11:31,310 INFO [WrapperDataSourceService] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:name=xactly-dataSource-oraclePool,s
              ervice=DataSourceBinding to JNDI name 'xactly-dataSource-oraclePool'

              • 4. Re: How do i set the depends for a mbean in user-service.xml

                Hi,

                I finally got it working. If i set the service to DataSourceBinding then it works. Thanks

                <depends>jboss.jca:service=DataSourceBinding,name=xactly-dataSource-oraclePool</depends>