no transaction is in progress - Karaf + Camel 3.3. 0 + JPA - jpa

I have been trying to implement a simple Camel + Karaf Webservice which saves the entity into the database using camel JPA but I haven't been successfully. The problem I am facing is that when I try to save data using to("jpa://entityClass") I am getting the below exception:
javax.persistence.TransactionRequiredException: no transaction is in progress
at **org.hibernate.internal.AbstractSharedSessionContract.checkTransactionNeededForUpdateOperation(AbstractSharedSessionContract.java:413) ~[?:?]
.....
at org.apache.camel.component.jpa.JpaProducer$3.doInTransaction(JpaProducer.java:310)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)**
at org.apache.camel.component.jpa.JpaProducer.processEntity(JpaProducer.java:254)
at org.apache.camel.component.jpa.JpaProducer.process(JpaProducer.java:173)
at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:67)
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:168)
at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:395)
at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:148)
at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:60)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:147)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:286)...
at org.apache.camel.component.jetty.CamelContinuationServlet.doService(CamelContinuationServlet.java:219)
at org.apache.camel.http.common.CamelServlet.service(CamelServlet.java:80)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:763)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:569)
My Project Setup:
Camel 3.3.0 , Karaf 4.2.10
Routes use Java DSL
On Karaf, I have installed the MSSQL Data Source which works fine.
My Camel Context:
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0 https://osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/spring/camel-blueprint.xsd"
>
<bean id="jpa" class="org.apache.camel.component.jpa.JpaComponent">
<property name="joinTransaction" value="false"/>
</bean>
<cm:property-placeholder persistent-id="application">
</cm:property-placeholder>
<camelContext xmlns="http://camel.apache.org/schema/blueprint">
<package>com.abc.routes</package>
</camelContext>
</blueprint>
I see that the Entity Manager and Transaction Manager are getting plugged in correctly and I don't see any issue with respect to DB connectivity:
Logs
10:01:24.648 INFO [pipe-restart 301] HHH000490: Using JtaPlatform implementation: [org.hibernate.osgi.OsgiJtaPlatform]
10:01:24.655 INFO [pipe-restart 301] Tracking DataSource for punit camel with filter (&(objectClass=javax.sql.DataSource)(osgi.jndi.service.name=myDs))
10:01:24.658 INFO [pipe-restart 301] Found DataSource for camel osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=myDs)
10:01:24.661 INFO [pipe-restart 301] HHH000204: Processing PersistenceUnitInfo [name: camel]
10:01:25.037 INFO [pipe-restart 301] HHH000400: Using dialect: org.hibernate.dialect.SQLServerDialect
10:01:24.658 INFO [pipe-restart 301] Found DataSource for camel osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=myDS)
10:01:25.037 INFO [pipe-restart 301] HHH000400: Using dialect: org.hibernate.dialect.SQLServerDialect
10:01:25.127 WARN [pipe-restart 301] HHH000038: Composite-id class does not override equals(): com.mycompany.model
10:01:25.128 WARN [pipe-restart 301] HHH000039: Composite-id class does not override hashCode(): com.mycompany.model
10:01:25.130 INFO [pipe-restart 301] HHH10005002: No explicit CDI BeanManager reference was passed to Hibernate, but CDI is available on the Hibernate ClassLoader.
10:01:26.498 INFO [pipe-restart 301] HHH000490: Using JtaPlatform implementation: [org.hibernate.osgi.OsgiJtaPlatform]
10:01:26.511 INFO [pipe-restart 301] Persistence units added for bundle camel-db event 128
10:01:26.597 INFO [pipe-restart 301] Blueprint bundle camel-db/1.0.0.SNAPSHOT has been started
10:01:26.600 INFO [Blueprint Event Dispatcher: 1] Attempting to start CamelContext: camel-2
10:01:26.605 INFO [Blueprint Event Dispatcher: 1] JMX is enabled
10:01:26.660 INFO [Blueprint Event Dispatcher: 1] Apache Camel 3.3.0 (CamelContext: camel-2) is starting
**10:01:26.695 INFO [Blueprint Event Dispatcher: 1] Using EntityManagerFactory found in registry with id [EntityManagerFactory0] org.hibernate.internal.SessionFactoryImpl#33bc3397**
**10:01:26.697 INFO [Blueprint Event Dispatcher: 1] Using TransactionManager found in registry with id [PlatformTransactionManager0] org.ops4j.pax.transx.tm.impl.geronimo.GeronimoPlatformTransactionManager#3c487367**
Can any one help? I have been trying to resolve this for more than a month now. There are solutions for similar problems but not for Camel on Karaf.

I fixed it myself. Issue was in the persistence.xml. The transaction-type was set to "RESOURCE_LOCAL" and I changed to JTA and added a JTA data source.

Related

Classes inside persistence.xml will be ignored

I have here a wildfly 24.0.1 (on OpenJDK 11) and a ear with following structure:
MyPrj.ear
|- MyPrj_EJB.jar
`- MyPrj_Web.war
My persistence.xml is placed in MyPrj.ear/MyPrj_EJB.jar/META-INF/persistence.xml. I'm sure the persistence.xml isn't anywhere else.
The persistence.xml has following contents:
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="myPrj">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>java:/myPrj</jta-data-source>
<class>my.prj.cfg.Config</class>
<properties>
<property name="eclipselink.query-results-cache" value="true"/>
<property name="eclipselink.cache.shared.default" value="true"/>
<property name="eclipselink.target-server" value="JBoss"/>
<property name="eclipselink.weaving" value="false"/>
<property name="jboss.as.jpa.providerModule" value="org.eclipse.persistence"/>
<!-- property name="eclipselink.logging.level" value="FINE" / -->
</properties>
</persistence-unit>
</persistence>
I'm sure that the persistence.xml can be readed, because if I put an invalid character into the persistence-unit name (like an "/": <persistence-unit name="/myPrj">) I get the following error while deploying the application:
Caused by: java.lang.IllegalArgumentException: WFLYJPA0043: Persistence unit name (/myPrj) contains illegal '/' character
So I'm assuming that my persistence.xml is put in the right place and can be read successfully.
But its seems that my <class>-definition will be ignored. Every time if I deploy the ear, I get in the wildfly log file:
...
2022-07-04 18:51:15,694 INFO [org.jboss.as.jpa] (MSC service thread 1-4) WFLYJPA0002: Read persistence.xml for myPrj
2022-07-04 18:52:48,400 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 141) WFLYJPA0003: Starting Persistence Unit Service 'MyPrj.ear/MyPrj_EJB.jar#myPrj'
...
2022-07-04 18:53:16,182 WARN [org.eclipse.persistence] (ServerService Thread Pool -- 184) session_manager_no_partition
...
If I start the application (open the web site) I get:
...
2022-07-04 18:57:45,366 INFO [org.eclipse.persistence] (default task-1) EclipseLink, version: Eclipse Persistence Services - 2.6.0.v20150309-bf26070
2022-07-04 18:57:45,444 INFO [org.eclipse.persistence.connection] (default task-1)
connecting(DatabaseLogin(
platform=>PostgreSQLPlatform
user name=> ""
connector=>JNDIConnector datasource name=>null
))
2022-07-04 18:57:45,444 INFO [org.eclipse.persistence.connection] (default task-1)
Connected: jdbc:postgresql://localhost:5432/myDB
User: myUser
Database: PostgreSQL Version: 9.2.24
Driver: PostgreSQL JDBC Driver Version: 42.2.23
2022-07-04 18:57:45,444 INFO [org.eclipse.persistence.connection] (default task-1)
connecting(DatabaseLogin(
platform=>PostgreSQLPlatform
user name=> ""
connector=>JNDIConnector datasource name=>null
))
2022-07-04 18:57:45,444 INFO [org.eclipse.persistence.connection] (default task-1)
Connected: jdbc:postgresql://localhost:5432/myDB
User: myUser
Database: PostgreSQL Version: 9.2.24
Driver: PostgreSQL JDBC Driver Version: 42.2.23
2022-07-04 18:57:45,446 INFO [org.eclipse.persistence.connection] (default task-1)
/vfs:/content/MyPrj.ear/MyPrj_EJB.jar/_myPrj login successful
2022-07-04 18:57:45,509 WARN [org.eclipse.persistence.metamodel] (default task-1) The
collection of metamodel types is empty. Model classes may not have been found
during entity search for Java SE and some Java EE container managed persistence
units. Please verify that your entity classes are referenced in persistence.xml
using either <class> elements or a global <exclude-unlisted-
classes>false</exclude-unlisted-classes> element
2022-07-04 18:57:45,606 ERROR [org.jboss.as.ejb3.invocation] (default task-1)
WFLYEJB0034: Jakarta Enterprise Beans Invocation failed on component ConfigDAO for
method public my.prj.cfg.Config
my.prj.cfg.ConfigDAO.loadByKey(java.lang.String):
javax.ejb.EJBTransactionRolledbackException: An exception occurred while creating
a query in EntityManager:
Exception Description: Problem compiling [SELECT obj FROM Config obj WHERE
obj.key=:parKey].
[16, 22] The abstract schema type 'Config' is unknown.
[33, 40] The state field path 'obj.key' cannot be resolved to a valid type.
at org.jboss.as.ejb3#24.0.1.Final//org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:219)
Take also note of the warning 2022-07-04 18:57:45,509 WARN org.eclipse.persistence.metamodel] (default task-1) The collection of metamodel types is empty. Model classes may not have been found during entity search for Java SE and some Java EE container managed persistence units. Please verify that your entity classes are referenced in persistence.xml using either <class> elements or a global <exclude-unlisted- classes>false</exclude-unlisted-classes> element.
Also to use <exclude-unlisted-classes>false</exclude-unlisted-classes> instead of the <class>-definition makes no difference.
Here the #Resource annotation of the EntityManager:
#PersistenceContext(unitName="myPrj")
private EntityManager em = null;
And the annotation of the Config entity:
#Entity(name="Config")
#Table(name = "Cfg")
public class Config implements Serializable {
...
#Column(name="key")
private String key = null;
...
}
On the same wildfly I have another EAR running (in a separate standalone instance) which also have JPA access to a database (also eclipselink via persistence.xml) which works without any problems.
What can be wrong here?
Found it! After upgrading eclipselink to V2.7.10 (store eclipselink.jar into .../wildfly-24.0.1.Final/modules/system/layers/base/org/eclipse/persistence/main/) I can deploy and start the application. Not sure which version of eclipselink was used before that (the jar file name don't contains the version information ...)
Switching to eclipselink 3.0.2 don't works because of this problem: Wildfly 21 with eclipselink 3.0 getting error as Persistence Provider not found

NameNotFoundException: Name "openejb/PersistenceUnit/fwtool-jpa -963118576localhost" not found

I'm trying to run TomEE in Docker. It works with tomee:8-jre-7.1.0-plume image but not with 11-jre-8.0.0-M3-plume.
Problem seems to be related to JPA/PersistenceUnit. This is my WebContent/META-INF/persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" 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_1.xsd">
<persistence-unit name="fwtool-jpa">
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<class>com.nnn.OneClass</class>
<class>com.nnn.SecondClass</class>
<class>com.nnn.AnotherClass</class>
</persistence-unit>
</persistence>
I build the application to war with maven having:
<source>11</source>
<target>11</target>
tomee.xml:
<?xml version="1.0" encoding="UTF-8"?>
<tomee>
<Resource id="jtaFWTool" type="DataSource">
jdbcDriver com.mysql.jdbc.Driver
jdbcUrl jdbc:mysql://localhost:3306/FWTool
connectionProperties retainStatementAfterResultSetClose=true;autoReconnectForPools=true;useSSL=false
userName xxxx
password yyyy
maxActive 500
maxIdle 50
maxWaitMillis 50000
removeAbandoned true
maxConnLifetimeMillis 6000000
maxAge 6000000
testWhileIdle true
TimeBetweenEvictionRunsMillis 20000
validationQuery SELECT 1
</Resource>
</tomee>
Dockerfile:
FROM tomee:11-jre-8.0.0-M3-plume
COPY target/fwtool.war /usr/local/tomee/webapps/
COPY tomee.xml /usr/local/tomee/conf/
COPY mysql-connector-java-5.1.40.jar /usr/local/tomee/lib/
Docker build and run
docker build -t fwtool:tomee8-java11 .
docker run --net=host -d --name fwtool fwtool:tomee8-java11
When TomEE is starting and deploying the war, something goes wrong:
15-Feb-2020 17:46:15.843 INFO [main] org.apache.openejb.config.AutoConfig.deploy Configuring PersistenceUnit(name=fwtool-jpa)
15-Feb-2020 17:46:15.844 INFO [main] org.apache.openejb.config.AutoConfig.logAutoCreateResource Auto-creating a Resource with id 'jtaFWToolNonJta' of type 'DataSource for 'fwtool-jpa'.
15-Feb-2020 17:46:15.844 INFO [main] org.apache.openejb.config.AutoConfig.deploy Configuring Service(id=jtaFWToolNonJta, type=Resource, provider-id=jtaFWTool)
15-Feb-2020 17:46:15.844 INFO [main] org.apache.openejb.assembler.classic.Assembler.createRecipe Creating Resource(id=jtaFWToolNonJta)
15-Feb-2020 17:46:16.082 WARNING [main] org.apache.openejb.assembler.classic.Assembler.unusedProperty unused property 'maxWaitMillis' for resource 'jtaFWToolNonJta'
15-Feb-2020 17:46:16.083 WARNING [main] org.apache.openejb.assembler.classic.Assembler.unusedProperty unused property 'maxConnLifetimeMillis' for resource 'jtaFWToolNonJta'
15-Feb-2020 17:46:16.089 INFO [main] org.apache.openejb.config.AutoConfig.setJtaDataSource Adjusting PersistenceUnit fwtool-jpa <jta-data-source> to Resource ID 'jtaFWTool' from 'null'
15-Feb-2020 17:46:16.089 INFO [main] org.apache.openejb.config.AutoConfig.setNonJtaDataSource Adjusting PersistenceUnit fwtool-jpa <non-jta-data-source> to Resource ID 'jtaFWToolNonJta' from 'null'
15-Feb-2020 17:46:16.160 INFO [main] org.apache.openejb.config.AppInfoBuilder.build Enterprise application "/usr/local/tomee/webapps/fwtool" loaded.
15-Feb-2020 17:46:16.172 INFO [main] org.apache.openejb.assembler.classic.Assembler.createApplication Assembling app: /usr/local/tomee/webapps/fwtool
15-Feb-2020 17:46:16.491 INFO [main] org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createDelegate PersistenceUnit(name=fwtool-jpa, provider=org.eclipse.persistence.jpa.PersistenceProvider) - provider time 273ms
15-Feb-2020 17:46:16.491 INFO [main] org.apache.openejb.assembler.classic.Assembler.destroyApplication Undeploying app: /usr/local/tomee/webapps/fwtool
15-Feb-2020 17:46:16.493 SEVERE [main] jdk.internal.reflect.NativeMethodAccessorImpl.invoke Error destroying child
org.apache.catalina.LifecycleException: An invalid Lifecycle transition was attempted ([before_destroy]) for component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/fwtool]] in state [STARTING_PREP]
at org.apache.catalina.util.LifecycleBase.invalidTransition(LifecycleBase.java:430)
at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:316)
at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:814)
at org.apache.tomee.catalina.TomcatWebAppBuilder.undeploy(TomcatWebAppBuilder.java:1656)
...
...
Caused by: javax.naming.NameNotFoundException: Name "openejb/PersistenceUnit/fwtool-jpa -963118576localhost" not found.
at org.apache.openejb.core.ivm.naming.IvmContext.federate(IvmContext.java:211)
at org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:159)
at org.apache.openejb.assembler.classic.Assembler.destroyApplication(Assembler.java:2508)
Any idea what is the problem here with TomEE 8?
The final image 8.0.1-plume is now out and my application is deployed and starts normally with that.
https://hub.docker.com/_/tomee
It was just a problem with M3 beta image 11-jre-8.0.0-M3-plume.

org.hibernate.integrator.spi.Integrator: Provider org.hibernate.search.hcore.impl.HibernateSearchIntegrator not a subtype

My on-going quest to migrate to Hibernate OGM 5.4 on JBoss WildFly 14.0.0.Final to use with MongoDB.
Had it working fine in WildFly 12 & 13 using earlier versions of OGM.
Using OGM 5.4, JPA 2.2, Hibernate ORM 5.3 & Hibernate Search 5.10
as per the: Compatibility matrix
My 'provision' in the Gradle Build is:
provision {
//Optional destination directory:
destinationDir = file("wildfly-custom")
configuration = file( 'wildfly-server-provisioning.xml' )
// Define variables which need replacing in the provisioning configuration!
variables['wildfly.version'] = '14.0.0.Final'
variables['hibernate-orm.version'] = '5.3.7.Final'
variables['hibernate-search.version'] = '5.10.4.Final'
variables['hibernate-ogm.version'] = '5.4.0.CR1'
}
which is used by:
<server-provisioning xmlns="urn:wildfly:server-provisioning:1.1" copy-module-artifacts="true">
<feature-packs>
<feature-pack
groupId="org.wildfly"
artifactId="wildfly-feature-pack"
version="${wildfly.version}"/>
<feature-pack
groupId="org.hibernate"
artifactId="hibernate-orm-jbossmodules"
version="${hibernate-orm.version}"/>
<feature-pack
groupId="org.hibernate"
artifactId="hibernate-search-jbossmodules-orm"
version="${hibernate-search.version}"/>
<feature-pack
groupId="org.hibernate.ogm"
artifactId="hibernate-ogm-featurepack-mongodb"
version="${hibernate-ogm.version}"/>
</feature-packs>
</server-provisioning>
The MongoDB persistence unit in my persistence.xml:
<persistence-unit name="nOTiFYwellMongoDBPersistenceUnit" transaction-type="JTA">
<provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>
<properties>
<!-- <property name="jboss.as.jpa.providerModule" value="org.hibernate:5.2"/> -->
<property name="jboss.as.jpa.providerModule" value="org.hibernate:5.3"/>
<!-- <property name="wildfly.jpa.hibernate.search.module" value="org.hibernate.search.orm:5.8"/> -->
<property name="wildfly.jpa.hibernate.search.module" value="org.hibernate.search.orm:5.10.4.Final"/>
<!-- <property name="hibernate.transaction.jta.platform" value="JBossTS"/> -->
<!-- <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossAS"/> -->
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossStandAloneJtaPlatform"/>
<property name="hibernate.ogm.datastore.provider" value="org.hibernate.ogm.datastore.mongodb.impl.MongoDBDatastoreProvider"/>
<property name="hibernate.ogm.datastore.grid_dialect" value="org.hibernate.ogm.datastore.mongodb.MongoDBDialect"/>
<property name="hibernate.ogm.datastore.database" value="notifyWellDB"/>
<property name="hibernate.ogm.mongodb.host" value="127.0.0.1"/>
</properties>
</persistence-unit>
I've copied the relevant modules from the generated WildFly 14.0.0.Final to my Home Brew installed one.
When I enable my deployed EAR I get:
21:52:42,808 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0027: Starting deployment of "NOTiFYwell.ear" (runtime-name: "NOTiFYwell.ear")
21:52:43,318 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0207: Starting subdeployment (runtime-name: "NOTiFYwellJAR.jar")
21:52:43,318 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0207: Starting subdeployment (runtime-name: "NOTiFYwellWAR.war")
21:52:44,373 INFO [org.jboss.as.jpa] (MSC service thread 1-5) WFLYJPA0002: Read persistence.xml for nOTiFYwellMySQLPersistenceUnit
21:52:44,373 INFO [org.jboss.as.jpa] (MSC service thread 1-5) WFLYJPA0002: Read persistence.xml for nOTiFYwellMongoDBPersistenceUnit
21:52:44,585 WARN [org.jboss.as.jsf] (MSC service thread 1-6) WFLYJSF0005: Unknown JSF version 'NONE'. Default version 'main' will be used instead.
21:52:44,841 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 20) WFLYJPA0010: Starting Persistence Unit (phase 1 of 2) Service 'NOTiFYwell.ear/NOTiFYwellJAR.jar#nOTiFYwellMongoDBPersistenceUnit'
21:52:44,861 INFO [org.jboss.weld.deployer] (MSC service thread 1-2) WFLYWELD0003: Processing weld deployment NOTiFYwell.ear
21:52:44,911 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 20) MSC000001: Failed to start service jboss.persistenceunit."NOTiFYwell.ear/NOTiFYwellJAR.jar#nOTiFYwellMongoDBPersistenceUnit".__FIRST_PHASE__: org.jboss.msc.service.StartException in service jboss.persistenceunit."NOTiFYwell.ear/NOTiFYwellJAR.jar#nOTiFYwellMongoDBPersistenceUnit".__FIRST_PHASE__: java.util.ServiceConfigurationError: org.hibernate.integrator.spi.Integrator: Provider org.hibernate.envers.boot.internal.EnversIntegrator not a subtype
at org.jboss.as.jpa.service.PhaseOnePersistenceUnitServiceImpl$1$1.run(PhaseOnePersistenceUnitServiceImpl.java:128)
at org.jboss.as.jpa.service.PhaseOnePersistenceUnitServiceImpl$1$1.run(PhaseOnePersistenceUnitServiceImpl.java:104)
at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:650)
at org.jboss.as.jpa.service.PhaseOnePersistenceUnitServiceImpl$1.run(PhaseOnePersistenceUnitServiceImpl.java:137)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:485)
Caused by: java.util.ServiceConfigurationError: org.hibernate.integrator.spi.Integrator: Provider org.hibernate.envers.boot.internal.EnversIntegrator not a subtype
at java.util.ServiceLoader.fail(ServiceLoader.java:239)
at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.loadJavaServices(ClassLoaderServiceImpl.java:465)
at org.hibernate.integrator.internal.IntegratorServiceImpl.<init>(IntegratorServiceImpl.java:40)
at org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.build(BootstrapServiceRegistryBuilder.java:224)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.buildBootstrapServiceRegistry(EntityManagerFactoryBuilderImpl.java:455)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:199)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:167)
at org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:32)
at org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:89)
at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.<init>(TwoPhaseBootstrapImpl.java:39)
at org.jboss.as.jpa.hibernate5.HibernatePersistenceProviderAdaptor.getBootstrap(HibernatePersistenceProviderAdaptor.java:199)
at org.wildfly.jpa.hibernateogm5.HibernateOGMPersistenceProviderAdaptor.getBootstrap(HibernateOGMPersistenceProviderAdaptor.java:87)
at org.jboss.as.jpa.service.PhaseOnePersistenceUnitServiceImpl.createContainerEntityManagerFactoryBuilder(PhaseOnePersistenceUnitServiceImpl.java:254)
at org.jboss.as.jpa.service.PhaseOnePersistenceUnitServiceImpl.access$900(PhaseOnePersistenceUnitServiceImpl.java:59)
at org.jboss.as.jpa.service.PhaseOnePersistenceUnitServiceImpl$1$1.run(PhaseOnePersistenceUnitServiceImpl.java:125)
... 9 more
Seen a few other questions with the same error, but none of the suggestions help.
Thanks.
I’m sorry but actually the hibernate-ogm-featurepack-* modules of Hibernate OGM 5.4.0.CR1 work only with WildFly 13.x. There is open issue for WildFly 14.x: https://hibernate.atlassian.net/browse/OGM-1523.
The workaround here is to install just the Hibernate OGM modules without overriding the Hibernate ORM and Hibernate Search modules. Since the versions already provided of Hibernate ORM and Hibernate Search by WildFly 14.0.x are fully compatible with Hibernate OGM 5.4.0.CR1 (or 5.4.0.Final by the way).
I hope that will help you.
Fabio

Configure Event Listener in Keycloak

I'm configuring a event listener in KeyCloak in a Wildfly 9.0.1.
I have created a .jar with two clases, implements a provider like Keycloak explains in his github's example.
In this example, Keycloak people explain it's necessary to register the provider editing "standalone/configuration/standalone.xml" and adding the module to the providers element.
I code this definition inside the tag "subsystem":
<spi name="eventsListener">
<provider name="my-event-listener" enabled="true">
<properties>
<property name="max" value="100" />
</properties>
</provider>
</spi>
When I start the server, it gives me a error like this:
ERROR [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0055: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: WFLYCTL0085: Failed to parse configuration
at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:131)
at org.jboss.as.server.ServerService.boot(ServerService.java:350)
at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:271)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.xml.stream.XMLStreamException: Unknown keycloak-server subsystem tag: spi
at org.keycloak.subsystem.server.extension.KeycloakSubsystemParser.readElement(KeycloakSubsystemParser.java:55)
at org.keycloak.subsystem.server.extension.KeycloakSubsystemParser.readElement(KeycloakSubsystemParser.java:39)
at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)
at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.handleAny(XMLExtendedStreamReaderImpl.java:69)
at org.jboss.as.server.parsing.StandaloneXml.parseServerProfile(StandaloneXml.java:1199)
at org.jboss.as.server.parsing.StandaloneXml.readServerElement_1_4(StandaloneXml.java:457)
at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:144)
at org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:106)
at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)
at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69)
at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:123)
... 3 more
FATAL [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0056: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.
Someone knows what is wrong? I need help.
Thanks you.
I think you must code your definition inside : <subsystem xmlns="urn:jboss:domain:keycloak-server:1.1">

EAR Content not Bounded Exception

I am using JBoss AS 5.0.1 and and I am getting the following error when i Try to Invoke my Servlet.
17:11:48,060 ERROR [STDERR] javax.naming.NameNotFoundException: EJBSvcApp not bound
I have Created an EAR by the Above name to which I have Added my EJB and Web Project.
I have also Included EJBClient in deployment assembly of my Web App. Below is the JBoss Log Trace. I also See a warning in the Log Which I am not sure what it is.
17:09:27,962 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext#457214762{vfszip:/C:/jboss- 5.0.1.GA/server/default/deploy/EJBSvcApp.ear/EJBSvcEJB.jar/}
17:09:27,963 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext#457214762{vfszip:/C:/jboss-5.0.1.GA/server/default/deploy/EJBSvcApp.ear/EJBSvcEJB.jar/}
17:09:27,963 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext#457214762{vfszip:/C:/jboss-5.0.1.GA/server/default/deploy/EJBSvcApp.ear/EJBSvcEJB.jar/}
7:09:27,986 WARN [Ejb3AnnotationHandler] JBMETA-4: did not find any bean meta data for annotation bean OrderBean, will create some
17:09:33,622 INFO [JBossASKernel] Created KernelDeployment for: EJBSvcEJB.jar
17:09:33,626 INFO [JBossASKernel] installing bean: jboss.j2ee:ear=EJBSvcApp.ear,jar=EJBSvcEJB.jar,name=OrderBean,service=EJB3
17:09:33,626 INFO [JBossASKernel] with dependencies:
17:09:33,626 INFO [JBossASKernel] and demands:
17:09:33,627 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
17:09:33,627 INFO [JBossASKernel] and supplies:
17:09:33,627 INFO [JBossASKernel] Class:com.webpage.ejb.Order
17:09:33,627 INFO [JBossASKernel] Added bean(jboss.j2ee:ear=EJBSvcApp.ear,jar=EJBSvcEJB.jar,name=OrderBean,service=EJB3) to KernelDeployment of: EJBSvcEJB.jar
17:09:33,776 INFO [SessionSpecContainer] Starting jboss.j2ee:ear=EJBSvcApp.ear,jar=EJBSvcEJB.jar,name=OrderBean,service=EJB3
17:09:33,786 INFO [EJBContainer] STARTED EJB: com.webpage.ejb.OrderBean ejbName: OrderBean
17:09:33,791 INFO [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:
17:09:33,850 WARN [WebServiceDeployerEJB] Ingore ejb deployment with null classname: org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData#6012d7fe{OrderBean}
17:09:33,928 INFO [TomcatDeployment] deploy, ctxPath=/EJBSvcWeb
I have Created An EJB INterface
#Remote()
public interface Order {...
and Bean
#Stateless(name = "OrderBean")
public class OrderBean implements Order { ...
I am making a lookup in My Servlet as below
Order o = (Order)(new InitialContext()).lookup("EJBSvcApp/OrderBean/remote");
I was curious about this part:
[Ejb3AnnotationHandler] JBMETA-4: did not find any bean meta data for annotation bean OrderBean, will create some
It seems to be that the problem is a Jboss AS 5.1.0 GA's bug.
If I understood the post correctly, the problem is originated because you have an empty META-INF/ejb-jar.xml file.
I would try to:
a) delete the file. (I think this will be enough).
b) or try to fill it with the next :
<ejb-jar version="3.0"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
</ejb-jar>