5 Replies Latest reply on Sep 12, 2004 5:16 PM by seshan

    Error in DukBank App when running ant -f jboss-build.xml db-

    seshan Newbie

      I am getting the following error when I run ant -f jboss-build.xml db-create-table. Any one has a suggestion to get past this error?
      Thanks

      C:\jboss-3.2.5\j2eetutorial\bank>ant -f jboss-build.xml db-create-table
      Buildfile: jboss-build.xml
      db-create-table:
      [java] ScriptTool.init error: Connection is broken: Connection refused: con
      nect
      [java] java.sql.SQLException: Connection is broken: Connection refused: con
      nect
      [java] at org.hsqldb.Trace.getError(Unknown Source)
      [java] at org.hsqldb.Trace.error(Unknown Source)
      [java] at org.hsqldb.jdbcConnection.reconnectHSQL(Unknown Source)
      [java] at org.hsqldb.jdbcConnection.openHSQL(Unknown Source)
      [java] at org.hsqldb.jdbcConnection.(Unknown Source)
      [java] at org.hsqldb.jdbcDriver.connect(Unknown Source)
      [java] at java.sql.DriverManager.getConnection(DriverManager.java:512)
      [java] at java.sql.DriverManager.getConnection(DriverManager.java:171)
      [java] at org.hsqldb.util.ScriptTool.execute(Unknown Source)
      [java] at org.hsqldb.util.ScriptTool.main(Unknown Source)
      [java] java.lang.NullPointerException
      [java] at org.hsqldb.util.ScriptTool.execute(Unknown Source)
      [java] at org.hsqldb.util.ScriptTool.main(Unknown Source)
      [java] Exception in thread "main"
      [java] Java Result: 1

      BUILD SUCCESSFUL
      Total time: 2 seconds
      C:\jboss-3.2.5\j2eetutorial\bank>

        • 1. Re: Error in DukBank App when running ant -f jboss-build.xml
          Norman Richards Master

          Did you turn on external connections to the hypersonic database as the tutorial described?

          • 2. Re: Error in DukeBank App when running ant -f jboss-build.xm
            seshan Newbie

            Yes, if you are referring to the instructions in section 4.1.7.1 Enabling the HSQL MBean and TCP/IP Connections. After the mods my jboss-build.xml file looks as follows:

            ...

            <local-tx-datasource>

            <!-- The jndi name of the DataSource, it is prefixed with java:/ -->
            <!-- Datasources are not available outside the virtual machine -->
            <jndi-name>DefaultDS</jndi-name>

            <!-- for tcp connection, allowing other processes to use the hsqldb
            database. This requires the org.jboss.jdbc.HypersonicDatabase mbean. -->
            <connection-url>jdbc:hsqldb:hsql://localhost:1701</connection-url>

            <!-- for totally in-memory db, not saved when jboss stops.
            The org.jboss.jdbc.HypersonicDatabase mbean necessary
            <connection-url>jdbc:hsqldb:.</connection-url>
            -->
            <!-- for in-process persistent db, saved when jboss stops. The
            org.jboss.jdbc.HypersonicDatabase mbean is not necessary for properly db shutdown

            <connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}localDB</connection-url>
            -->

            ....

            jboss:service=Hypersonic
            </local-tx-datasource>


            1701
            true
            default
            false
            true

            ...

            • 3. Re: Error in DukBank App when running ant -f jboss-build.xml
              seshan Newbie

              I have found the cause. The documentation says "Open the hsqldb-ds.xml file which you’ll find in the deploy directory and which sets up the default datasource". The problem ws there are 2 deploy directories - one under ~all and another under ~default. Both these locations have a copy of the hsqldb-ds.xml file. The mods outlined in the manual have to be done in both files. I had made the mods to the one under all/deply only initially. After I made the mods to the file in default/deploy directory and restarterd the JBoss server, the db-create-table etc started working again.

              • 4. Re: Error in DukBank App when running ant -f jboss-build.xml
                Darran Lofthouse Master

                The mods do not need to be performed in both locations.

                Each folder under the server folder is a different isolated JBoss configuration, if you start JBoss from the run script and do not pass in any arguments the default configuration will be started i.e The files under default will be used, the all configuration will not be touched.

                If you execute the run command as 'run -c all' the all configuration will be used and the files under default will not be touched.

                • 5. Re: Error in DukBank App when running ant -f jboss-build.xml
                  seshan Newbie

                  Thank you very much. That is a useful piece of information. I must have missed reading that part in the manual.

                  Thanks