2 Replies Latest reply on Feb 27, 2011 2:32 PM by newway

    DefaultDS on Oracle - JBoss Startup while DB starts

    newway

      Hello,

       

      I'm working with JBoss 4.2.3.GA and java 6.

       

      I have set JBoss to work with Oracle as the DefaultDS and i use Java Service Wrapper to start JBoss as a service.

       

      I encounter the following problem:

       

      after i restart my Machine (1-tier) both the DB service and JBoss are starting. the problem is that during it's startup i get errors like

       

       

      INFO  org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLRecoverableException: ORA-01033: ORACLE initialization or shutdown in progress

      the problem is that JBoss doesn't overcome the errors once the DB is up.

       

      I set up the service wrapper to wait one minute before it starts JBoss and every thing is O.K., the problem is that I can't know for sure that the DB will take one minute and I want to know if there is a way to pause the startup until the DB is available.

       

      I want to stress that the problem isn't just my application as described here -  http://community.jboss.org/message/90811

      it's the entire JBoss that doesn't seem to function - queues aren't deployed, other applications ...

       

      your help will be appreciated

        • 1. DefaultDS on Oracle - JBoss Startup while DB starts
          nickarls

          can you run a startup script that does something like

           

          net start db

          <insert something like tnsping check here>

          net start jboss

          • 2. DefaultDS on Oracle - JBoss Startup while DB starts
            newway

            I can't do that since :

            1. I'm using a service wrapper
            2. I can't force the DB to start, it might not be on the same server I'm running

             

            My solution is:

            1. Create a sar named 1-*.sar
            2. in the MBean start method parse the *-ds.xml
            3. use the data from the DS to create a connection to the DB
            4. run in a loop until you manage to create a conection.

             

            the sar will deploy first and will pause the server startup until it will manage to create a conection to the DB

            1 of 1 people found this helpful