[hibernate-dev] HHH-8310 : WrappedBlob/WrappedClob classloading problem

Sanne Grinovero sanne at hibernate.org
Tue Jul 8 16:20:30 EDT 2014


On 8 July 2014 20:53, Gail Badner <gbadner at redhat.com> wrote:
> HHH-8310 [1] mentions a Spring bug SPR-11125 [2] that results in threads having a different ContextClassLoader (CCL) than their caller. As a result, SerializableBlobProxy.generateProxy() throws IllegalArgumentException because WrappedBlob is not found. The same happens for SerializableClobProxy.generateProxy() because WrappedClob is not found.
>
> IIUC, this will be fixed by accessing the ClassLoaderService in Hibernate 5.
>
> I'm looking for either a fix or workaround for this in Hibernate 4.2.x and 4.3.x.
>
> A) A possible fix for HHH-8310 suggests using the ClassLoader returned by WrappedBlob.class.getClassLoader(). Could this somehow get an unintended ClassLoader?

I'd use this approach, you could only get an unintended ClassLoader if
there are duplicates exposed on the same classpath, but in such a case
nothing would work correctly anyway.

Sanne

>
> B) A workaround is for the caller to initialize ClassLoaderHelper.overridenClassLoader before calling Spring.
>
> Which would be more appropriate?
>
> Thanks,
> Gail
>
> [1] https://hibernate.atlassian.net/browse/HHH-8310
> [2] https://jira.spring.io/browse/SPR-11125
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev



More information about the hibernate-dev mailing list