java.security.AccessControlException while Accessing a Read-Only HSQLDB Datababse with Hibernate

69 views
Skip to first unread message

forklabs

unread,
Oct 25, 2010, 1:37:34 AM10/25/10
to Google App Engine
I have created a small database using HSQLDB and Hibernate (db.script
is about 1Mb) that I wish to include into my AppEngine webapp for
consultation purpose only, that is the database will be read from but
never written into.

While exploring and understanding the use of the "res" protocol [1] I
made a standalone program to test it and it worked as advertised.

I then proceeded to make use of that in my servlet running on
AppEngine and I hit a wall whose core is this exception:

Caused by: java.sql.SQLException: General error:
java.security.AccessControlException: access denied
(java.io.FilePermission \db.properties read)
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.jdbcConnection.<init>(Unknown Source)
at org.hsqldb.jdbcDriver.getConnection(Unknown Source)
at org.hsqldb.jdbcDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:154)
at
org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:
133)
at
org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:
446)
... 51 more

That is HSQLDB does not have access to the properties file of its
database.

My suspicion is that the server that comes with the Google Eclipse
Plugin for AppEngine and GWT is blocking access to the properties file
somehow.

1) Should this pattern (read-only HSQLDB accessed with Hibernate) be
viable on AppEngine?

2) Should it be viable, what is causing this AccessControlException?

Regards

[1] http://www.google.ca/search?q=jdbc%3Ahsqldb%3Ares%3A%3Cpath+in+jar%3E

nacho

unread,
Oct 26, 2010, 12:41:04 AM10/26/10
to Google App Engine
Why dont you use the datastore?

Fork Labs

unread,
Oct 26, 2010, 10:42:21 AM10/26/10
to google-a...@googlegroups.com
Hello Nacho,

What do you mean by "using a datastore"?

Regards

nacho

unread,
Oct 26, 2010, 3:20:56 PM10/26/10
to Google App Engine

Fork Labs

unread,
Oct 26, 2010, 4:28:03 PM10/26/10
to google-a...@googlegroups.com
Hello Nacho,

The values I want to access with Hibernate are pre-calculated outside
of the server. Think of them as configuration, or as i18n values.

Regards

nacho

unread,
Oct 27, 2010, 3:46:01 PM10/27/10
to Google App Engine
mmm using an xml file?

Fork Labs

unread,
Oct 29, 2010, 1:10:20 AM10/29/10
to google-a...@googlegroups.com
I ended up exporting my database in CSV files and loading them server
side, having encountered problems with XMLEncoder and Hibernate
auto-generated-subclasses (and PersistenceDelegate).

Still.

Having to export one's database because somehow the server is
preventing access to files inside a JAR is still only a workaround.

Reply all
Reply to author
Forward
0 new messages