the blog for developers

Grails, Hibernate and JPA: hanging application

When developing an application in Grails I’ve been adding a backend written for JPA. This should be no problem – you think. But while the unit test for the JPA backend work fine for themselves, when adding the backend to the Grails application, Grails hangs when accessing the EntityManager. It does not help that all my efforts to join the Grails mailing list with my gmail address have failed so far. I have no clue how to fix this problem which took most time out of my last weekend :-) Perhaps Hibernate does not like to act as a Grails ORM and at the same time as a JPA provider. Or I have JAR conflicts. Any ideas?

Update: It has been suggested that the problem might be that there are several incompatible ASM jars in the classpath.

You can leave a Reply here. Of course, you should follow me on twitter here.

You can share this post!
Do you want to tell others about this article? Use the social bookmark icons to submit this artice to the service of your choice. Thanks.

About the author: Stephan Schmidt is head of development at brands4friends. He has more than 15 years of internet technology experience and 10 years experience in agile. He was head of development, consultant and CTO and is a speaker, author and blog writer. He specializes in organizing and optimizing software development helping companies by increasing productivity with lean software development and agile methodologies. Want to know more? All views are only his own.
Leave a reply.

Comments

I’ve had problems in the past mixing Spring 2.0, Hibernate 3.x, and JPA. The problem usually comes down to the “asm.jar” file, which is normally included in both the Hibernate library and the Spring 2.0 library. Unfortunately, each includes a different version, and the conflict breaks the application.

I do remember seeing a post on one of email lists you mentioned about a similar conflict. Grails is built on top of both Spring and Hibernate, so maybe that’s not surprising.

By the way, if you can’t get into the email lists directly, both are archived at Nabble:

http://www.nabble.com/codehaus—Groovy-f11866.html for Groovy, and
http://www.nabble.com/grails—user-f11861.html for Grails.

Good luck,

Ken Kousen

My blog is at http://kousenit.wordpress.com

stephan

Thanks Ken, I’ll take a look there, and perhaps try to remove one asm.jar from the classpath.

stephan

@Ray: Thanks, I’ll try that approach.

[...] As I wrote before, using Java JPA in my Grails application, the Grails application (0.6) hanged. After not much help from the mailing list, I updated to Grails RC1.0 without success. Adding the newest Hibernate JARs and Annotations JARs to the grails/lib directory solved my issue though. Grails no happily uses my JPA/Dao backend. Puh. Bookmark at:StumbleUpon | Digg | Del.icio.us | Dzone | Newsvine | Spurl | Simpy | Furl | Reddit | Yahoo! MyWeb [...]

Leave a Reply

What people wrote somewhere else:

Additional comments powered by BackType