Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Mongo 2.6 NoSuchFieldError: ERRORS_IGNORED
PostPosted: Thu Jun 18, 2015 6:55 am 
Newbie

Joined: Thu Jun 18, 2015 6:44 am
Posts: 2
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>


Top
 Profile  
 
 Post subject: Re: Mongo 2.6 NoSuchFieldError: ERRORS_IGNORED
PostPosted: Fri Jun 19, 2015 3:52 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I looks like you are using MongoDB Driver 3.0 in your application. Stick with MongoDB driver 2.13.x which is the version Hibernate OGM uses.
You can access both MongoDB 2.x and 3.0 databases with that combination.

I have created a FAQ entry to explain all this http://hibernate.org/ogm/faq/#using-mongodb-i-get-a-code-java-lang-nosuchfielderror-errors_ignored-code-exception

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Re: Mongo 2.6 NoSuchFieldError: ERRORS_IGNORED
PostPosted: Fri Jun 19, 2015 5:43 am 
Newbie

Joined: Thu Jun 18, 2015 6:44 am
Posts: 2
Thanks a lot Emmanuel.

It's really as you has explained.

I don't know why my gradle script resolves to the last mongo-java-driver version (3.0.2)

Quote:
dependencies {
providedCompile group: 'javax', name: 'javaee-api', version:'7.0'

compile group: 'org.hibernate.ogm', name: 'hibernate-ogm-mongodb', version: '4.2.0.Final'
compile group: 'javax.validation', name:'validation-api', version:'1.1.0.Final'
compile group: 'com.fasterxml.jackson.jaxrs', name:'jackson-jaxrs-json-provider', version:'2.5.3'
compile group: 'org.elasticsearch', name:'elasticsearch', version: '1.5.2'
compile group: 'commons-configuration', name: 'commons-configuration', version: '1.10'
compile group: 'io.swagger', name: 'swagger-jaxrs', version: '1.5.0'

compile project(':living_lib')
}


As you can see, I only add the hibernate-ogm-mongodb dependency...
Could it be a problem related with your pom?

Thanks for all.


Top
 Profile  
 
 Post subject: Re: Mongo 2.6 NoSuchFieldError: ERRORS_IGNORED
PostPosted: Fri Jun 19, 2015 2:18 pm 
Hibernate Team
Hibernate Team

Joined: Sat Jan 24, 2009 12:46 pm
Posts: 386
Hi,

org.hibernate.ogm:hibernate-ogm-mongodb:4.2.0.Final depends on org.mongodb:mongo-java-driver:2.13.1. Can you run ./gradlew dependencies and see whether that shows the MongoDB driver 3.0 somewhere? Maybe you pull it in transitively via compile project(':living_lib')?

--Gunnar

_________________
Visit my blog at http://musingsofaprogrammingaddict.blogspot.com/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.