2 Replies Latest reply on Dec 1, 2008 12:14 PM by Vicky Kak

    How to set HSQLDB datasource in JBoss

    Ravi Kota Newbie

      Hi, I wanted to use my application to connect to HSQLDB database running as a separate process via TCP. I'm not sure what changes needs to be made for this. Below are the steps I followed, but ended up with socket creation failure.

      I started HSQLDB in server mode, running at and port 9001.

      I made the hsqldb-ds.xml reflect like below


      <?xml version="1.0" encoding="UTF-8"?> <local-tx-datasource> <jndi-name>DefaultDS</jndi-name> <connection-url>jdbc:hsqldb:hsql://</connection-url> <driver-class>org.hsqldb.jdbcDriver</driver-class> <user-name>sa</user-name> <min-pool-size>5</min-pool-size> <max-pool-size>20</max-pool-size> <idle-timeout-minutes>0</idle-timeout-minutes> <track-statements/> <security-domain>HsqlDbRealm</security-domain> <prepared-statement-cache-size>32</prepared-statement-cache-size> <type-mapping>Hypersonic SQL</type-mapping> </local-tx-datasource> 9001 true default false true


      I dropped this xml file in deploy folder of jboss default location (C:\sun\jboss\server\default\deploy) and started my JBoss

      I'm recieving the below error


      23:32:40,079 ERROR [STDERR] [Server@13d5f21]: [Thread[HSQLDB Server @13d5f21,5,jboss]]: run()/openServerSocket(): 23:32:40,089 ERROR [STDERR] java.net.BindException: Address already in use: JVM_Bind at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359) at java.net.ServerSocket.bind(ServerSocket.java:319) at java.net.ServerSocket.(ServerSocket.java:185) at org.hsqldb.HsqlSocketFactory.createServerSocket(Unknown Source) at org.hsqldb.Server.openServerSocket(Unknown Source) at org.hsqldb.Server.run(Unknown Source) at org.hsqldb.Server.access$000(Unknown Source) at org.hsqldb.Server$ServerThread.run(Unknown Source)


      Apparently from the error message, I could see socket connection is not established to DB server. However, I was able to connect to HSQLDB DatabaseManager externally. But having problem with JBoss.

      I went and connected using DatabaseManager and I could see some new tables,

      One more thing to mention here is I could not see any statement mentioning that DefaultDS is bound in server.log.