-->
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: ClassCastException in PropertiesHelper
PostPosted: Thu Mar 16, 2006 7:11 pm 
Regular
Regular

Joined: Wed Sep 10, 2003 2:26 pm
Posts: 56
Location: San Diego, CA
After upgrading to 3.1.2 from 3.0.6 started getting a ClassCastException (see below). I'm sure there is something funky about a class mapping somewhere, but I got quite a handful of mapping files and the exception doesn't give me enough info on where to start looking. Any pointers?

Hibernate version:
3.1.2
Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:
java.lang.ClassCastException: java.lang.Boolean
at org.hibernate.util.PropertiesHelper.resolvePlaceHolders(PropertiesHelper.java:88)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1173)
at edu.ucsd.som.hibernate.AbstractHibernate3DataStore.initFactory(AbstractHibernate3DataStore.java:437)
at edu.ucsd.som.hibernate.AbstractHibernate3DataStore.getFactory(AbstractHibernate3DataStore.java:401)
at edu.ucsd.som.hibernate.AbstractHibernate3DataStore.createSession(AbstractHibernate3DataStore.java:161)
at edu.ucsd.som.hibernate.AbstractHibernate3DataStore.startSession(AbstractHibernate3DataStore.java:90)
at edu.ucsd.som.onlinepayments.business.PaymentsTestCase.setUp(PaymentsTestCase.java:43)
at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)

Name and version of the database you are using:
MySQL 4.0

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

[main] INFO org.hibernate.cfg.Environment - Hibernate 3.1.2
[main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
[main] INFO org.hibernate.cfg.Environment - using CGLIB reflection optimizer
[main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
[main] DEBUG org.hibernate.cfg.Configuration - Preparing to build session factory with filters : {}
[main] DEBUG org.hibernate.cfg.Configuration - processing extends queue
[main] DEBUG org.hibernate.cfg.Configuration - processing collection mappings
[main] DEBUG org.hibernate.cfg.Configuration - processing native query and ResultSetMapping mappings
[main] DEBUG org.hibernate.cfg.Configuration - processing association property references
[main] DEBUG org.hibernate.cfg.Configuration - processing foreign key constraints


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 16, 2006 10:49 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Use your debugger. Put a breakpoint in resolvePlaceHolders and have a look at properties.entrySet(). One of the entry values is a Boolean instead of a String; the corresponding key will give you all the information you need to fix your mapping.


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.