-->
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: Disable property
PostPosted: Fri Apr 21, 2006 2:35 pm 
Newbie

Joined: Mon Apr 10, 2006 3:32 pm
Posts: 13
How did i fix this problem?

Please help me!



Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
3.0
Mapping documents:

Code between sessionFactory.openSession() and session.close():
Honey forest = new Honey();
Integer j = new Integer(1);
forest.setId(j);
Honey forest2 = (Honey)session.load(Honey.class,forest);

if(forest2 == null)
{
System.out.println("Error");
}
else
{
String temp = forest2.getName();
System.out.println(temp);
}


Full stack trace of any exception that occurs:
org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of de.laliluna.example.Honey.setId

at org.hibernate.tuple.PojoEntityTuplizer.setPropertyValuesWithOptimizer(PojoEntityTuplizer.java:215)

at org.hibernate.tuple.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:185)

at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3232)

at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:126)

at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)

at org.hibernate.loader.Loader.doQuery(Loader.java:717)

at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)

at org.hibernate.loader.Loader.loadEntity(Loader.java:1785)

at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:93)

at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:81)

at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:2730)

at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:365)

at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:346)

at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:123)

at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:82)

at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:891)

at org.hibernate.impl.SessionImpl.immediateLoad(SessionImpl.java:849)

at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:62)

at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:98)

at org.hibernate.proxy.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:158)

at de.laliluna.example.Honey$$EnhancerByCGLIB$$c6fba096.getName(<generated>)

at de.laliluna.example.TestExample.main(TestExample.java:61)

Caused by: net.sf.cglib.beans.BulkBeanException: de.laliluna.example.casa$$EnhancerByCGLIB$$4d09d5b5

at de.laliluna.example.Honey$$BulkBeanByCGLIB$$38050ea1.setPropertyValues(<generated>)

at org.hibernate.tuple.PojoEntityTuplizer.setPropertyValuesWithOptimizer(PojoEntityTuplizer.java:212)

... 21 more


Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 23, 2006 9:02 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
First you have to find out what the problem is. The exception very nicely told you how to do this:
Code:
org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of de.laliluna.example.Honey.setId
After you've done that, decipher the resulting exception, and post if if you can't.

If it helps any, the problem is to do with type inaccuracies. Most likely, you have defined an id as a composite type, with class, but you're using it as an Integer or other non-composite type. Go over your mapping carefully, and ensure that you're never putting simple types where composite types are expected.


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.