-->
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: Hibernate, GWT and Eclipse
PostPosted: Wed Sep 16, 2009 5:17 pm 
Newbie

Joined: Wed Sep 16, 2009 4:45 pm
Posts: 2
I recently worked through a tutorial that describes how to use Hibernate with GWT.

http://code.google.com/webtoolkit/artic ... rnate.html

That tutorial provides three examples. I used the first one that uses Data Transfer Objects to transfer the entities between the server and client.

http://code.google.com/webtoolkit/artic ... #UsingDTOs

The tutorial doesn't provide an Eclipse project. Instead, it provides an Ant build file that will build and deploy the project. I later modified the project to use a MySQL database and also I used my own database table. That worked fine as long as I built and deployed the project using the Ant build file that was provided with the tutorial.

After working successfully with the project using a text editor and an Ant build file, I tried to move the same source code into a GWT project in Eclipse. I started by creating a new GWT project in Eclipse, and then I added my source code from the Hibernate tutorial project. After compiling the project on Eclipse, the project started successfully and displayed the page in the browser. When I clicked the button that should retrieve some data from the database, I got an error when the following line was executed.

sessionFactory = config.buildSessionFactory();

The stack trace includes the following.

Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkPermission(DevAppServerFactory.java:128)
at com.google.appengine.tools.development.DevAppServerFactory$CustomSecurityManager.checkAccess(DevAppServerFactory.java:155)
at java.lang.ThreadGroup.checkAccess(ThreadGroup.java:288)
at java.lang.Thread.init(Thread.java:332)
at java.lang.Thread.<init>(Thread.java:377)
at java.util.TimerThread.<init>(Timer.java:456)
at java.util.Timer.<init>(Timer.java:71)
at java.util.Timer.<init>(Timer.java:122)
at com.mysql.jdbc.ConnectionImpl.<clinit>(ConnectionImpl.java:208)

Does anyone have any idea why I would have a problem connecting to the database when I attempt to run the code from an Eclipse project?


Top
 Profile  
 
 Post subject: Re: Hibernate, GWT and Eclipse
PostPosted: Wed Sep 16, 2009 6:50 pm 
Newbie

Joined: Wed Sep 16, 2009 4:45 pm
Posts: 2
Here's the solution.

In Eclipse, go to "Project->Properties->Google->App Engine" and uncheck the "Use Google App Engine" box.


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.