From: <leg...@at...> - 2003-11-28 14:12:15
|
The following comment has been added to this issue: Author: Max Rydahl Andersen Created: Fri, 28 Nov 2003 8:11 AM Body: From the FAQ at http://www.hibernate.org/119.html: Unit Testing I get a ClassCastException when I try to call Hibernate from inside JUnit. Fix 1 (Gareth Cronin) Anyone using log4j/commons and JUnit should change the junit/runner/excluded.properties file inside junit.jar to look like this (it will get rid of all annoying Jakarta issues): excluded.0=sun.* excluded.1=com.sun.* excluded.2=org.omg.* excluded.3=javax.* excluded.4=sunw.* excluded.5=java.* excluded.6=org.xml.sax.* excluded.7=org.w3c.dom.* excluded.8=org.apache.log4j.* excluded.9=org.apache.commons.* Fix 2 (Eric Everman) Another fix for this is to turn off class reloading in JUnit. Your problem is commons-log, not hibernate. And your solution about shortcutting the threadcontextclassloader will for sure mess up every library that uses reflection. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-506 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-506 Summary: Non-deterministic? failure of generated proxies Type: Bug Status: Closed Priority: Major Resolution: REJECTED Project: Hibernate2 Fix Fors: 2.1 rc1 Versions: 2.0.3 Assignee: Reporter: Panagiotis Louridas Created: Fri, 28 Nov 2003 3:59 AM Updated: Fri, 28 Nov 2003 8:11 AM Environment: redhat linux 9, j2se 1.4.2 (build 1.4.2-b28), postgres, hibernate 2.0.3 Description: Suppose we have a class hierarchy A <- B, A <- C. Both class B and C have a method getX(). Suppose, moreover, that we have a class R that contains a reference to A. If we do a query on class R and then a query on class B or C, we *sometimes* get a ClassCastException for the generated proxy when we try to call getX(). In my environment, the same test case succeeds or fails upon repeated execution. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |