Using HSQLDB database for container authentication
I am trying to use HSQLDB for container authentication in Tomcat. When I start Tomcat, I get this error message in the catalina.YYYY-MM-DD.log:
INFO: Starting Servlet Engine: Apache Tomcat/5.5.23
Aug 8, 2007 2:23:43 PM org.apache.catalina.realm.JDBCRealm start
SEVERE: Exception opening database connection
java.sql.SQLException: The database is already in use by another process: org.hsqldb.persist.NIOLockFile@18ca22fe[file =\\localhost\data\Auth.lck, exists=false, locked=false, valid=false, fl =null]: java.io.FileNotFoundException: \\localhost\data\Auth.lck (The network path was not found)
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.jdbcConnection.<init>(Unknown Source)
at org.hsqldb.jdbcDriver.getConnection(Unknown Source)
at org.hsqldb.jdbcDriver.connect(Unknown Source)
at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm .java:701)
at org.apache.catalina.realm.JDBCRealm.start(JDBCReal m.java:769)
at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1006)
at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:443)
at org.apache.catalina.core.StandardService.start(Sta ndardService.java:448)
at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:700)
at org.apache.catalina.startup.Catalina.start(Catalin a.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:295)
at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:433)
I am using the following connectionURL:
connectionURL="jdbc:hsqldb://localhost/data/Auth"
where Auth is the name of my HSQLDB database with the following files:
I setup my realm in server.xml as follows:
<Realm className="org.apache.catalina.realm.JDBCRealm"
driverName="org.hsqldb.jdbcDriver"
connectionURL="jdbc:hsqldb://localhost/data/Auth"
connectionName="SA" connectionPassword=""
userTable="USER" userNameCol="USERNAME" userCredCol="PASSWORD"
userRoleTable="USER_ROLE" roleNameCol="ROLENAME" />
It seems that Tomcat cannot find my database files? Without success, I have located them in various places:
webbapps/MyApp/WEB-INF/data
webbapps/MyApp/WEB-INF/classes/data
webbapps/MyApp/WEB-INF/lib/data
webapps/data
Can someone tell me where to put the database files so Tomcat can find them? I am using Tomcat 6.
|