Problem connecting to Apache Derby using Hibernate configuration file in Netbeans (ERROR XSDB6)

Posted by me_here on Stack Overflow See other posts from Stack Overflow or by me_here
Published on 2010-04-08T09:07:42Z Indexed on 2010/04/08 9:13 UTC
Read the original article Hit count: 510

Filed under:
|
|

I've created a local Apache Derby database in Netbeans, but am having problems when I try and autogenerate the POJO files, using the "Hibernate Reverse Engineering Wizard".

My Hibernate configuration (generated by Netbeans from the database connection, then I added a few bits):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
  <session-factory>
 <!-- Default Netbeans generated parameters -->
    <property name="hibernate.connection.driver_class">org.apache.derby.jdbc.EmbeddedDriver</property>
    <property name="hibernate.connection.url">jdbc:derby:C:/CerealDatabase</property>
    <property name="hibernate.connection.username">cerealuser</property>
    <property name="hibernate.connection.password">cerealpass</property>
 <!-- Additional parameters -->
 <property name="hibernate.dialect">org.hibernate.dialect.DerbyDialect</property>
 <property name="hibernate.show_sql">true</property>
 <property name="hibernate.default_schema">CEREALUSER</property>
  </session-factory>
</hibernate-configuration>

When I try and generate the POJOs using this configuration file, I get the message to check my configuration file, and the derby.log gives the errors:

java.sql.SQLException: Failed to start database 'C:/CerealDatabase', see the next exception for details.
Caused by: java.sql.SQLException: Failed to start database 'C:/CerealDatabase', see the next exception for details.
Caused by: ERROR XSDB6: Another instance of Derby may have already booted the database C:\CerealDatabase.

I've closed any other connections to the database before trying this, and there is no "db.lck" lock file at the time, which indicates there are no connections to the database as I understand it.

Does anyone have any ideas? Help gratefully received.

© Stack Overflow or respective owner

Related posts about hibernate

Related posts about derby