0
votes

I want to reverse engineer a h2 database:

enter image description here

roo suggests the two available schemas INFORMATION_SCHEMA and PUBLIC but using them results in an error "Schema(s) 'PUBLIC' do not exist or does not have any tables..."

enter image description here

Roo version: 1.3.2

Any ideas? Thanks in advance.

Edit 1: Output of the log.roo:

// Spring Roo 1.3.2.RELEASE [rev 8387857] log opened at 2016-05-26 09:04:31
project --topLevelPackage de.max.test
persistence setup --database H2_IN_MEMORY --provider HIBERNATE 
// [failed] database introspect --schema unable-to-obtain-connection 
osgi start --url  file:///C:/Users/max/Downloads/h2/h2-1.4.191.jar
database introspect --schema PUBLIC 
database introspect --schema INFORMATION_SCHEMA 
database introspect --schema no-schema-required
database reverse engineer --schema PUBLIC

database.properties:

#Updated at Thu May 26 10:25:51 CEST 2016
#Thu May 26 10:25:51 CEST 2016
database.driverClassName=org.h2.Driver
database.url=jdbc\:h2\:mem\:test;DB_CLOSE_DELAY\=-1
database.username=sa
database.password=

The establishing of a connection seems to work since roo detects the two schems INFORMATION_SCHEMA and PUBLIC.

1
Could you update your answer to provide a log.roo file with the executed commands and all the necessary steps and configurations to be able to reproduce your issue? Regards, - jcgarcia
Seems like Spring Roo shell is not establishing connection to your DB. Try to create a new schema using CREATE SCHEMA statement on your H2 shell. Then, add new table to that schema using "CREATE TABLE SCHEMANAME.TABLENAME(testname varchar(10))". Now, if you use database introspect roo command is showing you the new created schema? - jcgarcia

1 Answers

1
votes

Thanks to @jcgarcia. The connection was indeed not established. I changed the database.url to

database.url=jdbc:h2:~/test

That worked but roo could definitely be improved by stating that a connection could not be established.