HHH-11546 suggests Netweaver 7.5 support for hibernate >=5.2, but how should that be possible without JPA 2.1

Description

I actually started this as a forum request (https://discourse.hibernate.org/t/hhh-11546-suggests-netweaver-support-for-hibernate-5-2-but-how/4911) but the more I think the more I am sure this is just a bug or even worse Netweaver 7.5 support is not possible although suggests otherwise. So I forward my message from there:

We ported from Hibernate 3.x to 5.2, as it promised SAP Netweaver 7.5 support due to https://hibernate.atlassian.net/browse/HHH-11546 .
SAP Netweaver is a JPA 1.0 or JPA 2.0 (with some tricks) compatible EE5 application server, not JPA 2.1 (see https://blogs.sap.com/2017/04/06/jpa2-in-sap-netweaver-as-java/ from Lukas, he even was the one providing the Netweaver Support to hibernate core, although on the blog he marked it would only work in Hibernate 4.2.X duue to JPA 2.0 limitations), on jira you have marked it to be available for 5.2.11 or better).

We are not using JPA at all but plain hibernate calls. Our application is working fine in Widlfy, but with setting
“SapNetWeaver” as hibernate.transaction.jta.platform
and deplyoying to SAP Netweaver 7.5 patchlevel 16 we get

caused by: java.lang.NoSuchMethodError: org.hibernate.engine.spi.SessionFactoryImplementor.getProperties()Ljava/util/Map;
at org.hibernate.internal.CacheImpl.(CacheImpl.java:71)
at org.hibernate.engine.spi.CacheInitiator.initiateService(CacheInitiator.java:28)
at org.hibernate.engine.spi.CacheInitiator.initiateService(CacheInitiator.java:20)
at org.hibernate.service.internal.SessionFactoryServiceRegistryImpl.initiateService(SessionFactoryServiceRegistryImpl.java:59)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:259)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:233)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:210)
at org.hibernate.service.internal.SessionFactoryServiceRegistryImpl.getService(SessionFactoryServiceRegistryImpl.java:80)
at org.hibernate.internal.SessionFactoryImpl.(SessionFactoryImpl.java:243)
at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:462)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:710)

where hibernate ends up looking for some methods not available in JPA 1.0 (see https://forum.hibernate.org/viewtopic.php?p=2490425 )

So how was support for Netweaver tested in Hibernate 5.X? Was there any testsuite? Netweaver is a JPA 2.0 App Server, how to make a hibernate standalone (non-JPA) approach work nevertheless, is it possible?
Otherwise should be marked as not working as it is still not supporting netweaver 7.5, is it?

Environment

SAP Netweaver 7.5 Patchlevel 16, SAP JVM 8, Oracle 12, SLES 12

Activity

Show:
Lars Decker
January 14, 2021, 9:48 AM

We found a solution ourselves, so ticket can be closed. Here is the fix if someone is interested (hibernate 5.2)

Create a folder “/tmp/hibernate52” on the operating system of netweaver server containing these jars:
antlr-2.7.7.jar
hibernate-core-5.2.17.Final.jar
jboss-logging-3.3.1.Final.jar
xml-apis-1.4.01.jar
classmate-1.3.0.jar
hibernate-jpa-2.1-api-1.0.0.Final.jar
jboss-transaction-api_1.2_spec-1.0.1.Final.jar
dom4j-1.6.1.jar
jandex-2.0.3.Final.jar
validation-api-1.1.0.Final.jar
hibernate-commons-annotations-5.0.1.Final.jar
javassist-3.22.0-GA.jar
xercesImpl-2.11.0.jar

Then log in as administrator using netweaver telnet admin console and issue these commands:

add orpersistence
deploy_provider /tmp/hibernate52 -vendor org.hibernate -name hibernate52

Then change META-INF\application-j2ee-engine.xml to use this library:

Assignee

Unassigned

Reporter

Lars Decker

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Blocker
Configure