JBoss WildFly 11, Hibernate ORM 5.2, OGM 5.3 and MongoDB - OgmIntegrator not found - hibernate-ogm

Progressing slowly through trying to get Hibernate ORM 5.2 working with OGM 5.3 so I can use JPA with MongoDB.
To remove the JNDI look-up error, referenced in the OGM FAQs:
When using Hibernate OGM on top of WildFly, I’m getting a
JndiException. What’s wrong? In case you’re are seeing a JndiException
saying "Unable to lookup JNDI name [---PlaceHolderDSForOGM---]", your
application likely cannot access the application server module(s) of
Hibernate OGM.
To change this, add the following line to the META-INF/MANIFEST.MF
file of your archive (adapt it to match your chosen datastore):
Dependencies: org.hibernate:ogm services, org.hibernate.ogm.mongodb
services Alternatively, you can configure this via the descriptor
jboss-deployment-structure.xml. See the reference guide to learn more.
I created: jboss-deployment-structure.xml
containing:
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="org.hibernate.ogm" slot="5.3" services="export" />
<module name="org.hibernate.ogm.mongodb" slot="5.3" services="export" />
</dependencies>
</deployment>
</jboss-deployment-structure>
Now when I try to deploy my EAR through the WildFly 11 console I get:
17:58:42,921 ERROR [org.jboss.msc.service.fail] (ServerService Thread
Pool -- 65) 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.ogm.service.impl.OgmIntegrator not found 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:640)
at
org.jboss.as.jpa.service.PhaseOnePersistenceUnitServiceImpl$1.run(PhaseOnePersistenceUnitServiceImpl.java:137)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745) at
org.jboss.threads.JBossThread.run(JBossThread.java:320) Caused by:
java.util.ServiceConfigurationError:
org.hibernate.integrator.spi.Integrator: Provider
org.hibernate.ogm.service.impl.OgmIntegrator not found 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:372)
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:459)
at
org.hibernate.integrator.internal.IntegratorServiceImpl.(IntegratorServiceImpl.java:40)
at
org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.build(BootstrapServiceRegistryBuilder.java:224)
at
org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.buildBootstrapServiceRegistry(EntityManagerFactoryBuilderImpl.java:406)
at
org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.(EntityManagerFactoryBuilderImpl.java:196)
at
org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.(EntityManagerFactoryBuilderImpl.java:164)
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.(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)
... 7 more
17:58:42,926 ERROR [org.jboss.as.controller.management-operation]
(External Management Request Threads -- 1) WFLYCTL0013: Operation
("add") failed - address: ([("deployment" => "NOTiFYwell.ear")]) -
failure description: {"WFLYCTL0080: Failed services" =>
{"jboss.persistenceunit.\"NOTiFYwell.ear/NOTiFYwellJAR.jar#NOTiFYwellMongoDBPersistenceUnit\".FIRST_PHASE"
=> "java.util.ServiceConfigurationError: org.hibernate.integrator.spi.Integrator: Provider
org.hibernate.ogm.service.impl.OgmIntegrator not found
Caused by: java.util.ServiceConfigurationError: org.hibernate.integrator.spi.Integrator: Provider
org.hibernate.ogm.service.impl.OgmIntegrator not found"}} 17:58:42,927
ERROR [org.jboss.as.server] (External Management Request Threads -- 1)
WFLYSRV0021: Deploy of deployment "NOTiFYwell.ear" was rolled back
with the following failure message: {"WFLYCTL0080: Failed services"
=> {"jboss.persistenceunit.\"NOTiFYwell.ear/NOTiFYwellJAR.jar#NOTiFYwellMongoDBPersistenceUnit\".FIRST_PHASE"
=> "java.util.ServiceConfigurationError: org.hibernate.integrator.spi.Integrator: Provider
org.hibernate.ogm.service.impl.OgmIntegrator not found
Caused by: java.util.ServiceConfigurationError: org.hibernate.integrator.spi.Integrator: Provider
org.hibernate.ogm.service.impl.OgmIntegrator not found"}} 17:58:42,939
INFO [org.jboss.as.server.deployment] (MSC service thread 1-7)
WFLYSRV0208: Stopped subdeployment (runtime-name: NOTiFYwellJAR.jar)
in 10ms 17:58:42,942 INFO [org.jboss.as.server.deployment] (MSC
service thread 1-8) WFLYSRV0208: Stopped subdeployment (runtime-name:
NOTiFYwellWAR.war) in 13ms 17:58:42,952 INFO
[org.jboss.as.server.deployment] (MSC service thread 1-8) WFLYSRV0028:
Stopped deployment NOTiFYwell.ear (runtime-name: NOTiFYwell.ear) in
25ms
The error:
Provider org.hibernate.ogm.service.impl.OgmIntegrator not found
Refers to class OgmIntegrator found in:
org/hibernate/ogm/service/impl/OgmIntegrator.class under /usr/local/Cellar/wildfly-as/11.0.0.Final/libexec/modules/system/layers/base/org/hibernate/ogm/5.3/hibernate-ogm-core-5.3.0.Final.jar
Any ideas why this isn't being loaded? TIA

I think I figure out the problem, you need to use this:
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="org.hibernate.ogm" slot="5.3" services="export" />
<module name="org.hibernate.ogm.mongodb" slot="5.3" services="export" />
</dependencies>
</deployment>
</jboss-deployment-structure>
This exception
org.jboss.modules.ModuleNotFoundException: org.hibernate:5.3
means that you are using org.hibernate:5.3 instead of org.hibernate.ogm:5.3
The error might be in the jboss-deployment descriptor or in the MANIFEST.MF. Just make sure you are only using one or the other.
UPDATE: There was an error in the Hibernate website FAQ session, I updated it. Thanks for the feedback.

Finally got the EAR deployed.
It only deploys the EAR if I include a MANIFEST.MF in EAR's META-INF:
Manifest-Version: 1.0
Dependencies: org.hibernate.ogm:5.3 services, org.hibernate.ogm.mongodb:5.3 services
and remove 'jboss-deployment-structure.xml'.
If I try and use a 'jboss-deployment-structure.xml' (empty MANIFEST):
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="org.hibernate.ogm" slot="5.3" services="export" />
<module name="org.hibernate.ogm.mongodb" slot="5.3" services="export" />
</dependencies>
</deployment>
</jboss-deployment-structure>
It fails to deploy with the error I've had before:
17:31:53,892 ERROR [org.jboss.msc.service.fail] (ServerService Thread
Pool -- 30) 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.ogm.service.impl.OgmIntegrator not found 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:640)
at
org.jboss.as.jpa.service.PhaseOnePersistenceUnitServiceImpl$1.run(PhaseOnePersistenceUnitServiceImpl.java:137)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745) at
org.jboss.threads.JBossThread.run(JBossThread.java:320) Caused by:
java.util.ServiceConfigurationError:
org.hibernate.integrator.spi.Integrator: Provider
org.hibernate.ogm.service.impl.OgmIntegrator not found 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:372)
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:459)
at
org.hibernate.integrator.internal.IntegratorServiceImpl.(IntegratorServiceImpl.java:40)
at
org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.build(BootstrapServiceRegistryBuilder.java:224)
at
org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.buildBootstrapServiceRegistry(EntityManagerFactoryBuilderImpl.java:406)
at
org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.(EntityManagerFactoryBuilderImpl.java:196)
at
org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.(EntityManagerFactoryBuilderImpl.java:164)
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.(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)
... 7 more
17:31:53,908 ERROR [org.jboss.as.controller.management-operation]
(External Management Request Threads -- 3) WFLYCTL0013: Operation
("add") failed - address: ([("deployment" => "NOTiFYwell.ear")]) -
failure description: {"WFLYCTL0080: Failed services" =>
{"jboss.persistenceunit.\"NOTiFYwell.ear/NOTiFYwellJAR.jar#NOTiFYwellMongoDBPersistenceUnit\".FIRST_PHASE"
=> "java.util.ServiceConfigurationError: org.hibernate.integrator.spi.Integrator: Provider
org.hibernate.ogm.service.impl.OgmIntegrator not found
Caused by: java.util.ServiceConfigurationError: org.hibernate.integrator.spi.Integrator: Provider
org.hibernate.ogm.service.impl.OgmIntegrator not found"}} 17:31:53,909
ERROR [org.jboss.as.server] (External Management Request Threads -- 3)
WFLYSRV0021: Deploy of deployment "NOTiFYwell.ear" was rolled back
with the following failure message: {"WFLYCTL0080: Failed services"
=> {"jboss.persistenceunit.\"NOTiFYwell.ear/NOTiFYwellJAR.jar#NOTiFYwellMongoDBPersistenceUnit\".FIRST_PHASE"
=> "java.util.ServiceConfigurationError: org.hibernate.integrator.spi.Integrator: Provider
org.hibernate.ogm.service.impl.OgmIntegrator not found
Caused by: java.util.ServiceConfigurationError: org.hibernate.integrator.spi.Integrator: Provider
org.hibernate.ogm.service.impl.OgmIntegrator not found"}}
Mapped an enity to my MongoDB table and was able to return a 'List' of Entities.
Had to ensure Collection's id type was mapped as:
#Id
#Type(type = "objectid")
private String id;

Related

Message: Unexpected element 'context-root' encountered , Unable to deploy on jboss 7.3.10 | Default context root configuration on jboss-web.xml

Without context root tag, able to deploy on jboss server 7.3.10 and able to access application with default context root
War File Application
jboss-web.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
<context-root>MyApp</context-root>
</jboss-web>
With context root tag , getting below exception
10:54:28,163 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.deployment.unit."UtxQVAClient-1.0.0.war".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."UtxQVAClient-1.0.0.war".PARSE: WFLYSRV0153: Failed to process phase PARSE of deployment "UtxClient-1.0.0.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:183)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYUT0027: Failed to parse XML descriptor "/C:/Users/Applications/jboss-eap-7.3.10/jboss-eap-7.3/standalone/deployments/UtxClient-1.0.0.war/WEB-INF/web.xml" at [3,5]
at org.wildfly.extension.undertow.deployment.WebParsingDeploymentProcessor.deploy(WebParsingDeploymentProcessor.java:134)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:176)
... 8 more
**Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[3,5]
Message: Unexpected element 'context-root' encountered**
at org.jboss.metadata.parser.util.MetaDataElementParser.unexpectedElement(MetaDataElementParser.java:115)
at org.jboss.metadata.parser.servlet.WebMetaDataParser.parse(WebMetaDataParser.java:196)
at org.jboss.metadata.parser.servlet.WebMetaDataParser.parse(WebMetaDataParser.java:51)
at org.wildfly.extension.undertow.deployment.WebParsingDeploymentProcessor.deploy(WebParsingDeploymentProcessor.java:96)
... 9 more
This declaration shouldn't be in a "web.xml" file but in a jboss-web.xml file as it is jboss specific.

Webapp fails with "JBAS011232: Only one JAX-RS Application Class allowed" after adding a maven dependency to hadoop-azure

I have a webapp that runs fine in JBoss EAP 6.4. I want to add some functionality to my webapp so that it can process Parquet files that reside in AzureBlob storage. I add a single dependency to my pom.xml:
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-azure</artifactId>
<version>3.1.0</version>
</dependency>
If I now try to start my webapp, it fails at start up:
09:29:43,703 ERROR [org.jboss.msc.service.fail] (MSC service thread
1-10) MSC000001: Failed to start service
jboss.deployment.unit."myApp-0.0.1-SNAPSHOT.war".POST_MODULE:
org.jboss.msc.service.StartException in service
jboss.deployment.unit."myApp-0.0.1-SNAPSHOT.war".POST_MODULE:
JBAS018733: Failed to process phase POST_MODULE of deployment
"myApp-0.0.1-SNAPSHOT.war" at
org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166)
[jboss-as-server-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21] at
org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980)
[jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
... Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException:
JBAS011232: Only one JAX-RS Application Class allowed.
com.sun.jersey.api.core.ResourceConfig
com.sun.jersey.api.core.DefaultResourceConfig
com.sun.jersey.api.core.PackagesResourceConfig
com.mycompany.myapp.rest.RestApplication
com.sun.jersey.api.core.ClassNamesResourceConfig
com.sun.jersey.api.core.ScanningResourceConfig
com.sun.jersey.api.core.servlet.WebAppResourceConfig
com.sun.jersey.api.core.ApplicationAdapter
com.sun.jersey.server.impl.application.DeferredResourceConfig
com.sun.jersey.api.core.ClasspathResourceConfig at
org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.scan(JaxrsScanningProcessor.java:206)
at
org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.deploy(JaxrsScanningProcessor.java:104)
at
org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159)
[jboss-as-server-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21] ...
5 more
09:29:43,709 ERROR [org.jboss.as.controller.management-operation]
(Controller Boot Thread) JBAS014612: Operation ("deploy") failed -
address: ([("deployment" => "myApp-0.0.1-SNAPSHOT.war")]) - failure
description: {"JBAS014671: Failed services" =>
{"jboss.deployment.unit."myApp-0.0.1-SNAPSHOT.war".POST_MODULE" =>
"org.jboss.msc.service.StartException in service
jboss.deployment.unit."myApp-0.0.1-SNAPSHOT.war".POST_MODULE:
JBAS018733: Failed to process phase POST_MODULE of deployment
"myApp-0.0.1-SNAPSHOT.war"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException:
JBAS011232: Only one JAX-RS Application Class allowed.
com.sun.jersey.api.core.ResourceConfig
com.sun.jersey.api.core.DefaultResourceConfig
com.sun.jersey.api.core.PackagesResourceConfig
com.mycompany.myapp.rest.RestApplication
com.sun.jersey.api.core.ClassNamesResourceConfig
com.sun.jersey.api.core.ScanningResourceConfig
com.sun.jersey.api.core.servlet.WebAppResourceConfig
com.sun.jersey.api.core.ApplicationAdapter
com.sun.jersey.server.impl.application.DeferredResourceConfig
com.sun.jersey.api.core.ClasspathResourceConfig"}}
The message "JBAS011232: Only one JAX-RS Application Class allowed" seems to be caused by my webapp trying to use both RestEasy and Jersey. JBoss uses RestEasy by default. Apparently, hadoop-azure must have a Jersey application class. How can I eliminate this problem by indicating that I don't want to use the Jersey-based application class?
hadoop-azure pulls in hadoop-common, which pulls in Jersey. In the version of hadoop-azure you're using, hadoop-common is in compile <scope>. In new version, it is in provided scope. So you can just upgrade the hadoop-azure dependency to the latest one. If you need hadoop-common to compile, then you can redeclare hadoop-common and put it in provided scope.

org.hibernate.integrator.spi.Integrator: Provider org.hibernate.envers.boot.internal.EnversIntegrator not a subtype

I am migrating my java web application from Jboss 7.1.1 Final to Wildfly 10,using :
spring 4.2.0,
hibernate 5.0.7,
jpa 2.1
and Mysql database.
I getting the following error while trying to run my code.
2016-07-20 19:30:50,176 ERROR [org.jboss.msc.service.fail]
(ServerService Thread Pool -- 61) MSC000001: Failed to start service
jboss.persistenceunit."ccp-ear-1.0-SNAPSHOT.ear/ccp-entities-1.0-SNAPSHOT.jar#ccpPU":
org.jboss.msc.service.StartException in service
jboss.persistenceunit."ccp-ear-1.0-SNAPSHOT.ear/ccp-entities-1.0-SNAPSHOT.jar#ccpPU":
java.util.ServiceConfigurationError: org.hibernate.integrator.spi.Integrator: Provider
org.hibernate.envers.boot.internal.EnversIntegrator not a subtype
at
org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:172)
at
org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117)
at
org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:667)
at
org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745) at
org.jboss.threads.JBossThread.run(JBossThread.java:320) 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:324)
at
org.hibernate.integrator.internal.IntegratorServiceImpl.(IntegratorServiceImpl.java:40)
at
org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.build(BootstrapServiceRegistryBuilder.java:213)
at
org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.buildBootstrapServiceRegistry(EntityManagerFactoryBuilderImpl.java:365)
at
org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.(EntityManagerFactoryBuilderImpl.java:166)
at
org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:34)
at
org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilder(HibernatePersistenceProvider.java:165)
at
org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilder(HibernatePersistenceProvider.java:160)
at
org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:135)
at
org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:318)
at
org.jboss.as.jpa.service.PersistenceUnitServiceImpl.access$1100(PersistenceUnitServiceImpl.java:67)
at
org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:167)
... 7 more
You need to delete the hibernate.cfg.xml and move the configuration from this file to persistence.xml.
Then You have also to remove all hibernate files from WEB-INF/lib folder, because WildFly has its own ones and this situation also possibly made a conflict.
More details on this problem in this link : JBoss Community Forum
I also had a similar issue with Wildfly 10.0.0.Final. In my project also we have all hibernate related libraries within the project's lib directory. But the jboss provided libraries caused conflicts so i have removed the content within the tag <module xmlns="urn:jboss:module:1.3" name="org.hibernate"> in module.xml file available in JBOSS_HOME\modules\system\layers\base\org\hibernate\main directory. Also i have removed the dependencies of hibernate libraries in jboss-deployment-struture.xml as,
<exclusions>
<module name="org.hibernate" slot="main"/>
</exclusions>
After these changes i can able overcome the conflict issues related to hibernate.Hope this will help.
Please note jboss-deployment-struture.xml change alone has not resolved my issue the change mentioned on module.xml file is mandatory.

JBoss AS 7 not using WEB-INF hibernate lib and throwing "Unknown service requested [org.hibernate.boot.registry.classloading.spi.ClassLoaderService]"

I'm migrating a Spring+Hibernate application from Weblogic 12c to JBoss AS 7, and I'm getting the following error:
20:07:47,395 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.persistenceunit."connecta-presenter-2.2.1.war#ConnectaPresenterPU": org.jboss.msc.service.StartException in service jboss.persistenceunit."connecta-presenter-2.2.1.war#ConnectaPresenterPU": Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_95]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_95]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_95]
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: ConnectaPresenterPU] Unable to build EntityManagerFactory
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:914)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:889)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:162)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:85)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
... 3 more
Caused by: org.hibernate.service.UnknownServiceException: Unknown service requested [org.hibernate.boot.registry.classloading.spi.ClassLoaderService]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:126)
at org.hibernate.search.hcore.impl.HibernateSearchIntegrator.integrate(HibernateSearchIntegrator.java:49)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:294)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1737)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:84)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904)
... 9 more
The Unknown service requested [org.hibernate.boot.registry.classloading.spi.ClassLoaderService] message thrown by line 126 of org.hibernate.service.internal.AbstractServiceRegistryImpl is an exception thrown only in version 4.0.1 of Hibernate Core, which is the version that is in my JBoss AS 7 modules folder.
The thing is that my application uses Hibernate 4.3.10, and this specific line doesn't exist more in this version (I could see comparing the source code on Github).
The following documentation on JBoss AS 7 site states that when you migrate from Weblogic to JBoss:
https://docs.jboss.org/author/display/AS72/How+do+I+migrate+my+application+from+WebLogic+to+AS+7#HowdoImigratemyapplicationfromWebLogictoAS7-Migrateweblogic.xmlDescriptorFileConfigurations
So there's no such code as the following in jboss-web.xml file:
<prefer-application-packages>
<package-name>javassist.*</package-name>
</prefer-application-packages>
It says that JBoss always uses WEB-INF/classes and WEB-INF/lib before the internal modules.
Any idea of what's happening?
If you want to use your own specific version of Hibernate (or any other service/software for that matter), you can do that instead of depending on JBoss AS 7 modules.
Create a new folder structure, say org/myhibernate/main in your $JBOSS_HOME\modules\system\layers\base\ directory. Put the needed jar (say my.jar) in the main folder and create a module.xml file like this:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.myhibernate">
<resources>
<!-- Modules -->
<resource-root path="my.jar" />
</resources>
<dependencies>
<module name="javax.api"/>
<module name="sun.jdk"/>
</dependencies>
</module>
Now create a jboss-deployment-structure.xml in your EAR/web folder in your workspace and include this dependency -
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<sub-deployment name="yourfile.war">
<dependencies>
<module name="org.myhibernate" />
</dependencies>
</sub-deployment>
</jboss-deployment-structure>

Problems once migrate jsf 1.2 to jsf 2.2.12

I am migrating project from jsf 1.2 to jsf 2.2.12. After built successful, I deployed to the jboss 7 server and got error message like that:
14:14:10,255 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.deployment.unit."myproject-war.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."myproject-war.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "myproject-war.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_80]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_80]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_80]
Caused by: java.lang.RuntimeException: Error getting reflective information for class org.richfaces.taglib.ColumnsTag with ClassLoader ModuleClassLoader for Module "deployment.myproject-war.war:main" from Service Module Loader
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:58)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:85)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:70)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:55)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 5 more
Caused by: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "javax.faces.webapp.UIComponentClassicTagBase.getParent()Ljavax/servlet/jsp/tagext/Tag;" the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, org/richfaces/taglib/ColumnsTag, and the class loader (instance of org/jboss/modules/ModuleClassLoader) for interface javax/servlet/jsp/tagext/Tag have different Class objects for the type ervlet/jsp/tagext/Tag; used in the signature
at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.7.0_80]
at java.lang.Class.privateGetDeclaredFields(Class.java:2509) [rt.jar:1.7.0_80]
at java.lang.Class.getDeclaredFields(Class.java:1819) [rt.jar:1.7.0_80]
at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 10 more
14:14:10,286 INFO [org.jboss.as.server] (management-handler-thread - 2) JBAS015870: Deploy of deployment "myproject-war.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"myproject-war.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"myproject-war.war\".POST_MODULE: Failed to process phase POST_MODULE of deployment \"myproject-war.war\""}}
14:14:10,484 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015877: Stopped deployment myproject-war.war in 198ms
14:14:10,486 INFO [org.jboss.as.controller] (management-handler-thread - 2) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.deployment.unit."myproject-war.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."myproject-war.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "myproject-war.war"
[2015-09-30 02:14:10,579] Artifact myproject-war:war exploded: Error during artifact deployment. See server log for details.
[2015-09-30 02:14:10,579] Artifact myproject-war:war exploded: java.lang.Exception: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"myproject-war.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"myproject-war.war\".POST_MODULE: Failed to process phase POST_MODULE of deployment \"myproject-war.war\""}}
Could you have any idea for this one?
Here are my system detail:
Server: jboss7
Current libs: jsf 1.2, richfaces 3.3.3
Migration libs: jsf 2.2.17
Build: maven
Best regards,
Caused by: java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "javax.faces.webapp.UIComponentClassicTagBase.getParent()Ljavax/servlet/jsp/tagext/Tag;" the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, org/richfaces/taglib/ColumnsTag, and the class loader (instance of org/jboss/modules/ModuleClassLoader) for interface javax/servlet/jsp/tagext/Tag have different Class objects for the type ervlet/jsp/tagext/Tag; used in the signature
java.lang.LinkageError is sign of classpath pollution with multiple different versioned libraries. You'd best let Maven produce a WAR file and then inspect its /WEB-INF/lib for any libraries which doesn't belong there (i.e. libraries which are supposed to be already provided by the target server, such as Java EE, JSP, Servlet, JSF, etc.. in your case with JBoss AS). Then fix the Maven pom.xml accordingly to mark exactly those as provided.
The particular one you got suggests a duplicated javax.servlet.jsp.* API. You'll in /WEB-INF/lib most likely have a jsp-api.jar or another JAR which covers this (e.g. javaee.jar). In that case, you need to mark exactly that dependency in pom.xml as provided. Or, if it's actually jsp-api, then just remove it altogether and use a single javaee-api or javaee-web-api dependency with version 6.0 and scope provided which covers the entire Java EE 6 (Web profile) already, exactly as done by JBoss AS 7.

Resources