[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-3529) ConnectionWrapper is not visible from class loader

Steve Ebersole (JIRA) noreply at atlassian.com
Wed Nov 4 18:46:09 EST 2009


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3529?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Ebersole updated HHH-3529:
--------------------------------

         Assignee: Steve Ebersole
    Fix Version/s: 3.5

The reason for the context classloader is that I am nervous about visibility of the generated proxy if we use the classloader for BorrowedConnectionProvider.  Specifically of concern is that we would not be able to use this proxy (necessarily) anywhere the Connection interface itself would be valid.  Can any of y'all verify this?

This class should be going away anyway, so maybe not such a big deal.

> 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
>            Assignee: Steve Ebersole
>             Fix For: 3.5
>
>         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: 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