Hello everybody.
I'm developming a JEE application is using this gralde dependency:
Quote:
compile group: 'org.hibernate.ogm', name: 'hibernate-ogm-mongodb', version: '4.2.0.Final'
Otherwise, my mongodb version is 2.6.
When I'm trying to deploy my appication on Wildfly 8.2.0.Final, it tells me: NoSuchFieldError: ERRORS_IGNORED
I don't know what I'm doint wrong...
Could you help me, please?
I dump you full stacktrace message:
Quote:
12:52:12,619 INFO [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "living.war" (runtime-name: "living.war")
12:52:15,438 INFO [org.jboss.as.jpa] (MSC service thread 1-8) JBAS011401: Read persistence.xml for mongo
12:52:15,518 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 74) JBAS011402: Starting Persistence Unit Service 'living.war#mongo'
12:52:15,525 INFO [org.hibernate.jpa.internal.util.LogHelper] (ServerService Thread Pool -- 74) HHH000204: Processing PersistenceUnitInfo [
name: mongo
...]
12:52:15,556 INFO [org.hibernate.Version] (ServerService Thread Pool -- 74) HHH000412: Hibernate Core {4.3.9.Final}
12:52:15,558 INFO [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 74) HHH000206: hibernate.properties not found
12:52:15,559 INFO [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 74) HHH000021: Bytecode provider name : javassist
12:52:15,619 INFO [org.hibernate.annotations.common.Version] (ServerService Thread Pool -- 74) HCANN000001: Hibernate Commons Annotations {4.0.5.Final}
12:52:15,638 INFO [org.hibernate.ogm.datastore.impl.DatastoreProviderInitiator] (ServerService Thread Pool -- 74) OGM000016: NoSQL Datastore provider: org.hibernate.ogm.datastore.mongodb.impl.MongoDBDatastoreProvider
12:52:15,645 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 74) MSC000001: Failed to start service jboss.persistenceunit."living.war#mongo": org.jboss.msc.service.StartException in service jboss.persistenceunit."living.war#mongo": java.lang.NoSuchFieldError: ERRORS_IGNORED
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:172) [wildfly-jpa-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117) [wildfly-jpa-8.2.0.Final.jar:8.2.0.Final]
at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.8.0_45]
at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:474)
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182) [wildfly-jpa-8.2.0.Final.jar:8.2.0.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_45]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_45]
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: java.lang.NoSuchFieldError: ERRORS_IGNORED
at org.hibernate.ogm.datastore.mongodb.options.WriteConcernType.<clinit>(WriteConcernType.java:27) [hibernate-ogm-mongodb-4.2.0.Final.jar:4.2.0.Final]
at org.hibernate.ogm.datastore.mongodb.options.impl.WriteConcernOption.<clinit>(WriteConcernOption.java:29) [hibernate-ogm-mongodb-4.2.0.Final.jar:4.2.0.Final]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.8.0_45]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [rt.jar:1.8.0_45]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.8.0_45]
at java.lang.reflect.Constructor.newInstance(Constructor.java:422) [rt.jar:1.8.0_45]
at java.lang.Class.newInstance(Class.java:442) [rt.jar:1.8.0_45]
at org.hibernate.ogm.options.navigation.source.impl.ConfigurationOptionValueSource$ConfigurationBasedOptionContainer.getAll(ConfigurationOptionValueSource.java:81) [hibernate-ogm-core-4.2.0.Final.jar:4.2.0.Final]
at org.hibernate.ogm.options.navigation.impl.OptionsContextImpl.getMostSpecificContainer(OptionsContextImpl.java:138) [hibernate-ogm-core-4.2.0.Final.jar:4.2.0.Final]
at org.hibernate.ogm.options.navigation.impl.OptionsContextImpl.getAndCacheOptionsContainer(OptionsContextImpl.java:93) [hibernate-ogm-core-4.2.0.Final.jar:4.2.0.Final]
at org.hibernate.ogm.options.navigation.impl.OptionsContextImpl.getUnique(OptionsContextImpl.java:75) [hibernate-ogm-core-4.2.0.Final.jar:4.2.0.Final]
at org.hibernate.ogm.datastore.mongodb.configuration.impl.MongoDBConfiguration.<init>(MongoDBConfiguration.java:75) [hibernate-ogm-mongodb-4.2.0.Final.jar:4.2.0.Final]
at org.hibernate.ogm.datastore.mongodb.impl.MongoDBDatastoreProvider.configure(MongoDBDatastoreProvider.java:77) [hibernate-ogm-mongodb-4.2.0.Final.jar:4.2.0.Final]
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111) [hibernate-core-4.3.9.Final.jar:4.3.9.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234) [hibernate-core-4.3.9.Final.jar:4.3.9.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206) [hibernate-core-4.3.9.Final.jar:4.3.9.Final]
at org.hibernate.ogm.dialect.impl.GridDialectInitiator.initiateService(GridDialectInitiator.java:50) [hibernate-ogm-core-4.2.0.Final.jar:4.2.0.Final]
at org.hibernate.ogm.dialect.impl.GridDialectInitiator.initiateService(GridDialectInitiator.java:34) [hibernate-ogm-core-4.2.0.Final.jar:4.2.0.Final]
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:105) [hibernate-core-4.3.9.Final.jar:4.3.9.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:251) [hibernate-core-4.3.9.Final.jar:4.3.9.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:225) [hibernate-core-4.3.9.Final.jar:4.3.9.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206) [hibernate-core-4.3.9.Final.jar:4.3.9.Final]
at org.hibernate.ogm.dialect.impl.OgmDialectFactoryInitiator$OgmDialectFactory.<init>(OgmDialectFactoryInitiator.java:44) [hibernate-ogm-core-4.2.0.Final.jar:4.2.0.Final]
at org.hibernate.ogm.dialect.impl.OgmDialectFactoryInitiator.initiateService(OgmDialectFactoryInitiator.java:31) [hibernate-ogm-core-4.2.0.Final.jar:4.2.0.Final]
at org.hibernate.ogm.dialect.impl.OgmDialectFactoryInitiator.initiateService(OgmDialectFactoryInitiator.java:25) [hibernate-ogm-core-4.2.0.Final.jar:4.2.0.Final]
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:105) [hibernate-core-4.3.9.Final.jar:4.3.9.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:251) [hibernate-core-4.3.9.Final.jar:4.3.9.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:225) [hibernate-core-4.3.9.Final.jar:4.3.9.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206) [hibernate-core-4.3.9.Final.jar:4.3.9.Final]
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:95) [hibernate-core-4.3.9.Final.jar:4.3.9.Final]
at org.hibernate.ogm.service.impl.OgmJdbcServicesInitiator$OgmJdbcServicesImpl.configure(OgmJdbcServicesInitiator.java:50) [hibernate-ogm-core-4.2.0.Final.jar:4.2.0.Final]
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111) [hibernate-core-4.3.9.Final.jar:4.3.9.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234) [hibernate-core-4.3.9.Final.jar:4.3.9.Final]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206) [hibernate-core-4.3.9.Final.jar:4.3.9.Final]
at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1887) [hibernate-core-4.3.9.Final.jar:4.3.9.Final]
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1845) [hibernate-core-4.3.9.Final.jar:4.3.9.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:857) [hibernate-entitymanager-4.3.9.Final.jar:4.3.9.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850) [hibernate-entitymanager-4.3.9.Final.jar:4.3.9.Final]
at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:425) [hibernate-core-4.3.9.Final.jar:4.3.9.Final]
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:849) [hibernate-entitymanager-4.3.9.Final.jar:4.3.9.Final]
at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:152) [hibernate-entitymanager-4.3.9.Final.jar:4.3.9.Final]
at org.hibernate.ogm.jpa.HibernateOgmPersistence.createContainerEntityManagerFactory(HibernateOgmPersistence.java:105) [hibernate-ogm-core-4.2.0.Final.jar:4.2.0.Final]
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:318) [wildfly-jpa-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.access$1100(PersistenceUnitServiceImpl.java:67) [wildfly-jpa-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:167) [wildfly-jpa-8.2.0.Final.jar:8.2.0.Final]
... 8 more
12:52:15,648 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 1) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "living.war")]) - failure description: {"JBAS014671: Failed services" => {"jboss.persistenceunit.\"living.war#mongo\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"living.war#mongo\": java.lang.NoSuchFieldError: ERRORS_IGNORED
Caused by: java.lang.NoSuchFieldError: ERRORS_IGNORED"}}
12:52:15,648 ERROR [org.jboss.as.server] (management-handler-thread - 1) JBAS015870: Deploy of deployment "living.war" was rolled back with the following failure message:
{"JBAS014671: Failed services" => {"jboss.persistenceunit.\"living.war#mongo\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"living.war#mongo\": java.lang.NoSuchFieldError: ERRORS_IGNORED
Caused by: java.lang.NoSuchFieldError: ERRORS_IGNORED"}}
12:52:15,688 INFO [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015877: Stopped deployment living.war (runtime-name: living.war) in 40ms
12:52:15,689 INFO [org.jboss.as.controller] (management-handler-thread - 1) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.persistenceunit."living.war#mongo"
My persistence.xml file:
Code:
<?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="mongo" transaction-type="JTA">
<provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>
<class>com.living.persistence.entities.User</class>
<properties>
<!-- Configure Hibernate OGM to mount Infinispan -->
<!-- <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform" /> -->
<property name="hibernate.ogm.datastore.provider" value="org.hibernate.ogm.datastore.mongodb.impl.MongoDBDatastoreProvider"/>
<property name="hibernate.ogm.datastore.database" value="lvng"/>
<property name="hibernate.ogm.datastore.host" value="192.168.3.67"/>
<property name="hibernate.ogm.datastore.port" value="27017"/>
<property name="hibernate.ogm.mongodb.connection_timeout" value="5000"></property>
<property name="hibernate.ogm.mongodb.authentication_mechanism" value="PLAIN"></property>
<property name="hibernate.ogm.datastore.document.association_storage" value="IN_ENTITY"></property>
<property name="hibernate.ogm.mongodb.association_document_storage" value="GLOBAL_COLLECTION"></property>
<property name="hibernate.ogm.mongodb.write_concern" value="MAJORITY"></property>
<property name="hibernate.ogm.mongodb.read_preference" value="PRIMARY_PREFERRED"></property>
<!-- <property name="hibernate.search.default.directory_provider" value="filesystem"/>
<property name="hibernate.search.default.indexBase" value="/tmp/.hibernate_ogm_demo_luceneindexes"/>-->
</properties>
</persistence-unit>
</persistence>