0

ZK, Hibernate and JSE1.4 problem

asked 2007-04-03 05:14:17 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4240679

By: andigre

Hi

Zk seems not to work with 1.4 and Hibernate (Since 2.2.1). I found out that I have to replace the HibernateUtil in the zkplus.jar with an older version. Since 2.2.1 there is a static initializer which uses AnotationConfiguration. This not only requires the hibernate-annotations.jar in the classpath, but also jdk1.5.
--> with 1.4 you get a missmatched classversion exception during startup.

Do you know another solution?

Thanks. Andreas

New Versions: (Not working with 1.4)

static SessionFactory initSessionFactory() {
if (_factory == null) {
try {
// Create the SessionFactory from hibernate.cfg.xml
_factory = new AnnotationConfiguration()
.configure()
.buildSessionFactory();
} catch (Throwable ex) {
// Make sure you log the exception, as it might be swallowed
log.error("Initial SessionFactory creation failed." + ex);
throw new ExceptionInInitializerError(ex);
}

}
return _factory;
}


In earlier version it was just Configuration. (Working with 1.4)

static SessionFactory initSessionFactory() {
if (_factory == null) {
try {
// Create the SessionFactory from hibernate.cfg.xml
_factory = new Configuration().configure().buildSessionFactory();
} catch (Throwable ex) {
// Make sure you log the exception, as it might be swallowed
log.error("Initial SessionFactory creation failed." + ex);
throw new ExceptionInInitializerError(ex);
}

}
return _factory;
}


delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2007-04-03 07:21:03 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4240792

By: jumperchen

This question occurs when we implement a new requirement in the JDK5 Annotation.

You can manually customize your Util class as well as the HibernateUtil class if you want to work with 1.4

Jumper

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2007-04-03 05:14:17 +0800

Seen: 159 times

Last updated: Apr 03 '07

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More