<feature>jakartaee-8.0</feature>.
It also enables jpa-2.2 + EclipseLink.
If you need to Hibernate with JakartaEE8 instead of EclipseLink, you have to manually include all the features of JakartaEE8 without jpa-2.2 and enable bells-1.0 . See the list below.
<feature>appClientSupport-1.0</feature>
<feature>appSecurity-2.0</feature>
<feature>appSecurity-3.0</feature>
<feature>batch-1.0</feature>
<feature>beanValidation-2.0</feature>
<feature>cdi-2.0</feature>
<feature>concurrent-1.0</feature>
<feature>distributedMap-1.0</feature>
<feature>ejb-3.2</feature>
<feature>ejbHome-3.2</feature>
<feature>ejbLite-3.2</feature>
<feature>ejbPersistentTimer-3.2</feature>
<feature>ejbRemote-3.2</feature>
<feature>el-3.0</feature>
<feature>j2eeManagement-1.1</feature>
<feature>jacc-1.5</feature>
<feature>jaspic-1.1</feature>
<feature>javaMail-1.6</feature>
<feature>jaxb-2.2</feature>
<feature>jaxrs-2.1</feature>
<feature>jaxrsClient-2.1</feature>
<feature>jaxws-2.2</feature>
<feature>jca-1.7</feature>
<feature>jcaInboundSecurity-1.0</feature>
<feature>jdbc-4.2</feature>
<feature>jms-2.0</feature>
<feature>jndi-1.0</feature>
<feature>jpaContainer-2.2</feature>
<feature>jsf-2.3</feature>
<feature>json-1.0</feature>
<feature>jsonb-1.0</feature>
<feature>jsonp-1.1</feature>
<feature>jsp-2.3</feature>
<feature>managedBeans-1.0</feature>
<feature>mdb-3.2</feature>
<feature>restConnector-2.0</feature>
<feature>servlet-4.0</feature>
<feature>ssl-1.0</feature>
<feature>wasJmsClient-2.0</feature>
<feature>wasJmsSecurity-1.0</feature>
<feature>wasJmsServer-1.0</feature>
<feature>websocket-1.1</feature>
<feature>bells-1.0</feature>
For hibernate integration, we are using jpaContainer-2.2 and bells-1.0.
First, add data sources and hibernate libraries to the server.
Next, add hibernate libraries to the application using commonLibraryRef
Then update persistence.xml.
Now you can use the persistence unit in your service layer.
Project structure |
Find the source code in my GitHub repository.
How to test? I have integrated the liberty maven plugin and you just need to run mvn libert:dev
MySQL schema is included in the repository.
If you encounter any issues, please report and I will address them.
Demo |
References
- https://www.ibm.com/support/knowledgecenter/en/SS7K4U_liberty/com.ibm.websphere.wlp.zseries.doc/ae/twlp_dep_jpa.html
- https://stackoverflow.com/questions/47396310/open-liberty-and-hibernate
- https://stackoverflow.com/questions/60891006/unable-to-integrate-openliberty-jpa-with-hibernate
- https://docs.oracle.com/cd/E16439_01/doc.1013/e13981/servjndi010.htm
- https://openliberty.io/docs/20.0.0.8/reference/config/classloader.html
- https://openliberty.io/blog/2019/11/28/dev-mode-liberty-maven-plugin.html
- https://openliberty.io/blog/2019/09/10/open-liberty-jakarta-ee.html
- https://rieckpil.de/bootstrap-a-jakarta-ee-8-maven-project-with-java-11-in-seconds/
Is it possible to populate config folder with jars coming as dependencies in pom.xml ? I don't want to put all these jars manually.
ReplyDeleteI don't think that is possible. You have to enable the features in openLiberty.
DeleteMay be you are looking for something like this >> https://www.tomitribe.com/blog/tomee-fat-jar-deployments/