-->
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.  [ 4 posts ] 
Author Message
 Post subject: Hibernate migration problems (2.1.2 => 3.1)
PostPosted: Tue Jun 20, 2006 9:58 am 
Senior
Senior

Joined: Tue Oct 21, 2003 8:15 am
Posts: 186
Hi,

I have a rather complex application using Hibernate 2.1.2. We try to upgrade to 3.1 and it PARTIALLY works.

Some stuff don't work, such as certain queries (note that we are using the classic Session interface for now)


The first thing to notice is the following:

2006-06-20 15:53:59,890 [http-8080-Processor24] ERROR - CGLIB Enhancement failed: com.appx.Contact
java.lang.NoSuchMethodError: net.sf.cglib.proxy.Enhancer.setInterceptDuringConstruction(Z)V



Shouldn't it be org.cglib.proxy.Enhancer ?

Next error is related, I guess:

WARN - could not create proxy factory for: com.appx.Contact


Any insight would be greatly appreciated.

/Nick


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 20, 2006 1:24 pm 
Senior
Senior

Joined: Tue Oct 21, 2003 8:15 am
Posts: 186
After a bit of searching, I found another guy with the exact same problem:

http://groups.google.com/group/javaweba ... 83851d6a8e

He claims:

Quote:
The good news is I have finally tracked the problem down. in my hibernate.properties file I had the following:

hibernate.connection.pool_size 1

So when I tried to use a second session it would fail (only on selects
though)

I increased it, and the problem has gone away. Shame java errors are so
useless sometimes!



Is that a plausible cause at all? I did the same thing - increase the pool size - but the same exception is thrown :-(


I cannot seem to find any relevant bug reports on Jira either.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 20, 2006 1:46 pm 
Senior
Senior

Joined: Tue Oct 21, 2003 8:15 am
Posts: 186
OK, so the mapping warnings I get have an explanation:


Quote:
I get org.hibernate.HibernateException: CGLIB Enhancement failed: <classname>?

If you use lazy loading with proxies (default for all classes in Hibernate 3), Hibernate needs to subclass your class at runtime. It can't do this if you have a private no-argument constructor. As per documentation, at least package visibility is required.
''


Can I turn of this behaviour without changing the mapping file (it's huge AND generated :-( )


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 20, 2006 2:29 pm 
Senior
Senior

Joined: Tue Oct 21, 2003 8:15 am
Posts: 186
OK. Problem fixed.

Hibernate 3.0 use lazy class loading, which our app didn't like at all.

So the fix was adding default-lazy="false" to <hibernate-mapping>


So thanks for nuttin' :-)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.