'How to conf wildfly 20.0.1 to hibernate 5.5 JTA transaction?
I have a little problem to build connection/sessionfactory in hibernate 5.5 through out persistence.xml.
My project is a EJB module, it is deploy in a wildfly 20.0.1 and hibernate 5.5.
I got all logs of every entity that is not mapped,
Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: MyEntity is not mapped
this is like consecuenses that hibernate dont have sessionFactory build
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: MyPersistenceUnit] Unable to build Hibernate SessionFactory
In persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_2.xsd"
version="2.2">
<persistence-unit name="MyPersistenceUnit" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/myDataSource</jta-data-source>
<mapping-file>META-INF/queries.xml</mapping-file>
......
The data source was creating in log wildfly without problems.
Other thing important is that, server(wildfly 20) don't find any namedquery those are declaring in one xml file and it's importing to persistense.xml
The solition that I got was build this ejb module/project in ear project but I would like create just jar file to deploy it alone.
Any help is well-received.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
