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: java.lang.ClassCastException: java.util.HashSet
PostPosted: Wed May 17, 2006 3:11 pm 
I am getting this error in my HibernateUtil.java :

java.lang.ClassCastException: java.util.HashSet
at org.hibernate.util.PropertiesHelper.resolvePlaceHolders(PropertiesHel
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.jav
at com.rhg.infrastructure.dao.util.HibernateUtil.<clinit>(HibernateUtil.
at com.rhg.infrastructure.dao.impl.MessagesDAOImpl.saveMessage(MessagesD

and my HibernateUtil.java code :

public class HibernateUtil {

private static final SessionFactory sessionFactory;

static {
try {
// Create the SessionFactory from hibernate.cfg.xml
System.out.println("@@@@@@@@@@@ in hibernateUtil setting session factory");
sessionFactory = new Configuration().configure().buildSessionFactory();
} catch (Throwable ex) {
// Make sure you log the exception, as it might be swallowed
throw new ExceptionInInitializerError(ex);

public static SessionFactory getSessionFactory() {
return sessionFactory;

And my hibernate.cfg.xml code :

<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"


<!-- MySQL Database -->
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost/revolution</property>
<property name="connection.username">root</property>
<property name="connection.password">admin</property>
<property name="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>

<!-- Use the C3P0 connection pool. -->
<property name="c3p0.min_size">3</property>
<property name="c3p0.max_size">5</property>
<property name="c3p0.timeout">1800</property>

<!-- Disable second-level cache. -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<property name="cache.use_query_cache">false</property>
<property name="cache.use_minimal_puts">false</property>
<property name="max_fetch_depth">3</property>

<!-- Print SQL to stdout. -->
<property name="show_sql">true</property>
<property name="format_sql">true</property>

<!-- Bind the getCurrentSession() method to the thread. -->
<property name="current_session_context_class">thread</property>

<!-- Hibernate XML mapping files -->
<mapping resource="mapping/Message.hbm.xml"/>



Any idea ?

 Post subject:
PostPosted: Wed May 17, 2006 4:11 pm 

Joined: Wed Aug 25, 2004 6:23 am
Posts: 91
Looks like it might be this bug that's already been fixed:- http://opensource.atlassian.com/project ... e/HHH-1762

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.