-->
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 3.3.2 and Java 8 compatibility
PostPosted: Sat Jul 16, 2016 2:58 am 
Newbie

Joined: Fri Jan 15, 2010 1:42 pm
Posts: 4
We are trying to upgrade to Java8. Unfortunately, our build is failing because we are using a bunch of instrumentation, which requires cglib/asm libs. The asm version that Hibernate 3.3.2 depends on is not compatible with Java8. For the moment we are trying to avoid upgrading Hibernate right away as this is going to open a separate can of worms.

BTW, we are doing some instrumentation at run time as well.

The question is if Hibernate 3 could work with the latest versions of cglib/asm 3.2.4/5.1?

I have tried it and I am getting an error:
An Ant BuildException has occured: java.lang.VerifyError: (class: org/hibernate/bytecode/cglib/CglibClassTransformer, method: doTransform signature: (Ljava/lang/ClassLoader;Ljava/lang/String;Ljava/lang/Class;Ljava/security/ProtectionDomain;[B)[B) Incompatible object argument for function call

Thank you!


Top
 Profile  
 
 Post subject: Re: Hibernate 3.3.2 and Java 8 compatibility
PostPosted: Mon Jul 18, 2016 3:51 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1638
Location: Romania
Hibernate 3.3.2 is a very old release that is no longer maintained so probably the latest cglib/asm versions might not work with it. Why do you use instrumentation in the first place?

_________________
If you liked my answer, you are going to love my High-Performance Java Persistence book and my blog as well.


Top
 Profile  
 
 Post subject: Re: Hibernate 3.3.2 and Java 8 compatibility
PostPosted: Mon Jul 18, 2016 3:58 pm 
Newbie

Joined: Fri Jan 15, 2010 1:42 pm
Posts: 4
Hibernate is being used to instrument lazy initialization of some resource objects that could be huge otherwise without need.
Also, we use hibernate tools to generate ddl from hbm.
Hibernate is using cglib/asm internally for run-time instrumentation too.

I am going to try to make Hibernate 3 work with the latest cglib if Hibernate upgrade won't go smoothly.


Top
 Profile  
 
 Post subject: Re: Hibernate 3.3.2 and Java 8 compatibility
PostPosted: Tue Jul 19, 2016 9:07 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1638
Location: Romania
Since 3.3.0 Hibernate uses Javassist instead of CGlib. Lazy instrumentation is only required for basic properties. Otherwise you can use lazy associations with Proxies.

As for generating DDL from HBM< I don;t think that's ever a good idea. Ideally, you'd use a tool like FlywayDB to manage the schema automatically and have Hibernate map to that database schema.

_________________
If you liked my answer, you are going to love my High-Performance Java Persistence book and my blog as well.


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.