-->
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.  [ 8 posts ] 
Author Message
 Post subject: CodeGenerationException during SessionFactory Configuration
PostPosted: Sat Mar 20, 2004 10:19 am 
Newbie

Joined: Tue Sep 02, 2003 8:19 pm
Posts: 19
Hello!

While creating the SessionFactory, I get the following output, and the SessionFactory generation fails. I am almost certain it is a problem in my code, but I have no idea where to look in my code. I don't see from what point in the mapping process this error comes from - can anybody tell me where I can look for my mistake? (I *think* the portion of the logs below is the relevant one, if you need any more info, please tell me)

Thanks!
Carl-Eric

2004-03-20 15:12:39,485 DEBUG SessionFactoryImpl:125 instantiating session factory with properties: {hibernate.connection.password=, java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition, sun.boot.library.path=/usr/lib/j2se/1.3/jre/lib/i386, java.vm.version=Blackdown-1.3.1_02b-FCS, hibernate.connection.username=calle, java.vm.vendor=Blackdown Java-Linux Team, java.vendor.url=http://www.blackdown.org/, path.separator=:, java.vm.name=Java HotSpot(TM) Client VM, file.encoding.pkg=sun.io, java.vm.specification.name=Java Virtual Machine Specification, user.dir=/var/lib/tomcat4/webapps/tasman2/WEB-INF/src/build, java.runtime.version=Blackdown-1.3.1-02b-FCS, java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment, java.endorsed.dirs=/usr/share/tomcat4/bin:/usr/share/tomcat4/common/lib, os.arch=i386, java.io.tmpdir=/usr/share/tomcat4/temp, line.separator=
, java.vm.specification.vendor=Sun Microsystems Inc., java.awt.fonts=, java.naming.factory.url.pkgs=org.apache.naming, os.name=Linux, hibernate.dbcp.whenExhaustedAction=1, java.library.path=/usr/lib/j2se/1.3/jre/lib/i386:/usr/lib/j2se/1.3/jre/lib/i386/native_threads:/usr/lib/j2se/1.3/jre/lib/i386/client:/usr/lib/j2se/1.3/lib/i386:/usr/lib/j2se/i386:/usr/lib:/lib:/usr/lib/j2se/i386, hibernate.dbcp.ps.maxActive=200, java.specification.name=Java Platform API Specification, java.class.version=47.0, os.version=2.4.18-686, user.home=/usr/share/tomcat4, user.timezone=Europe/Berlin, catalina.useNaming=true, java.awt.printerjob=sun.awt.motif.PSPrinterJob, file.encoding=ANSI_X3.4-1968, java.specification.version=1.3, hibernate.dbcp.ps.whenExhaustedAction=1, hibernate.connection.driver_class=org.postgresql.Driver, catalina.home=/usr/share/tomcat4, user.name=tomcat4, java.class.path=/usr/lib/j2se/1.3/lib/tools.jar:/usr/share/tomcat4/bin/bootstrap.jar, hibernate.show_sql=false, hibernate.dbcp.maxWait=60000, java.naming.factory.initial=org.apache.naming.java.javaURLContextFactory, java.vm.specification.version=1.0, java.home=/usr/lib/j2se/1.3/jre, hibernate.dialect=net.sf.hibernate.dialect.PostgreSQLDialect, hibernate.connection.url=jdbc:postgresql://localhost/tasman2?charSet=UTF-8, user.language=en, java.specification.vendor=Sun Microsystems Inc., hibernate.dbcp.maxIdle=10, hibernate.cglib.use_reflection_optimizer=true, java.vm.info=mixed mode, java.version=1.3.1, java.ext.dirs=/usr/lib/j2se/1.3/jre/lib/ext:/usr/lib/j2se/ext, sun.boot.class.path=/usr/lib/j2se/1.3/jre/lib/rt.jar:/usr/lib/j2se/1.3/jre/lib/i18n.jar:/usr/lib/j2se/1.3/jre/lib/sunrsasign.jar:/usr/lib/j2se/1.3/jre/classes, java.vendor=Blackdown Java-Linux Team, hibernate.dbcp.testOnBorrow=true, catalina.base=/usr/share/tomcat4, hibernate.dbcp.maxActive=50, file.separator=/, java.vendor.url.bug=http://www.blackdown.org/cgi-bin/jdk, sun.io.unicode.encoding=UnicodeLittle, sun.cpu.endian=little, hibernate.use_outer_join=true, hibernate.dbcp.ps.maxWait=60000, user.region=US, hibernate.dbcp.ps.maxIdle=200, sun.cpu.isalist=}
2004-03-20 15:12:39,589 INFO ReflectHelper:160 reflection optimizer disabled for: com.bitforce.dervish.data.Building, AssertionError: Assertion Failed
2004-03-20 15:12:39,912 INFO ReflectHelper:160 reflection optimizer disabled for: com.bitforce.dervish.data.Participant, BulkBeanException: Property is private (property setTags)
2004-03-20 15:12:39,972 INFO ReflectHelper:160 reflection optimizer disabled for: com.bitforce.dervish.data.Worker, BulkBeanException: Property is private (property setMutablePrivileges)
2004-03-20 15:12:40,015 INFO ReflectHelper:160 reflection optimizer disabled for: com.bitforce.dervish.data.Message, BulkBeanException: Property is private (property setDate)
2004-03-20 15:12:40,070 INFO ReflectHelper:160 reflection optimizer disabled for: com.bitforce.dervish.data.Tutor, BulkBeanException: Property is private (property setMutablePrivileges)
2004-03-20 15:12:40,237 ERROR CGLIBLazyInitializer:83 CGLIB Enhancement failed
net.sf.cglib.core.CodeGenerationException: java.lang.NoSuchMethodException-->null
at net.sf.cglib.core.ReflectUtils.getConstructor(ReflectUtils.java:281)
at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:255)
at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:251)
at net.sf.cglib.proxy.Enhancer.createUsingReflection(Enhancer.java:388)
at net.sf.cglib.proxy.Enhancer.firstInstance(Enhancer.java:351)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:193)
at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:330)
at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:246)
at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:419)
at net.sf.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:74)
at net.sf.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:36)
at net.sf.hibernate.persister.AbstractEntityPersister.<init>(AbstractEntityPersister.java:802)
at net.sf.hibernate.persister.EntityPersister.<init>(EntityPersister.java:715)
at net.sf.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:41)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:137)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:750)
at com.bitforce.dervish.dao.hibernate.HibernateDAOFactory.<init>(HibernateDAOFactory.java:51)
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:237)
at com.bitforce.dervish.DervishApplication.createDAOSessionFactory(DervishApplication.java:316)
at com.bitforce.dervish.DervishApplication.<init>(DervishApplication.java:106)
at com.bitforce.tasman.struts.LoaderServlet.init(LoaderServlet.java:71)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:916)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:808)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3266)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3395)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:454)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:714)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:300)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:389)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:232)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:155)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:614)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
at org.apache.catalina.core.StandardService.start(StandardService.java:388)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
at org.apache.catalina.startup.Catalina.start(Catalina.java:781)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
2004-03-20 15:12:40,250 ERROR HibernateDAOFactory:56 error while creating hibernate session factory
net.sf.hibernate.HibernateException: CGLIB Enhancement failed
at net.sf.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:84)
at net.sf.hibernate.proxy.CGLIBProxyFactory.postInstantiate(CGLIBProxyFactory.java:36)
at net.sf.hibernate.persister.AbstractEntityPersister.<init>(AbstractEntityPersister.java:802)
at net.sf.hibernate.persister.EntityPersister.<init>(EntityPersister.java:715)
at net.sf.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:41)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:137)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:750)
at com.bitforce.dervish.dao.hibernate.HibernateDAOFactory.<init>(HibernateDAOFactory.java:51)
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:237)
at com.bitforce.dervish.DervishApplication.createDAOSessionFactory(DervishApplication.java:316)
at com.bitforce.dervish.DervishApplication.<init>(DervishApplication.java:106)
at com.bitforce.tasman.struts.LoaderServlet.init(LoaderServlet.java:71)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:916)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:808)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3266)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3395)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:454)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:714)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:300)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:389)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:232)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:155)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:614)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
at org.apache.catalina.core.StandardService.start(StandardService.java:388)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
at org.apache.catalina.startup.Catalina.start(Catalina.java:781)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
Caused by:
net.sf.cglib.core.CodeGenerationException: java.lang.NoSuchMethodException-->null
at net.sf.cglib.core.ReflectUtils.getConstructor(ReflectUtils.java:281)
at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:255)
at net.sf.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:251)
at net.sf.cglib.proxy.Enhancer.createUsingReflection(Enhancer.java:388)
at net.sf.cglib.proxy.Enhancer.firstInstance(Enhancer.java:351)
at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:193)
at net.sf.cglib.proxy.Enhancer.createHelper(Enhancer.java:330)
at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:246)
at net.sf.cglib.proxy.Enhancer.create(Enhancer.java:419)
at net.sf.hibernate.proxy.CGLIBLazyInitializer.getProxyFactory(CGLIBLazyInitializer.java:74)
... 34 more
Caused by:
java.lang.NoSuchMethodException
at java.lang.Class.getConstructor0(Native Method)
at java.lang.Class.getConstructor(Class.java:927)
at net.sf.cglib.core.ReflectUtils.getConstructor(ReflectUtils.java:279)
... 43 more


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 20, 2004 10:44 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
check your cglib jar


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 20, 2004 11:12 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Is default com.bitforce.dervish.data.Tutor constructor private ?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 20, 2004 11:34 am 
Newbie

Joined: Tue Sep 02, 2003 8:19 pm
Posts: 19
- I forgot to mention: I'm using the cglib-full-2.0.jar from the cglib site, the 2.0-something-RC from Hibernate 2.1.2 gave the same error.

- The default Constructor of Tutor is indeed private, as are the default constructors of some of the other classes. Is that a problem? It used to work with earlier versions of Hibernate, and if I remember correctly, the doc says it's ok too. Is there anything I should take care of here?

Thanks
Carl-Eric


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 20, 2004 11:48 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
I think it is a problem in all cglib versions:
"at net.sf.cglib.core.ReflectUtils.getConstructor" I will change this to
"getDeclaredConstructor"


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 20, 2004 11:53 am 
Newbie

Joined: Tue Sep 02, 2003 8:19 pm
Posts: 19
[quote]I think it is a problem in all cglib versions:
"at net.sf.cglib.core.ReflectUtils.getConstructor" I will change this to
"getDeclaredConstructor"[/quote]

That sounds good, thanks. But: Is there anything wrong with my current implementation? Or is there a way to work around this problem now?

Thanks
Carl-Eric[/quote]


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 20, 2004 12:29 pm 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Lazy proxies will not work for private constructors (super class can not call it), but it will work for protected constructors. Looks like it works for public constructors only at this time and there is no workaround without changing cglib code. I have commited this change in cglib, but it is not tested.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 23, 2004 4:21 pm 
Newbie

Joined: Tue Sep 02, 2003 8:19 pm
Posts: 19
OK, I changed all the constructors to public now, and it seems to work. Thanks!

Carl-Eric


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