Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Module org.hibernate:ogm is not found in local module loader
PostPosted: Thu Oct 04, 2012 8:56 am 
Newbie

Joined: Thu Oct 04, 2012 8:51 am
Posts: 6
Hi

Could anyone post how to install this module on JBoss AS 7.1. to deploy an application on this server?

I get this error:
Code:
13:30:47,381 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.module.service."deployment.mongotest.war".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.mongotest.war".main: Failed to load module: deployment.mongotest.war:main
   at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:91) [jboss-as-server-7.1.0.Final.jar:7.1.0.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$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_16]
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_16]
   at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_16]
Caused by: org.jboss.modules.ModuleNotFoundException: Module org.hibernate:ogm is not found in local module loader @1a99561 (roots: C:\servers\jboss-as-7.1.0.Final\modules)
   at org.jboss.modules.LocalModuleLoader.findModule(LocalModuleLoader.java:126)
   at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:275)
   at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:222)
   at org.jboss.modules.LocalModuleLoader.preloadModule(LocalModuleLoader.java:94)
   at org.jboss.modules.Module.addPaths(Module.java:841)
   at org.jboss.modules.Module.link(Module.java:1181)
   at org.jboss.modules.Module.relinkIfNecessary(Module.java:1207)
   at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:208)
   at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:70) [jboss-as-server-7.1.0.Final.jar:7.1.0.Final]
   ... 5 more



Module org.hibernate:ogm is not found in local module loader


Top
 Profile  
 
 Post subject: Re: Module org.hibernate:ogm is not found in local module loader
PostPosted: Fri Oct 05, 2012 6:13 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2296
Location: Third rock from the Sun
Hi,
since Hibernate OGM requires different Hibernate (core) libraries than what the AS would expose, it expects you to bundle a custom made module named "org.hibernate:ogm"

here are details which where tested on AS 7.0.1:
http://in.relation.to/Bloggers/UsingADifferentPersistenceProviderWithAS701

Scott updated the relevant docs for AS 7.1: in short you can override the name of the module, among other things, but you still have to dump all jars in the AS modules directory.

https://docs.jboss.org/author/display/AS72/JPA+Reference+Guide#JPAReferenceGuide-Persistenceunitproperties
https://docs.jboss.org/author/display/AS72/JPA+Reference+Guide#JPAReferenceGuide-Determinethepersistenceprovidermodule

The reason for this is that we're moving fast and can't be tightly coupled to the version of Hibernate ORM bundled in the application server by default.
Looks like we should make such a module in the OGM distribution to simplify things.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Module org.hibernate:ogm is not found in local module loader
PostPosted: Fri Oct 05, 2012 8:16 am 
Newbie

Joined: Thu Oct 04, 2012 8:51 am
Posts: 6
Hi,

Ok. What I have done:
1. Update Hibernate an Envers as JBoss modules to the latest version
https://docs.jboss.org/author/display/AS72/JPA+Reference+Guide#JPAReferenceGuide-ReplacingthecurrentHibernate4.0.xjarswithanewerversion
2. Configure the OGM module under JBOSS_DIR/modules/org/hibernate/ogm. Copy paste OGM jar and configure module.xml:

Code:
<module xmlns="urn:jboss:module:1.1" name="org.hibernate" slot="ogm">
    <resources>
        <resource-root path="hibernate-ogm-core-4.0.0.Beta1.jar"/>
          <!-- Insert resources here -->
    </resources>

    <dependencies>
        <module name="org.jboss.as.jpa.hibernate" slot="4"/>
        <module name="org.hibernate" slot="main" export="true" />
        <module name="javax.api"/>
        <module name="javax.persistence.api"/>
        <module name="javax.transaction.api"/>
        <module name="javax.validation.api"/>
        <module name="org.infinispan"/>
        <module name="org.javassist"/>
        <module name="org.jboss.logging"/>
    </dependencies>
</module>


3. Update persistence.xml:
Code:

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

   
   
     <persistence-unit name="jpajtastandalone" transaction-type="JTA">
        <provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>
        <properties>
            <property name="hibernate.transaction.jta.platform"
                      value="org.hibernate.service.jta.platform.internal.JBossStandAloneJtaPlatform" />
            <property name="hibernate.ogm.datastore.provider"
                      value="mongodb"/>
            <property name="hibernate.ogm.datastore.grid_dialect" value="org.hibernate.ogm.test.type.OverridingTypeDialect"/>
       
           <property name="hibernate.ogm.mongodb.host" value="127.0.0.1"/>
           <property name="hibernate.ogm.mongodb.port" value="27017"/>
           <property name="hibernate.ogm.mongodb.database" value="mydb"/>
           
           
            <property name="jboss.as.jpa.providerModule" value="org.hibernate:ogm"/>
        <property name="jboss.as.jpa.adapterModule" value="org.jboss.as.jpa.hibernate:4"/>
           
           <!--
           <property name="hibernate.ogm.mongodb.username" value=""/>
           <property name="hibernate.ogm.mongodb.password" value=""/>
           <property name="hibernate.ogm.mongodb.safe" value=""/>
           
           <property name="hibernate.ogm.mongodb.connection_timeout" value=""/>
           <property name="hibernate.ogm.mongodb.associations.store" value=""/>
         -->
        </properties>
       
       
     
       
       
    </persistence-unit>
   
</persistence>




Thanks


Top
 Profile  
 
 Post subject: Re: Module org.hibernate:ogm is not found in local module loader
PostPosted: Fri Oct 05, 2012 8:19 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2296
Location: Third rock from the Sun
Looks good. Working fine? or what is the problem

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Module org.hibernate:ogm is not found in local module loader
PostPosted: Fri Oct 05, 2012 8:20 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2296
Location: Third rock from the Sun
BTW since you're deplying on AS7 you should not use the standalone transaction manager.

Just remove the property
hibernate.transaction.jta.platform and let the platform inject the right things.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Module org.hibernate:ogm is not found in local module loader
PostPosted: Fri Oct 05, 2012 9:57 am 
Red Hat Associate
Red Hat Associate

Joined: Wed Apr 18, 2012 9:06 pm
Posts: 3
sanne.grinovero wrote:
Hi,
Scott updated the relevant docs for AS 7.1: in short you can override the name of the module, among other things, but you still have to dump all jars in the AS modules directory.

https://docs.jboss.org/author/display/AS72/JPA+Reference+Guide#JPAReferenceGuide-Persistenceunitproperties
https://docs.jboss.org/author/display/AS72/JPA+Reference+Guide#JPAReferenceGuide-Determinethepersistenceprovidermodule


The updated documentation is actually for the next AS release but is still relevant to this discussion. Just wanted to point that out. :)


Top
 Profile  
 
 Post subject: Re: Module org.hibernate:ogm is not found in local module loader
PostPosted: Fri Oct 05, 2012 10:05 am 
Newbie

Joined: Thu Oct 04, 2012 8:51 am
Posts: 6
Hi,

Works fine. Thank you. Just wanted to put it all together for other people.

I'll remove the standalone tx manager.

Regards
Esteve


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 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.