From 75d10bd348a7ac38d0df92f4f46005f9828d9835 Mon Sep 17 00:00:00 2001 From: merorai Date: Fri, 14 Feb 2020 11:51:55 +0000 Subject: [PATCH 1/2] Removed Derby and replaced it with H2 --- readme.txt | 2 +- src/main/webapp/WEB-INF/web.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/readme.txt b/readme.txt index aa40cb9b..7350bf6b 100644 --- a/readme.txt +++ b/readme.txt @@ -160,7 +160,7 @@ you might run into the following issues: * You will see some spurious JSF warnings on some pages due to a GlassFish 4/Mojarra bug (https://java.net/jira/browse/GLASSFISH-20244). The error is harmless and can be ignored. -* Sometimes when GlassFish is not shutdown correctly, the Derby database that +* Sometimes when GlassFish is not shutdown correctly, the H2 database that the application uses get's corrupted, resulting is strange JDBC errors. If this occurs, you will need to stop the application and clean the database. You can do this by simply removing \temp\cargo-tracker-database from the file diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index ec0bf532..5bd9da1f 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -50,8 +50,8 @@ faster. --> java:app/jdbc/CargoTrackerDatabase - org.apache.derby.jdbc.EmbeddedDriver - jdbc:derby:/tmp/cargo-tracker-database;create=true + org.h2.Driver + jdbc:h2:/tmp/cargo-tracker-database;AUTO_SERVER=TRUE java:app/jms/CargoHandledQueue From 06be0c9e9997c7667aba2b97d7c8087dd144196a Mon Sep 17 00:00:00 2001 From: merorai Date: Fri, 14 Feb 2020 17:01:28 +0000 Subject: [PATCH 2/2] Fixed a H2 error where it required use of an absolute file path. --- src/main/webapp/WEB-INF/web.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 5bd9da1f..3c5bb7bd 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -51,7 +51,7 @@ java:app/jdbc/CargoTrackerDatabase org.h2.Driver - jdbc:h2:/tmp/cargo-tracker-database;AUTO_SERVER=TRUE + jdbc:h2:./tmp/cargo-tracker-database;AUTO_SERVER=TRUE java:app/jms/CargoHandledQueue