-->
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.  [ 6 posts ] 
Author Message
 Post subject: ReflectHelper.getMetaClass IllegalArgumentException
PostPosted: Wed Nov 05, 2003 12:06 pm 
Newbie

Joined: Sat Aug 30, 2003 6:31 pm
Posts: 6
Location: Pforzheim / Germany
Hi,

after I switched our WebApp from Hibernate 1.2.3, which works really nice (THX for this cool solutions - helps us a lot. We use Hibernate since Version 0.9), to Hibernate 2.1beta4 I have a minor Problem.

At the start of the WebApp after Hibernate has compiled the mappings and begins to build the SessionFactory instance I get on most of my mapped classes the following exception message:

net.sf.hibernate.util.ReflectHelper getMetaClass
reflection optimizer disabled for: Foo, IllegalArgumentException: getXX
or in other cases setXX.

First of all my classes work fine with 1.2.3, the classes have nothing really special. All getter/setter pairs are existing. The names and mappings are correct.

The once on which Hibernate 2.1b4 throws the exceptions are these which I declared as private, like setId or set/getVersion (for optimistic locking). Normally Hibernate has no problems with this, but when I change them back to public and try it again every thing works fine.

I'm sure, that this couldn't be, but I have no idea what I made wrong and have nothing related found in the docs, FAQ or Forum search. Can anyone give me a hint whats going wrong ?

THX in advance

Klaus


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 05, 2003 1:38 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
This is not a problem for Hibernate it will work fine, just a little bit slower.

Cglib MetaClass.setPropertyValues can't be used on private setters

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 05, 2003 2:13 pm 
Newbie

Joined: Sat Aug 30, 2003 6:31 pm
Posts: 6
Location: Pforzheim / Germany
Ok, thanks for the info. I expected something like this, but was not sure.

Do you know if this is a temporary problem and a future version of CGLIB will do it or is it impossible ?

Klaus


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 05, 2003 4:09 pm 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
klaus wrote:
Ok, thanks for the info. I expected something like this, but was not sure.

Do you know if this is a temporary problem and a future version of CGLIB will do it or is it impossible ?

Klaus


It is possible to implement "fast reflection" for private members, but it needs to transform class (custom classloader, build tool or JVM debugging interface). Runtime implementation is more transaparent, but it is more limited too.
BTW reflection performance is not a very big problem, if you can use SUNs 1.4.2 JVM, you can ignore this optimization for most use cases.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 05, 2003 5:55 pm 
Newbie

Joined: Sat Aug 30, 2003 6:31 pm
Posts: 6
Location: Pforzheim / Germany
Ok good to know, thanks.

I update when ever possible to the latest JVM and use the 1.4.2 from SUN - only one production server of a customer needs to be updated, but thats no problem.

And until know we have had no real performance problems - and I use reflection intensively in my application, too. Thats the reason why I was surprised that I get this problem with the private setters, because my reflection code access it, too. But now it is clear.

Even if we have no real performance problems I like to try every new feature of hibernate to get even more performance - because as you know an application can never be fast enough ;-)).

Thanks for your infos.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 05, 2003 7:25 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Would be pointless to optimize a so tiny time consuming stuff relating to JDBC queries.

_________________
Emmanuel


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