jeudi 23 avril 2015

openshift java sqlite, cannot open/create database file

I am trying to create/access an sqlite database file in an openshift environment using java. The code works fine on the local tomcat server on which I am testing but does not work when I deploy it to the openshift environment.

The relevant code is below and based on the logs I have been able to identify the line which fails:

log:

Apr 23, 2015 3:37:33 PM my_package.HelloWorld_sl doPost
INFO: jdbc:sqlite:/var/lib/openshift/5522c491fcf9335ab7000053/app-root/data/test
Apr 23, 2015 3:37:33 PM my_package.HelloWorld_sl doPost
INFO: Class Loaded
Apr 23, 2015 3:37:33 PM my_package.HelloWorld_sl doPost
INFO: Trying Database connection establishment

(I get nothing after the above)

java code:

..
db_filename="jdbc:sqlite:"+ "data" + File.separatorChar + "test.db";
LOGGER.info(db_filename);

Class.forName("org.sqlite.JDBC");
LOGGER.info("Class Loaded");
LOGGER.info("Trying Database connection establishment"); //I see this message in logs, but not the next LOGGER message so it is the following line that fails.
dbc =DriverManager.getConnection(db_filename);
LOGGER.info("Database connection established");

Thanks in advance. Bob

Aucun commentaire:

Enregistrer un commentaire