[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5826) org.hibernate.util.SerializationHelper#resolveClass never tries loader3
Stian Thorgersen (JIRA)
noreply at atlassian.com
Wed Jan 12 05:12:05 EST 2011
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=39590#action_39590 ]
Stian Thorgersen commented on HHH-5826:
---------------------------------------
Another comment (this may not be the correct place for this) - Would it be possible to prevent throwing exceptions if a loader can't load a class? Maybe getResource could be used for this?
> org.hibernate.util.SerializationHelper#resolveClass never tries loader3
> -----------------------------------------------------------------------
>
> Key: HHH-5826
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5826
> Project: Hibernate Core
> Issue Type: Bug
> Affects Versions: 3.6.0
> Reporter: Stian Thorgersen
> Assignee: Gail Badner
> Fix For: 3.6.1, 4.0.0.Alpha1
>
>
> In my application SerializationHelper throws a ClassNotFoundException when I try to retrieve a entity with a blob type from the database. This is caused by what looks like a copy/paste mistake in {{org.hibernate.util.SerializationHelper#resolveClass}}.
> In the below code (extract from org.hibernate.util.SerializationHelper#resolveClass), {{loader2}} is tried twice and {{loader3}} is never tried.
> {code}
> if ( different( loader1, loader2 ) ) {
> try {
> return Class.forName( className, false, loader2 );
> }
> catch ( ClassNotFoundException e ) {
> log.trace( "Unable to locate class using given classloader" );
> }
> }
> if ( different( loader1, loader3 ) && different( loader2, loader3 ) ) {
> try {
> return Class.forName( className, false, loader2 );
> }
> catch ( ClassNotFoundException e ) {
> log.trace( "Unable to locate class using given classloader" );
> }
> }
> {code}
--
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list