]
filippo diotalevi commented on HHH-3529:
----------------------------------------
That's a bug that prevents Hibernate to be used in many OSGi application, see:
ConnectionWrapper is not visible from class loader
---------------------------------------------------
Key: HHH-3529
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3529
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.2.6, 3.3.1
Environment: SpringFramework 2.5.5, Hibernate 3.2.6 / 3.3.1, Tomcat 5.5, CommonJ
Timer (
http://www.myfoo.de/commonj/ )
Reporter: Vladimir Kralik
Attachments: hibernate-3.2.6_p2.patch
Hibernate/Spring libraries are in app.war/WEB-INF/lib.
Timer is configured as resources in Tomcat and his libraries are in
$CATALINA_HOME/common/lib/.
Function call from GUI works, but the same function called by timers gives this exception
:
org.springframework.transaction.CannotCreateTransactionException: Could not openHibernate
Session for transaction; nested exception is java.lang.IllegalArgumentException:
interface org.hibernate.jdbc.ConnectionWrapper is not visible from class loader
at
org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:599)
....
Caused by: java.lang.IllegalArgumentException: interface
org.hibernate.jdbc.ConnectionWrapper 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.jdbc.BorrowedConnectionProxy.generateProxy(BorrowedConnectionProxy.java:67)
at
org.hibernate.jdbc.ConnectionManager.borrowConnection(ConnectionManager.java:163)
at org.hibernate.jdbc.JDBCContext.borrowConnection(JDBCContext.java:111)
at org.hibernate.impl.SessionImpl.connection(SessionImpl.java:359)
at
org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:510)
It's the same bug as was in HHH-2215, but this is not resolved.
I think, that the problem is extracting classloader from currentThread(). This is always
not null, so the next test in method getProxyClassLoader() is always false.
I my case, timer thread lives in top class loader, but hibernate libraries are inside
application class loader.
Attached patch removes classloader extracting from currentThread(). It works for my
case.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: