peterp created Bug HHH-8310
Issue Type: Bug Bug
Affects Versions: 3.6.4
Assignee: Unassigned
Components: core
Created: 14/Jun/13 12:23 AM
Description:

Creating blob within quartz scheduled job workmanager thread gives us following exception:

interface org.hibernate.engine.jdbc.WrappedBlob is not visible from class loader; nested exception is java.lang.IllegalArgumentException: interface org.hibernate.engine.jdbc.WrappedBlob is not visible from class loader
org.springframework.dao.InvalidDataAccessApiUsageException: interface org.hibernate.engine.jdbc.WrappedBlob is not visible from class loader; nested exception is java.lang.IllegalArgumentException: interface org.hibernate.engine.jdbc.WrappedBlob is not visible from class loader
	at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:296)
	at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:104)
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:403)
	at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:58)
	at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:213)
	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:163)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
....
Caused by: java.lang.IllegalArgumentException: interface org.hibernate.engine.jdbc.WrappedBlob is not visible from class loader
	at java.lang.reflect.Proxy.getProxyClass(Proxy.java:353)
	at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
	at org.hibernate.engine.jdbc.SerializableBlobProxy.generateProxy(SerializableBlobProxy.java:92)
	at org.hibernate.engine.jdbc.AbstractLobCreator.wrap(AbstractLobCreator.java:39) 

Following change in SerializableBlobProxy resolves issue:

	public static ClassLoader getProxyClassLoader() {
		return WrappedBlob.class.getClassLoader();
	}

But is it correct solution?

Similar issue is described here https://hibernate.atlassian.net/browse/HHH-3529

Environment: websphere 7.0.0.25, quartz 1.8.6, spring 3.0.7, hibernate 3.6.4.Final, Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
Project: Hibernate ORM
Priority: Major Major
Reporter: peterp
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira