I worked my way through the Hibernate tutorials and got my first test applications running.
However, when I try to use the same code and configuration within a
Google Web Toolkit (GWT) application, it doesn't work anymore: when handling a client request on the server side, the call to
buildSessionFactory() fails with an
ExceptionInInitializerError.
The clues I've got from the exception stack in the Console log are
java.security.AccessControlException and
java.lang.RuntimePermission modifyThreadGroup.
What I suspect is that I have to do something different to get a MySQL JDBC connection from within a web server, or in my case, (probably) the
GWT App Engine within my
Eclipse environment.
However, I am having trouble finding the right pointers on how to establish that, and there are quite some directions to choose from:
- Is it because I'm using the builtin JDBC connection pool? I have tried C3P0 too, but without success.
- Does it have something to do with session context management? I use thread, as in the tutorials.
- Do I have to use some interface with the web server to access those kind of resources? If so, what and how?
- Or maybe, as they would say in Monty Python, something completely different?
BTW, I am using:
- Hibernate 3.3.2
- GWT 1.6.4
- Eclipse 3.4.2
- MySQL 5.1
Thanks in advance,
Ron