4 Replies Latest reply on Feb 28, 2006 2:23 AM by bingxue

    Hypersonic localDB -> server mode migration

    dlmiles

      I have been running the default configuration of JBoss for a while and am now looking at the startguide40.zip with Duke's Bank Application.

      This states I must use HSSQL in TCP (server) mode, it was original setup and running in localDB (memory) mode.

      Now JBoss does not start correctly, as-if the tables are missing, its like HSSQL has setup a brand new instance of itself. My understanding was I was simply changing the allowable access methods to the same data not creating a new database instance. There are now both localDB.* and default.* files in the data/hypersonic directory.

      What should I do ? shutdown the other instance ?

      Migrate the data from one to the other ? (The .script files are text SQL command, and there is no data to really migrate, the localDB.script and default.script look similar all but the extra table created in default.script for the Duke Bank App).

      Keep both instances and change the naming or order the are defined in the file ?

      Thanks

      Darryl


      THEN:

      <connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}localDB</connection-url>
      <mbean code="org.jboss.jdbc.HypersonicDatabase"
       name="jboss:service=Hypersonic,database=localDB">
       <attribute name="Database">localDB</attribute>
       <attribute name="InProcessMode">true</attribute>
       </mbean>
      


      NOW:
      <connection-url>jdbc:hsqldb:hsql://localhost:1701</connection-url>
      <mbean code="org.jboss.jdbc.HypersonicDatabase"
       name="jboss:service=Hypersonic">
       <attribute name="Port">1701</attribute>
       <attribute name="Silent">true</attribute>
       <attribute name="Database">default</attribute>
       <attribute name="Trace">false</attribute>
       <attribute name="No_system_exit">true</attribute>
       </mbean>
      <mbean code="org.jboss.jdbc.HypersonicDatabase"
       name="jboss:service=Hypersonic,database=localDB">
       <attribute name="Database">localDB</attribute>
       <attribute name="InProcessMode">true</attribute>
       </mbean>



      The first error:

      17:49:43,970 ERROR [GeneralPurposeDatabasePersistencePlugin] Cannot create timer table
      org.jboss.deployment.DeploymentException: Error while checking if table aleady exists TIMERS; - nested throwable: (java.sql.SQLException: Table not found:
      SYSTEM_TABLES in statement [SELECT * FROM SYSTEM_TABLES])
      at org.jboss.ejb.plugins.cmp.jdbc.SQLUtil.tableExists(SQLUtil.java:1002)
      at org.jboss.ejb.txtimer.GeneralPurposeDatabasePersistencePlugin.createTableIfNotExists(GeneralPurposeDatabasePersistencePlugin.java:92)
      at org.jboss.ejb.txtimer.DatabasePersistencePolicy.startService(DatabasePersistencePolicy.java:96)


        • 1. Re: Hypersonic localDB -> server mode migration
          dlmiles

          Maybe the startguide.pdf would do with updating section 4.1.7.1 to add the following info:

          I found the problem in that there is code in the default hssql-db.xml:

          <depends>jboss:service=Hypersonic,database=localDB</depends>


          I replace with:
          <depends>jboss:service=Hypersonic</depends>



          I commented out the section, so there was only one <mbean code="..." ../> :
          <mbean code="org.jboss.jdbc.HypersonicDatabase"
           name="jboss:service=Hypersonic,database=localDB">
           <attribute name="Database">localDB</attribute>
           <attribute name="InProcessMode">true</attribute>
           </mbean>



          Back to the task of deploying Duke's Bank Application, for each EJB (around 7 in all) I received a similar stack trace like this:

          18:37:16,988 WARN [ServiceController] Problem starting service jboss.j2ee:jndiName=ebankAccount,service=EJB
          javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]
           at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1302)
           at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1382)
           at org.jnp.interfaces.NamingContext.rebind(NamingContext.java:469)
           at org.jnp.interfaces.NamingContext.rebind(NamingContext.java:462)
           at javax.naming.InitialContext.rebind(InitialContext.java:363)
           at org.jboss.naming.Util.rebind(Util.java:109)



          Then eventually I get:

          18:37:42,219 INFO [EJBDeployer] Deployed: file:/opt/jboss-4.0.2RC1/server/default/tmp/deploy/tmp2675JBossDukesBank.ear-contents/bank-ejb.jar
          18:37:42,302 INFO [TomcatDeployer] deploy, ctxPath=/bank, warUrl=file:/opt/jboss-4.0.2RC1/server/default/tmp/deploy/tmp2675JBossDukesBank.ear-contents/web-client.war/
          18:37:42,604 INFO [EARDeployer] Started J2EE application: file:/opt/jboss-4.0.2RC1/server/default/deploy/JBossDukesBank.ear


          That to me means it all working now. :)


          • 2. Re: Hypersonic localDB -> server mode migration
            dredley

            I am also working with the Duke's Bank App.

            I was getting the same exception, and tried your suggestions. I no longer get those exceptions.

            It's now giving me the following exception:

            org.jboss.deployment.DeploymentException: Failed to setup client ENC; - nested throwable: (javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out])
            at org.jboss.deployment.ClientDeployer.start(ClientDeployer.java:156)
            at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
            ..........

            Any ideas how to solve this?

            Thanks!

            -Deb

            • 3. Re: Hypersonic localDB -> server mode migration
              dredley

              Just as a note, I got it working.

              What I did... was probably more steps than I needed to but after going from forum to forum -- and finding so many "different" posible solutions to the "same" errors, I decided to begin again.

              It worked on the first try! I hope this can save someone else from spending so much time on it. I think the most important thing is what needs to be commented or uncommented in the hsqldb-ds.xml file wasn't clear from the instructions guide.

              Wiped out the JBoss-4.0.2 and all it's files.

              1) Re-installed JBoss
              2) Extracted the two zip files (j2eetutorial14-update6.zip & jbossj2ee-src.zip)
              3) Added the jbossj2ee-src dir/files to the j2eetutorial dir.
              4) Modified the ...j2eetutorial14/jboss-build.properties to point to my jboss installation directory:

              jboss.home=C:/jboss-4.0.2

              5) Modified the ...server/default/deploy/hsqldb-ds.xml file to be:

              [UNCOMMENTED]
              <connection-url>jdbc:hsqldb:hsql://localhost:1701</connection-url>


              [commented]
              <connection-url>jdbc:hsqldb:.</connection-url>


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


              [UNCOMMENTED]
              jboss:service=Hypersonic,database=localDB

              [UNCOMMENTED]
              &#60;mbean code="org.jboss.jdbc.HypersonicDatabase"
              name="jboss:service=Hypersonic">
              &#60;attribute name="Port">1701
              &#60;attribute name="Silent">true
              &#60;attribute name="Database">default
              &#60;attribute name="Trace">false
              &#60;attribute name="No_system_exit">true
              &#60;/mbean>

              [UNCOMMENTED]
              &#60;mbean code="org.jboss.jdbc.HypersonicDatabase"
              name="jboss:service=Hypersonic,database=localDB">
              &#60;attribute name="Database">localDB
              &#60;attribute name="InProcessMode">true
              &#60;/mbean>


              5) Executed run.bat to start up the JBoss Server.

              6) Followed the steps to compile, package, and assemble using ant.

              7) Followed the steps to create, insert and verify tables using ant.

              8) Deployed the application.

              No Errors or Exceptions... Insetead it deployed and started.

              16:48:32,189 INFO [EJBDeployer] Deployed: file:/C:/jboss-4.0.2/server/default/tmp/deploy/tmp11203JBossDukesBank.ear-con
              tents/bank-ejb.jar
              16:48:32,220 INFO [TomcatDeployer] deploy, ctxPath=/bank, warUrl=file:/C:/jboss-4.0.2/server/default/tmp/deploy/tmp1120
              3JBossDukesBank.ear-contents/web-client-exp.war/
              16:48:32,345 INFO [EARDeployer] Started J2EE application: file:/C:/jboss-4.0.2/server/default/deploy/JBossDukesBank.ear

              Hope this helps out...

              -Deb

              • 4. Re: Hypersonic localDB -> server mode migration
                bingxue

                well, when you re-start the server, the exception comes back. The key is to change from
                jboss:service=Hypersonic,database=localDB
                to
                jboss:service=Hypersonic

                This is a very frustrating error in the original guide.