-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: How to configure Hibernate for use with GWT
PostPosted: Wed Sep 23, 2009 6:38 am 
Newbie

Joined: Wed Sep 23, 2009 5:43 am
Posts: 1
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


Top
 Profile  
 
 Post subject: Re: How to configure Hibernate for use with GWT
PostPosted: Wed Sep 23, 2009 7:58 am 
Newbie

Joined: Fri May 29, 2009 2:21 am
Posts: 12
Hi Ron,

Firstly Im assuming ur app is plain GWT + Hibernate and doesnt contain ne other frameworks (spring or security) bcoz ur exceptions relate to security and not something u need to integrate of GWT-HB.

I had tried this integration too and for me I just needed to grab Hibernate session factory in my GWT-RPC implementation and throw it back to the callback on the client side. This worked as a charm for me.

You wont require ne other thing for making/running ur mockups but do make a note of below suggestion if u plan to make big apps using these 2:

Refer to "Pro Application Development with GWT" --> Chap 6 --> Section: Hibernate and GWT
to really know what all is needed to handle these 2 professionally.

Hope this helps
Nitesh


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.