2 Replies Latest reply on Sep 21, 2010 2:55 AM by saurvals

    Jboss Startup and Database connection


      Is there any setting to check the database connectivity using dedined datasource at the JBoss server startup?

      Requirement is to keep on trying the database connectivity unless database server is up.

      Having custom Mbean for this purpose is giving me issue related to

      javax.naming.NameNotFoundException: ConnectionFactory not bound

      in further deployment and hence it would be great if I use some provision available in Jboss.


      Thanks in Advance,

      Saurabh V.

        • 1. Re: Jboss Startup and Database connection

          In the *-service.xml file that defines your mbean you need to add a depends clause that references the connection factory mbean for the data source you are interested in.

          • 2. Re: Jboss Startup and Database connection

            Actually I tried the dependency earlier, but in my case the exception related to ConnectionFactory was getting thrown from some other bean. I made changes such that

            ConnectionFactory depends on CustomBean for DB check

            IssueBean depends on ConnectionFactory

            and it is working fine now.

            Thanks Peter for your guidance.

            -Saurabh V.