jQuery in Action, 3rd edition
The moose likes Object Relational Mapping and the fly likes ERRORgetProxyFactory, CGLIB Enhancement failed: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "ERRORgetProxyFactory, CGLIB Enhancement failed:" Watch "ERRORgetProxyFactory, CGLIB Enhancement failed:" New topic

ERRORgetProxyFactory, CGLIB Enhancement failed:

Kazza Summers

Joined: May 30, 2006
Posts: 8

If anyone could help me with this, it would be great. This is the output Im getting when I try and run my project. Im getting the same thing for all classes I have mapping files for?

Thanks Karry
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Could you post the stacktrace and maybe explain a little about what you are doing? People can only guess with the information you have provided so far.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Mingwei Jiang
Ranch Hand

Joined: Feb 19, 2004
Posts: 63
I met the same problem. The stack trace is as below:

Mingwei Jiang
Ranch Hand

Joined: Feb 19, 2004
Posts: 63
Furthormore, in that class, I have one public non-parameter constructor. I use Hibernate 3. Thank you.
Travis Hein
Ranch Hand

Joined: Jun 06, 2006
Posts: 161
I recently found I was having this problem too, when I was not before.

It turns out that it was something to do with having more than one version of the cglib jar file in the web app's class path. Though I am not sure if it is this jar file, or any of the other jar files that hibernate uses and depends on, as I also had the rest of the hibernate jar files in the class path in a different version.

By removing conflicting versions of the cglib & other jars, things worked again.

My environment was using tomcat, i had set up my instance to place a bunch of commonly used, third party jar files into ${CATALINA_BASE}/shared/lib folder, since the webapps i was running in this tomcat instance all were using the same version of hibernate, struts, etc.

(Note that the shared/lib folder is the one on your CATALINA_BASE, or instance, not the CATALINA_HOME, the installation folder for tomcat, though most default installed instances, these are the same, just one of those things that drove me nuts at first...)

With these jar files located here, they are loaded according to the servlet spec / tomcat's class loader tree as:
<the webapp>/WEB-INF/lib

This particular war file i was building was packaging (an older version) of hibernate.jar and its supporting third party jar files into the war file.
so something was amiss there; removing them from the jar file (as the newer ones i had in the shared/lib folder would provide for my webapp)

I guess one could also have removed them from the shared/lib and made each web app have their own copy of the jar files.

I have found though with tomcat 5, now that it uses commons logging, it likes to have log4j in the common/lib folder.

Error: Keyboard not attached. Press F1 to continue.
Sven Walsted

Joined: Jun 23, 2006
Posts: 1
I think you'll find the problem is just what the stack trace is indicating:

Caused by: java.lang.NoSuchMethodError: net.sf.cglib.proxy.Enhancer.setInterceptDuringConstruction(Z)V

You need the cglib-2.1.3.jar (with the version of hibernate I'm using) in your classpath. I've seen other "missing" classes generate a similar exception.
Chris Treber

Joined: Oct 08, 2007
Posts: 1

in my case it was Xerces and/or Castor interfering - got rid of them both.


I agree. Here's the link: http://aspose.com/file-tools
subject: ERRORgetProxyFactory, CGLIB Enhancement failed:
It's not a secret anymore!