Sunday, July 28, 2013

HSQLDB, openJPA, org.apache.openjpa.persistence.PersistenceException: There were errors initializing your configuration ... A connection could not be obtained for driver class "org.hsqldb.jdbcDriver" and URL ...




Problem

Running HSQLDB and openJPA, the program throws the following message:

- short message:
org.apache.openjpa.persistence.PersistenceException: There were errors initializing your configuration ... A connection could not be obtained for driver class "org.hsqldb.jdbcDriver" and URL ...

- full message:
org.apache.openjpa.persistence.PersistenceException: There were errors initializing your
configuration: org.apache.openjpa.util.UserException: A connection could not be obtained for driver
class "org.hsqldb.jdbcDriver" and URL "jdbc:hsqldb:HSQL://localhost:9001/testone".
You may have specified an invalid URL.


Solution

Check you database log, for instance you get a message like this:
[Server@7e5e5f92]: [Thread[HSQLDB Connection @519f8603,5,HSQLDB Connections @7e5e5f92]]: database alias=testone does not exist

So, create the database on HSQLDB.

No comments:

Post a Comment

eclipse: java: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder" or Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder

  >PROBLEM Using Eclipse, you try to run a simple logging test using "org.slf4j.Logger" like the sample below: package Test; im...