-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: Hibernate OGM 4.1 Wildfly 8.1 MongoDB cant persist entity
PostPosted: Tue Jun 24, 2014 8:55 pm 
Newbie

Joined: Tue Jun 24, 2014 8:05 pm
Posts: 3
I can persist en simple entity

i add modules to wildfly

configure jpa with persistence.xml in WEB-INF/clases/META-INF

Is my fist post if someone need aditional info please tell me

Code:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
             version="2.0">

    <persistence-unit name="mongoUnit" transaction-type="JTA">
        <!-- Use Hibernate OGM provider: configuration will be transparent -->
        <provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>
        <class>com.ultimate.prediction.entity.Game</class>
        <properties>

            <property name="hibernate.transaction.jta.platform"
                      value="org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform"/>



            <property name="hibernate.ogm.datastore.provider"
                      value="mongodb" />
            <property name="hibernate.ogm.datastore.grid_dialect"
                      value="org.hibernate.ogm.dialect.mongodb.MongoDBDialect"/>
            <property name="hibernate.ogm.datastore.host"
                      value="127.0.0.1" />
            <property name="hibernate.ogm.datastore.port"
                      value="27017" />
            <property name="hibernate.ogm.datastore.database"
                      value="clickgoal" />
        </properties>
    </persistence-unit>
</persistence>






Entity
Code:
package com.ultimate.prediction.entity;

import org.hibernate.ogm.datastore.mongodb.options.WriteConcern;
import org.hibernate.ogm.datastore.mongodb.options.WriteConcernType;

import javax.persistence.*;
import java.io.Serializable;

/**
* Created by gustavo on 23/06/14.
*/

@Entity
@Table(name = "Games")
public class Game implements Serializable{
    @Id
    private String id;
    @Column(name = "equipo")
    private String equipo;

    public Game() {
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getEquipo() {
        return equipo;
    }

    public void setEquipo(String equipo) {
        this.equipo = equipo;
    }
}



boundary

Code:
package com.ultimate.prediction.boundary;

import com.ultimate.prediction.entity.Game;

import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.inject.Named;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.PersistenceUnit;

/**
* Created by gustavo on 23/06/14.
*/
@Stateless
@LocalBean
@Named
public class PreditionAdmin {
    @PersistenceContext(unitName = "mongoUnit")
    EntityManager em;

    public PreditionAdmin() {
    }

    @TransactionAttribute(value = TransactionAttributeType.REQUIRES_NEW)
    public void persistir(){
        Game g = new Game();
        g.setId("Hola");
        g.setEquipo("equiopo");
        em.persist(g);
        em.flush();
    }
}



Log
Code:
19:21:42,060 ERROR [org.jboss.as.ejb3.invocation] (default task-12) JBAS014134: EJB Invocation failed on component PreditionAdmin for method public void com.ultimate.prediction.boundary.PreditionAdmin.persistir(): javax.ejb.EJBException: JBAS014580: Unexpected Error
   at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:187) [wildfly-ejb3-8.1.0.Final.jar:8.1.0.Final]
   at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275) [wildfly-ejb3-8.1.0.Final.jar:8.1.0.Final]
   at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:369) [wildfly-ejb3-8.1.0.Final.jar:8.1.0.Final]
   at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:241) [wildfly-ejb3-8.1.0.Final.jar:8.1.0.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
   at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [wildfly-ejb3-8.1.0.Final.jar:8.1.0.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
   at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43) [wildfly-ejb3-8.1.0.Final.jar:8.1.0.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
   at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:95) [wildfly-ejb3-8.1.0.Final.jar:8.1.0.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
   at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64) [wildfly-ejb3-8.1.0.Final.jar:8.1.0.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
   at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [wildfly-ejb3-8.1.0.Final.jar:8.1.0.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
   at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
   at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55) [wildfly-ejb3-8.1.0.Final.jar:8.1.0.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
   at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
   at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)
   at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:448)
   at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
   at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)
   at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
   at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
   at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:185)
   at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:182)
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
   at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
   at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:73)
   at com.ultimate.prediction.boundary.PreditionAdmin$$$view1.persistir(Unknown Source) [classes:]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_25]
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_25]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_25]
   at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_25]
   at org.jboss.weld.util.reflection.Reflections.invokeAndUnwrap(Reflections.java:401) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
   at org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.invoke(EnterpriseBeanProxyMethodHandler.java:99) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
   at org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:56) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
   at org.jboss.weld.bean.proxy.InjectionPointPropagatingEnterpriseTargetBeanInstance.invoke(InjectionPointPropagatingEnterpriseTargetBeanInstance.java:65) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
   at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:100) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
   at com.ultimate.prediction.boundary.PreditionAdmin$Proxy$_$$_Weld$EnterpriseProxy$.persistir(Unknown Source) [classes:]
   at com.ultimate.prediction.view.PredictionController.guardar(PredictionController.java:24) [classes:]
   at com.ultimate.prediction.view.PredictionController$Proxy$_$$_WeldClientProxy.guardar(Unknown Source) [classes:]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_25]
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_25]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_25]
   at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_25]
   at javax.el.ELUtil.invokeMethod(ELUtil.java:308) [jboss-el-api_3.0_spec-1.0.3.Final.jar:1.0.3.Final]
   at javax.el.BeanELResolver.invoke(BeanELResolver.java:537) [jboss-el-api_3.0_spec-1.0.3.Final.jar:1.0.3.Final]
   at javax.el.CompositeELResolver.invoke(CompositeELResolver.java:256) [jboss-el-api_3.0_spec-1.0.3.Final.jar:1.0.3.Final]
   at com.sun.el.parser.AstValue.invoke(AstValue.java:269) [javax.el-3.0.0.jar:]
   at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:304) [javax.el-3.0.0.jar:]
   at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
   at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
   at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:40) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
   at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:50) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
   at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105) [jsf-impl-2.2.6-jbossorg-4.jar:]
   at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:147) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
   at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
   at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:813) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
   at javax.faces.component.UICommand.broadcast(UICommand.java:300) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
   at com.sun.faces.facelets.component.UIRepeat.broadcast(UIRepeat.java:1045) [jsf-impl-2.2.6-jbossorg-4.jar:]
   at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
   at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
   at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) [jsf-impl-2.2.6-jbossorg-4.jar:]
   at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [jsf-impl-2.2.6-jbossorg-4.jar:]
   at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198) [jsf-impl-2.2.6-jbossorg-4.jar:]
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646) [jboss-jsf-api_2.2_spec-2.2.6.jar:2.2.6]
   at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
   at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
   at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
   at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
   at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
   at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
   at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
   at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
   at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
   at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
   at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
   at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
   at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
   at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
   at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
   at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
   at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
   at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
   at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
   at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
   at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146) [undertow-servlet-1.0.15.Final.jar:1.0.15.Final]
   at io.undertow.server.Connectors.executeRootHandler(Connectors.java:177) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
   at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:727) [undertow-core-1.0.15.Final.jar:1.0.15.Final]
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]
   at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
Caused by: java.lang.AbstractMethodError: org.hibernate.ogm.dialect.mongodb.MongoDBDialect.createTuple(Lorg/hibernate/ogm/grid/EntityKey;Lorg/hibernate/ogm/datastore/spi/TupleContext;)Lorg/hibernate/ogm/datastore/spi/Tuple;
   at org.hibernate.ogm.persister.OgmEntityPersister.createNewResultSetIfNull(OgmEntityPersister.java:945) [hibernate-ogm-core-4.1.0.Beta4.jar:4.1.0.Beta4]
   at org.hibernate.ogm.persister.OgmEntityPersister.insert(OgmEntityPersister.java:921) [hibernate-ogm-core-4.1.0.Beta4.jar:4.1.0.Beta4]
   at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:104) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:463) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:349) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:350) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:56) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1222) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.jpa.spi.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:1335) [hibernate-entitymanager-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.ogm.jpa.impl.OgmEntityManager.flush(OgmEntityManager.java:118) [hibernate-ogm-core-4.1.0.Beta4.jar:4.1.0.Beta4]
   at org.jboss.as.jpa.container.AbstractEntityManager.flush(AbstractEntityManager.java:457) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]
   at com.ultimate.prediction.boundary.PreditionAdmin.persistir(PreditionAdmin.java:33) [classes:]
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_25]
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_25]
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_25]
   at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_25]
   at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
   at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
   at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
   at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)
   at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82) [wildfly-weld-8.1.0.Final.jar:8.1.0.Final]
   at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93) [wildfly-weld-8.1.0.Final.jar:8.1.0.Final]
   at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
   at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
   at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
   at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43) [wildfly-ejb3-8.1.0.Final.jar:8.1.0.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
   at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
   at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)
   at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:46) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
   at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83) [wildfly-weld-8.1.0.Final.jar:8.1.0.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
   at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45) [wildfly-ee-8.1.0.Final.jar:8.1.0.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
   at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
   at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
   at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53)
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
   at org.jboss.as.ejb3.component.interceptors.NonPooledEJBComponentInstanceAssociatingInterceptor.processInvocation(NonPooledEJBComponentInstanceAssociatingInterceptor.java:59) [wildfly-ejb3-8.1.0.Final.jar:8.1.0.Final]
   at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
   at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:273) [wildfly-ejb3-8.1.0.Final.jar:8.1.0.Final]
   ... 96 more


Top
 Profile  
 
 Post subject: Re: Hibernate OGM 4.1 Wildfly 8.1 MongoDB cant persist entity
PostPosted: Wed Jun 25, 2014 4:46 am 
Hibernate Team
Hibernate Team

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

This looks as if something with the modules of your WildFly server isn't right. Can you make sure that you're working with hibernate-ogm-mongodb-4.1.0.Beta4.jar and not an older version? The method createTuple() has changed a while ago, but it has its current signature since Beta2.

--Gunnar

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


Top
 Profile  
 
 Post subject: Re: Hibernate OGM 4.1 Wildfly 8.1 MongoDB cant persist entity
PostPosted: Wed Jun 25, 2014 10:53 am 
Newbie

Joined: Tue Jun 24, 2014 8:05 pm
Posts: 3
Hi

this are my modules with its respective jars

../wildfly-8.1.0.Final/modules/system/layers/base/org/hibernate/ogm/mongodb/main

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Hibernate OGM, Domain model persistence for NoSQL datastores
~
~ License: GNU Lesser General Public License (LGPL), version 2.1 or later
~ See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
  -->
<module xmlns="urn:jboss:module:1.1" name="org.hibernate.ogm.mongodb" slot="main">
    <resources>
        <resource-root path="hibernate-ogm-mongodb-4.1.0.Beta4.jar" />
        <resource-root path="mongo-java-driver-2.10.1.jar" />
    </resources>
    <dependencies>
        <module name="org.hibernate" export="true" services="import" slot="ogm" />
        <module name="org.hibernate.commons-annotations"/>

        <module name="javax.api" />
        <module name="javax.persistence.api" />
        <module name="javax.transaction.api" />
        <module name="javax.validation.api" />
        <module name="org.jboss.logging" />
        <module name="org.parboiled" />
    </dependencies>
</module>




../wildfly-8.1.0.Final/modules/system/layers/base/org/hibernate/ogm

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Hibernate OGM, Domain model persistence for NoSQL datastores
~
~ License: GNU Lesser General Public License (LGPL), version 2.1 or later
~ See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
  -->
<module xmlns="urn:jboss:module:1.1" name="org.hibernate" slot="ogm">
    <resources>
        <resource-root path="hibernate-ogm-core-4.1.0.Beta4.jar" />
        <resource-root path="hibernate-ogm-infinispan-4.1.0.Beta4.jar" />
    </resources>
    <dependencies>
        <module name="org.hibernate" export="true" />
        <module name="org.hibernate.commons-annotations" />
        <module name="org.hibernate.hql" slot="1.0.0.CR1" export="true" services="export" optional="true" />
        <module name="org.hibernate.search.orm" export="true" services="export" optional="true" />

        <module name="javax.api" />
        <module name="javax.persistence.api" />
        <!-- Exporting as one of its types is exposed via Log which is extended in other modules -->
        <module name="javax.transaction.api" export="true" />
        <module name="javax.validation.api" />
        <module name="org.dom4j" />
        <module name="org.infinispan" services="export" export="true" optional="true" />
        <module name="org.infinispan.commons" optional="true" />
        <module name="org.jboss.as.jpa.hibernate" slot="4" optional="true" />
        <module name="org.jboss.logging" />

        <!-- Allow Hibernate ORM to load com.arjuna.ats.jta.TransactionManager -->
        <module name="org.jboss.jts" export="true" />
    </dependencies>
</module>


my jboss-deployment-structure.xml

Code:
<jboss-deployment-structure>
    <deployment>
        <dependencies>
            <module name="org.hibernate" slot="ogm" services="export" />
            <module name="org.hibernate.ogm.mongodb" slot="main" services="export" />
        </dependencies>
    </deployment>
</jboss-deployment-structure>


Top
 Profile  
 
 Post subject: Re: Hibernate OGM 4.1 Wildfly 8.1 MongoDB cant persist entity
PostPosted: Wed Jun 25, 2014 12:01 pm 
Newbie

Joined: Tue Jun 24, 2014 8:05 pm
Posts: 3
Ok y found the solution

after review the version of ogm i cant reply the error i had this

Code:

10:57:59,256 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 23) MSC000001: Failed to start service jboss.persistenceunit."clickgoal-1.0.war#mongoUnit": org.jboss.msc.service.StartException in service jboss.persistenceunit."clickgoal-1.0.war#mongoUnit": javax.persistence.PersistenceException: [PersistenceUnit: mongoUnit] Unable to build Hibernate SessionFactory
   at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:172) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]
   at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]
   at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.7.0_25]
   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.1.0.Final.jar:8.1.0.Final]
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]
   at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
   at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: mongoUnit] Unable to build Hibernate SessionFactory
   at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:1225) [hibernate-entitymanager-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.access$600(EntityManagerFactoryBuilderImpl.java:119) [hibernate-entitymanager-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:853) [hibernate-entitymanager-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843) [hibernate-entitymanager-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:397) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842) [hibernate-entitymanager-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.jpa.HibernatePersistenceProvider.createContainerEntityManagerFactory(HibernatePersistenceProvider.java:152) [hibernate-entitymanager-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.ogm.jpa.HibernateOgmPersistence.createContainerEntityManagerFactory(HibernateOgmPersistence.java:106) [hibernate-ogm-core-4.1.0.Beta4.jar:4.1.0.Beta4]
   at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:318) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]
   at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.access$1100(PersistenceUnitServiceImpl.java:67) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]
   at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:167) [wildfly-jpa-8.1.0.Final.jar:8.1.0.Final]
   ... 8 more
Caused by: org.hibernate.MappingException: Could not get constructor for org.hibernate.ogm.persister.SingleTableOgmEntityPersister
   at org.hibernate.persister.internal.PersisterFactoryImpl.create(PersisterFactoryImpl.java:185) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:135) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:401) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1857) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850) [hibernate-entitymanager-4.3.5.Final.jar:4.3.5.Final]
   ... 16 more
Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.ogm.dialect.GridDialect]
   at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:261) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:225) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.ogm.persister.OgmEntityPersister.<init>(OgmEntityPersister.java:121) [hibernate-ogm-core-4.1.0.Beta4.jar:4.1.0.Beta4]
   at org.hibernate.ogm.persister.SingleTableOgmEntityPersister.<init>(SingleTableOgmEntityPersister.java:35) [hibernate-ogm-core-4.1.0.Beta4.jar:4.1.0.Beta4]
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_25]
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.7.0_25]
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.7.0_25]
   at java.lang.reflect.Constructor.newInstance(Constructor.java:526) [rt.jar:1.7.0_25]
   at org.hibernate.persister.internal.PersisterFactoryImpl.create(PersisterFactoryImpl.java:163) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
   ... 20 more
Caused by: org.hibernate.HibernateException: OGM000044: Cannot load class org.hibernate.ogm.dialect.mongodb.MongoDBDialect specified via configuration property 'hibernate.ogm.datastore.grid_dialect'
   at org.hibernate.ogm.util.configurationreader.impl.ClassPropertyReaderContext.getClassFromString(ClassPropertyReaderContext.java:127) [hibernate-ogm-core-4.1.0.Beta4.jar:4.1.0.Beta4]
   at org.hibernate.ogm.util.configurationreader.impl.ClassPropertyReaderContext.getTypedValue(ClassPropertyReaderContext.java:95) [hibernate-ogm-core-4.1.0.Beta4.jar:4.1.0.Beta4]
   at org.hibernate.ogm.util.configurationreader.impl.PropertyReaderContext.getValue(PropertyReaderContext.java:104) [hibernate-ogm-core-4.1.0.Beta4.jar:4.1.0.Beta4]
   at org.hibernate.ogm.dialect.impl.GridDialectInitiator.initiateService(GridDialectInitiator.java:56) [hibernate-ogm-core-4.1.0.Beta4.jar:4.1.0.Beta4]
   at org.hibernate.ogm.dialect.impl.GridDialectInitiator.initiateService(GridDialectInitiator.java:40) [hibernate-ogm-core-4.1.0.Beta4.jar:4.1.0.Beta4]
   at org.hibernate.service.internal.SessionFactoryServiceRegistryImpl.initiateService(SessionFactoryServiceRegistryImpl.java:91) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:251) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
   ... 29 more
Caused by: org.hibernate.boot.registry.classloading.spi.ClassLoadingException: Unable to load class [org.hibernate.ogm.dialect.mongodb.MongoDBDialect]
   at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:243) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
   at org.hibernate.ogm.util.configurationreader.impl.ClassPropertyReaderContext.getClassFromString(ClassPropertyReaderContext.java:124) [hibernate-ogm-core-4.1.0.Beta4.jar:4.1.0.Beta4]
   ... 35 more
Caused by: java.lang.ClassNotFoundException: Could not load requested class : org.hibernate.ogm.dialect.mongodb.MongoDBDialect
   at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl$AggregatedClassLoader.findClass(ClassLoaderServiceImpl.java:228) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
   at java.lang.ClassLoader.loadClass(ClassLoader.java:424) [rt.jar:1.7.0_25]
   at java.lang.ClassLoader.loadClass(ClassLoader.java:357) [rt.jar:1.7.0_25]
   at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0_25]
   at java.lang.Class.forName(Class.java:270) [rt.jar:1.7.0_25]
   at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:240) [hibernate-core-4.3.5.Final.jar:4.3.5.Final]
   ... 36 more

10:57:59,264 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 2) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "clickgoal-1.0.war")]) - failure description: {"JBAS014671: Failed services" => {"jboss.persistenceunit.\"clickgoal-1.0.war#mongoUnit\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"clickgoal-1.0.war#mongoUnit\": javax.persistence.PersistenceException: [PersistenceUnit: mongoUnit] Unable to build Hibernate SessionFactory
    Caused by: javax.persistence.PersistenceException: [PersistenceUnit: mongoUnit] Unable to build Hibernate SessionFactory
    Caused by: org.hibernate.MappingException: Could not get constructor for org.hibernate.ogm.persister.SingleTableOgmEntityPersister
    Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.ogm.dialect.GridDialect]
    Caused by: org.hibernate.HibernateException: OGM000044: Cannot load class org.hibernate.ogm.dialect.mongodb.MongoDBDialect specified via configuration property 'hibernate.ogm.datastore.grid_dialect'
    Caused by: org.hibernate.boot.registry.classloading.spi.ClassLoadingException: Unable to load class [org.hibernate.ogm.dialect.mongodb.MongoDBDialect]
    Caused by: java.lang.ClassNotFoundException: Could not load requested class : org.hibernate.ogm.dialect.mongodb.MongoDBDialect"}}
10:57:59,268 ERROR [org.jboss.as.server] (management-handler-thread - 2) JBAS015870: Deploy of deployment "clickgoal-1.0.war" was rolled back with the following failure message:
{"JBAS014671: Failed services" => {"jboss.persistenceunit.\"clickgoal-1.0.war#mongoUnit\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"clickgoal-1.0.war#mongoUnit\": javax.persistence.PersistenceException: [PersistenceUnit: mongoUnit] Unable to build Hibernate SessionFactory
    Caused by: javax.persistence.PersistenceException: [PersistenceUnit: mongoUnit] Unable to build Hibernate SessionFactory
    Caused by: org.hibernate.MappingException: Could not get constructor for org.hibernate.ogm.persister.SingleTableOgmEntityPersister
    Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.ogm.dialect.GridDialect]
    Caused by: org.hibernate.HibernateException: OGM000044: Cannot load class org.hibernate.ogm.dialect.mongodb.MongoDBDialect specified via configuration property 'hibernate.ogm.datastore.grid_dialect'
    Caused by: org.hibernate.boot.registry.classloading.spi.ClassLoadingException: Unable to load class [org.hibernate.ogm.dialect.mongodb.MongoDBDialect]
    Caused by: java.lang.ClassNotFoundException: Could not load requested class : org.hibernate.ogm.dialect.mongodb.MongoDBDialect"}}
10:57:59,281 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015877: Stopped deployment clickgoal-1.0.war (runtime-name: clickgoal-1.0.war) in 13ms
10:57:59,282 INFO  [org.jboss.as.controller] (management-handler-thread - 2) JBAS014774: Service status report
JBAS014775:    New missing/unsatisfied dependencies:
      service jboss.persistenceunit."clickgoal-1.0.war#mongoUnit" (missing) dependents: [service jboss.deployment.unit."clickgoal-1.0.war".POST_MODULE]
JBAS014777:   Services which failed to start:      service jboss.persistenceunit."clickgoal-1.0.war#mongoUnit"

[2014-06-25 10:57:59,486] Artifact clickgoal:war: Error during artifact deployment. See server log for details.
[2014-06-25 10:57:59,487] Artifact clickgoal:war: java.lang.Exception: {"JBAS014671: Failed services" => {"jboss.persistenceunit.\"clickgoal-1.0.war#mongoUnit\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"clickgoal-1.0.war#mongoUnit\": javax.persistence.PersistenceException: [PersistenceUnit: mongoUnit] Unable to build Hibernate SessionFactory
    Caused by: javax.persistence.PersistenceException: [PersistenceUnit: mongoUnit] Unable to build Hibernate SessionFactory
    Caused by: org.hibernate.MappingException: Could not get constructor for org.hibernate.ogm.persister.SingleTableOgmEntityPersister
    Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.ogm.dialect.GridDialect]
    Caused by: org.hibernate.HibernateException: OGM000044: Cannot load class org.hibernate.ogm.dialect.mongodb.MongoDBDialect specified via configuration property 'hibernate.ogm.datastore.grid_dialect'
    Caused by: org.hibernate.boot.registry.classloading.spi.ClassLoadingException: Unable to load class [org.hibernate.ogm.dialect.mongodb.MongoDBDialect]
    Caused by: java.lang.ClassNotFoundException: Could not load requested class : org.hibernate.ogm.dialect.mongodb.MongoDBDialect"}}




So I remove

<property name="hibernate.ogm.datastore.grid_dialect"
value="org.hibernate.ogm.dialect.mongodb.MongoDBDialect"/>

form my persistence.xml and the persist works

i hope thanks for your time ,


Top
 Profile  
 
 Post subject: Re: Hibernate OGM 4.1 Wildfly 8.1 MongoDB cant persist entity
PostPosted: Thu Jun 26, 2014 3:31 am 
Hibernate Team
Hibernate Team

Joined: Sat Jan 24, 2009 12:46 pm
Posts: 388
Ah, I see. The best is to use the short identifier of the datastore instead of the fully-qualified dialect class name, i.e. just "mongodb" in this case (Also see the constant MongoDB#DATASTORE_PROVIDER_NAME).

--Gunnar

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


Top
 Profile  
 
 Post subject: Re: Hibernate OGM 4.1 Wildfly 8.1 MongoDB cant persist entity
PostPosted: Wed Nov 05, 2014 1:36 am 
Newbie

Joined: Wed Nov 05, 2014 1:23 am
Posts: 1
Thanks Mattysek,
that is very helpful.

I will check the versions and send a patch soon (unless you want to contribute to the project and fix the issue yourself).
Usually we spot this kind of errors using integration tests, but we haven't got one for neo4j yet.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.