[
https://issues.apache.org/jira/browse/TAP5-2525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16492554#comment-16492554
]
Alexey Melnikov commented on TAP5-2525:
---------------------------------------
Actually this patch doens't help even with 5.4.3.
I'm getting this with hibernate 5.0.12.Final
Exception in thread "postponed initializer" java.lang.NoSuchMethodError:
org.hibernate.Session.close()Ljava/sql/Connection;
Because tapestry 5 is compiled with sources of hibernate 4.3.6. But Hibernate 5
version doesn't return javax.sql.Connection in close method, see:
[Session#close|https://docs.jboss.org/hibernate/orm/5.0/javadocs/org/hibernate/Session.html#close–]
So, in my case
org.apache.tapestry5.internal.hibernate.HibernateSessionManagerImpl#threadDidCleanup
throwing this NoSuchMethodError.
> Tapestry-Hibernate integration incompatible with Hibernate 5.x
> --------------------------------------------------------------
>
> Key: TAP5-2525
> URL: https://issues.apache.org/jira/browse/TAP5-2525
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-hibernate
> Affects Versions: 5.4
> Reporter: I D
> Assignee: Kalle Korhonen
> Priority: Major
> Fix For: 5.4.1
>
>
> The following exception is thrown when attempting to start up tapestry with
> the latest stable version of Hibernate (5.0.6.Final):
> {code:java}
> java.lang.NoSuchMethodError:
> org.hibernate.cfg.Configuration.getClassMappings()Ljava/util/Iterator;
> at
> org.apache.tapestry5.hibernate.modules.HibernateModule.contributeValueEncoderSource(HibernateModule.java:95)
> ~[tapestry-hibernate-5.4.0.jar:na]
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> ~[na:1.8.0_60]
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> ~[na:1.8.0_60]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> ~[na:1.8.0_60]
> at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_60]
> at
> org.apache.tapestry5.ioc.internal.ContributionDefImpl.invokeMethod(ContributionDefImpl.java:125)
> ~[tapestry-ioc-5.4.0.jar:na]
> {code}
> That is due to the fact that getClassMappings() was removed from
> org.hibernate.cfg.Configuration in Hibernate 5.
> Luckily, it isn't really needed, and there is a backwards compatible way to
> do without it. I.e., tapestry can easily become compatible with Hibernate 5
> without breaking compatibility with Hibernate 3 and 4.
> I'll create a pull request on GitHub and link to it here.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)