-->
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.  [ 8 posts ] 
Author Message
 Post subject: Hibernate with Neo4j:Unable to build Entity Manager
PostPosted: Wed Aug 20, 2014 4:04 pm 
Newbie

Joined: Sat Jul 12, 2014 7:31 am
Posts: 6
I'm trying to connect to Neo4j database. My database is downloaded from Neo4j site "Cineacts Actors &Movies".
It located on C:\NewMovies

here comes my Application:
Code:
public class App
{
    private static final String JBOSS_TM_CLASS_NAME = "com.arjuna.ats.jta.TransactionManager";
    public static void main( String[] args )
    { 
TransactionManager tm = getTransactionManager();
        //build the EntityManagerFactory as you would build in in Hibernate Core
      EntityManagerFactory emf = Persistence.createEntityManagerFactory("ogm-jpa-tutorial");
System.out.println( "Hello World!" );
    }
   
   public static TransactionManager getTransactionManager() {
      try {
         Class<?> tmClass = App.class.getClassLoader().loadClass( JBOSS_TM_CLASS_NAME );
         return (TransactionManager) tmClass.getMethod( "transactionManager" ).invoke( null );
      } catch ( ClassNotFoundException e ) {
         e.printStackTrace();
      } catch ( InvocationTargetException e ) {
         e.printStackTrace();
      } catch ( NoSuchMethodException e ) {
         e.printStackTrace();
      } catch ( IllegalAccessException e ) {
         e.printStackTrace();
      }
      return null;
   }
}


my persistence file:

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="ogm-jpa-tutorial" transaction-type="JTA">
        <!-- Use Hibernate OGM provider: configuration will be transparent -->
        <provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>
      <class>com.mycompany.hibernateneo.Movie</class>
        <properties>
            <property name="hibernate.ogm.datastore.provider" value="neo4j_embedded" />
            <property name="hibernate.ogm.neo4j.database_path" value="C:/NewMovies" />

            <!-- defines which JTA Transaction we plan to use -->
            <property name="hibernate.transaction.jta.platform"
                      value="org.hibernate.service.jta.platform.internal.JBossStandAloneJtaPlatform"/>
        </properties>
    </persistence-unit>
</persistence>


my entity file:
Quote:
@Entity
@Table(name = "Movie")
public class Movie {
@Id
String id;
@Basic
String title;
@Basic
String description;
@Basic
private String language;
@Basic
private String imdbId;
@Basic
private String tagline;
@Basic
private Integer runtime;
@Basic
private String homepage;
@Basic
private String trailer;
@Basic
private String genre;
@Basic
private String studio;
@Basic
private Integer version;
@Basic
private String imageUrl;
public Movie() {
}
public Movie(String id, String title) {
this.id = id;
this.title = title;
}
public String getId() {
return id;
}
public String getTitle() {
return title;
}
public String getDescription() {
return description;
}
public void setTitle(String title) {
this.title=title;
}
public void setLanguage(String language) {
this.language = language;
}
public void setImdbId(String imdbId) {
this.imdbId = imdbId;
}
public void setTagline(String tagline) {
this.tagline = tagline;
}
public void setDescription(String description) {
this.description = description;
}
public void setRuntime(Integer runtime) {
this.runtime = runtime;
}
public void setHomepage(String homepage) {
this.homepage = homepage;
}
public void setTrailer(String trailer) {
this.trailer = trailer;
}
public void setGenre(String genre) {
this.genre = genre;
}
public void setStudio(String studio) {
this.studio = studio;
}
public void setVersion(Integer version) {
this.version = version;
}
public void setImageUrl(String imageUrl) {
this.imageUrl = imageUrl;
}
public String getLanguage() {
return language;
}
public String getImdbId() {
return imdbId;
}
public String getTagline() {
return tagline;
}
public Integer getRuntime() {
return runtime;
}
public String getHomepage() {
return homepage;
}
public String getTrailer() {
return trailer;
}
public String getGenre() {
return genre;
}
public String getStudio() {
return studio;
}
public Integer getVersion() {
return version;
}
public String getImageUrl() {
return imageUrl;
}
public String getYoutubeId() {
String trailerUrl = trailer;
if (trailerUrl==null || !trailerUrl.contains("youtu")) return null;
String[] parts = trailerUrl.split("[=/]");
int numberOfParts = parts.length;
return numberOfParts > 0 ? parts[numberOfParts-1] : null;
}
}


and error which I get:

Exception in thread "main" javax.persistence.PersistenceException: [PersistenceUnit: ogm-jpa-tutorial] Unable to build EntityManagerFactory
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:915)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:890)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:57)
at org.hibernate.ogm.jpa.HibernateOgmPersistence.createEntityManagerFactory(HibernateOgmPersistence.java:93)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)
at com.mycompany.hibernateneo.App.main(App.java:22)
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)
at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:135)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:385)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1742)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:94)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:905)
... 6 more
Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.ogm.dialect.impl.GridDialectFactory]
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:186)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:150)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)
at org.hibernate.ogm.datastore.impl.DatastoreServicesInitiator.initiateService(DatastoreServicesInitiator.java:50)
at org.hibernate.ogm.datastore.impl.DatastoreServicesInitiator.initiateService(DatastoreServicesInitiator.java:39)
at org.hibernate.service.internal.SessionFactoryServiceRegistryImpl.initiateService(SessionFactoryServiceRegistryImpl.java:91)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:176)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:150)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)
at org.hibernate.ogm.persister.OgmEntityPersister.<init>(OgmEntityPersister.java:129)
at org.hibernate.ogm.persister.SingleTableOgmEntityPersister.<init>(SingleTableOgmEntityPersister.java:47)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.hibernate.persister.internal.PersisterFactoryImpl.create(PersisterFactoryImpl.java:163)
... 11 more
Caused by: java.lang.IllegalArgumentException: Property hibernate.ogm.neo4j.database.path cannot be null
at org.hibernate.ogm.datastore.neo4j.impl.EmbeddedGraphDatabaseFactory.validate(EmbeddedGraphDatabaseFactory.java:61)
at org.hibernate.ogm.datastore.neo4j.impl.EmbeddedGraphDatabaseFactory.initialize(EmbeddedGraphDatabaseFactory.java:52)
at org.hibernate.ogm.datastore.neo4j.impl.Neo4jGraphDatabaseServiceFactoryProvider.load(Neo4jGraphDatabaseServiceFactoryProvider.java:44)
at org.hibernate.ogm.datastore.neo4j.impl.Neo4jDatastoreProvider.configure(Neo4jDatastoreProvider.java:77)
at org.hibernate.ogm.service.impl.OgmSessionFactoryServiceRegistryImpl.configureService(OgmSessionFactoryServiceRegistryImpl.java:69)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)
at org.hibernate.ogm.dialect.impl.GridDialectFactoryInitiator.createDialect(GridDialectFactoryInitiator.java:58)
at org.hibernate.ogm.dialect.impl.GridDialectFactoryInitiator.initiateService(GridDialectFactoryInitiator.java:49)
at org.hibernate.ogm.dialect.impl.GridDialectFactoryInitiator.initiateService(GridDialectFactoryInitiator.java:38)
at org.hibernate.service.internal.SessionFactoryServiceRegistryImpl.initiateService(SessionFactoryServiceRegistryImpl.java:91)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:176)
... 26 more


please, any ideas?


Top
 Profile  
 
 Post subject: Re: Hibernate with Neo4j:Unable to build Entity Manager
PostPosted: Thu Aug 21, 2014 5:21 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
Hi,
are you using the latest OGM version (4.1.0.Beta6)?

Also for Neo4j you should not set the JtaPlatform, so you should remove this part from the persistence xml:

Code:
            <!-- defines which JTA Transaction we plan to use -->
            <property name="hibernate.transaction.jta.platform"
                      value="org.hibernate.service.jta.platform.internal.JBossStandAloneJtaPlatform"/>


The integration between Neo4j and OGM requires a specific JtaPlatform that it is going to be set by OGM.

Davide


Top
 Profile  
 
 Post subject: Re: Hibernate with Neo4j:Unable to build Entity Manager
PostPosted: Sat Aug 23, 2014 5:35 am 
Newbie

Joined: Sat Jul 12, 2014 7:31 am
Posts: 6
the error have changed:

Exception in thread "main" java.lang.NoClassDefFoundError: org/hibernate/jpa/HibernatePersistenceProvider
at org.hibernate.ogm.jpa.HibernateOgmPersistence.<init>(HibernateOgmPersistence.java:42)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:374)
at javax.persistence.spi.PersistenceProviderResolverHolder$PersistenceProviderResolverPerClassLoader$CachingPersistenceProviderResolver.getPersistenceProviders(PersistenceProviderResolverHolder.java:185)
at javax.persistence.spi.PersistenceProviderResolverHolder$PersistenceProviderResolverPerClassLoader.getPersistenceProviders(PersistenceProviderResolverHolder.java:92)
at javax.persistence.Persistence.getProviders(Persistence.java:75)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:61)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)
at com.mycompany.hibernateneo.App.main(App.java:22)
Caused by: java.lang.ClassNotFoundException: org.hibernate.jpa.HibernatePersistenceProvider
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 12 more



persistence.xml:
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="ogm-jpa-tutorial" transaction-type="JTA">
        <!-- Use Hibernate OGM provider: configuration will be transparent -->
        <provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>
      <class>com.mycompany.hibernateneo.Movie</class>
        <properties>
            <property name="hibernate.ogm.datastore.provider" value="neo4j_embedded" />
            <property name="hibernate.ogm.neo4j.database_path" value="C:/NewMovies" />

        </properties>
    </persistence-unit>
</persistence>


here is my pom file:

Code:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.mycompany</groupId>
  <artifactId>hibernateNeo</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>hibernateNeo</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
   
   <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
     
      <dependency>
   <groupId>antlr</groupId>
   <artifactId>antlr</artifactId>
   <version>2.7.7</version>
</dependency>
<dependency>
   <groupId>org.antlr</groupId>
   <artifactId>antlr-runtime</artifactId>
   <version>3.4</version>
</dependency>
<dependency>
   <groupId>com.fasterxml</groupId>
   <artifactId>classmate</artifactId>
   <version>0.8.0</version>
</dependency>
<dependency>
   <groupId>org.apache.avro</groupId>
   <artifactId>avro-tools</artifactId>
   <version>1.7.5</version>
</dependency>
<dependency>
   <groupId>org.apache.commons</groupId>
   <artifactId>commons-compress</artifactId>
   <version>1.4.1</version>
</dependency>
<dependency>
   <groupId>com.googlecode.concurrentlinkedhashmap</groupId>
   <artifactId>concurrentlinkedhashmap-lru</artifactId>
   <version>1.3.1</version>
</dependency>
<dependency>
   <groupId>dom4j</groupId>
   <artifactId>dom4j</artifactId>
   <version>1.6.1</version>
</dependency>
<dependency>
   <groupId>org.apache.geronimo.specs</groupId>
   <artifactId>geronimo-jta_1.1_spec</artifactId>
   <version>1.1.1</version>
</dependency>
<dependency>
   <groupId>org.hibernate.common</groupId>
   <artifactId>hibernate-commons-annotations</artifactId>
   <version>4.0.2.Final</version>
</dependency>
<dependency>
   <groupId>org.hibernate</groupId>
   <artifactId>hibernate-validator</artifactId>
   <version>4.2.0.CR1</version>
</dependency>
<dependency>
   <groupId>org.hibernate</groupId>
   <artifactId>hibernate-entitymanager</artifactId>
   <version>4.2.0.CR1</version>
</dependency>
<dependency>
   <groupId>org.hibernate.hql</groupId>
   <artifactId>hibernate-hql-lucene</artifactId>
   <version>1.0.0.Alpha5</version>
</dependency>
<dependency>
   <groupId>org.hibernate.hql</groupId>
   <artifactId>hibernate-hql-parser</artifactId>
   <version>1.0.0.Alpha5</version>
</dependency>
<dependency>
   <groupId>org.hibernate.javax.persistence</groupId>
   <artifactId>hibernate-jpa-2.0-api</artifactId>
   <version>1.0.1.Final</version>
</dependency>
<dependency>
   <groupId>org.hibernate.ogm</groupId>
   <artifactId>hibernate-ogm-core</artifactId>
   <version>4.0.0.Beta4</version>
</dependency>

<dependency>
    <groupId>org.hibernate.ogm</groupId>
    <artifactId>hibernate-ogm-neo4j</artifactId>
    <version>4.0.0.Beta4</version>
</dependency>
<dependency>
   <groupId>org.hibernate.ogm</groupId>
   <artifactId>hibernate-ogm-mongodb</artifactId>
   <version>4.0.0.Beta4</version>
</dependency>
<dependency>
   <groupId>org.hibernate</groupId>
   <artifactId>hibernate-search-engine</artifactId>
   <version>4.4.0.Beta1</version>
</dependency>
<dependency>
   <groupId>org.hibernate</groupId>
   <artifactId>hibernate-search-orm</artifactId>
   <version>4.4.0.Beta1</version>
</dependency>
<dependency>
   <groupId>org.codehaus.jackson</groupId>
   <artifactId>jackson-core-asl</artifactId>
   <version>1.9.13</version>
</dependency>
<dependency>
   <groupId>org.codehaus.jackson</groupId>
   <artifactId>jackson-mapper-asl</artifactId>
   <version>1.9.13</version>
</dependency>
<dependency>
   <groupId>org.javassist</groupId>
   <artifactId>javassist</artifactId>
   <version>3.15.0-GA</version>
</dependency>
<dependency>
   <groupId>org.jboss.logging</groupId>
   <artifactId>jboss-logging</artifactId>
   <version>3.1.1.GA</version>
</dependency>
<dependency>
   <groupId>org.jboss.spec.javax.transaction</groupId>
   <artifactId>jboss-transaction-api_1.1_spec</artifactId>
   <version>1.0.0.Final</version>
</dependency>
<dependency>
   <groupId>org.jboss.jbossts</groupId>
   <artifactId>jbossjta</artifactId>
   <version>4.16.4.Final</version>
</dependency>

    <dependency>
  <groupId>org.jgroups</groupId>
  <artifactId>jgroups</artifactId>
  <version>3.3.0.Final</version>
    </dependency>
    <dependency>
   <groupId>org.apache.lucene</groupId>
   <artifactId>lucene-core</artifactId>
   <version>3.6.2</version>
</dependency>
<dependency>
   <groupId>org.apache.lucene</groupId>
   <artifactId>lucene-facet</artifactId>
   <version>3.6.2</version>
</dependency>
<dependency>
   <groupId>org.mongodb</groupId>
   <artifactId>mongo-java-driver</artifactId>
   <version>2.10.1</version>
</dependency>
<dependency>
   <groupId>org.neo4j.app</groupId>
   <artifactId>neo4j-server</artifactId>
   <version>2.0.0-M03</version>
</dependency>
<dependency>
   <groupId>org.neo4j</groupId>
   <artifactId>neo4j-cypher</artifactId>
   <version>2.0.0-M03</version>
</dependency>
<dependency>
   <groupId>org.neo4j</groupId>
   <artifactId>neo4j-graph-algo</artifactId>
   <version>2.0.0-M03</version>
</dependency>
<dependency>
   <groupId>org.neo4j</groupId>
   <artifactId>neo4j-graph-matching</artifactId>
   <version>2.0.0-M03</version>
</dependency>
<dependency>
   <groupId>org.neo4j</groupId>
   <artifactId>neo4j-jmx</artifactId>
   <version>2.0.0-M03</version>
</dependency>
<dependency>
   <groupId>org.neo4j</groupId>
   <artifactId>neo4j-kernel</artifactId>
   <version>2.0.0-M03</version>
</dependency>
<dependency>
   <groupId>org.neo4j</groupId>
   <artifactId>neo4j-lucene-index</artifactId>
   <version>2.0.0-M03</version>
</dependency>
<dependency>
   <groupId>org.neo4j</groupId>
   <artifactId>neo4j-udc</artifactId>
   <version>2.0.0-M03</version>
</dependency>
<dependency>
   <groupId>com.thoughtworks.paranamer</groupId>
   <artifactId>paranamer</artifactId>
   <version>2.3</version>
</dependency>
<dependency>
   <groupId>org.scala-lang</groupId>
   <artifactId>scala-library</artifactId>
   <version>2.10.0-M7</version>
</dependency>
<dependency>
   <groupId>org.slf4j</groupId>
   <artifactId>slf4j-api</artifactId>
   <version>1.6.1</version>
</dependency>
<!--dependency>
  <groupId>org.jboss</groupId>
  <artifactId>staxmapper</artifactId>
  <version>1.1.0.Final</version>
</dependency-->
<dependency>
   <groupId>org.antlr</groupId>
   <artifactId>stringtemplate</artifactId>
   <version>3.2.1</version>
</dependency>

   
  </dependencies>
</project>


any other ideas?


Top
 Profile  
 
 Post subject: Re: Hibernate with Neo4j:Unable to build Entity Manager
PostPosted: Tue Aug 26, 2014 12:03 pm 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
ClassNotFoundExcxeption it means something is wrong on the classpath, I cannot spot the problem, though.

Could you create a test project somewhere?

By the way, the version you are using is very old (4.0.0.Beta4) you should change it to the latest one 4.1.0.Beta6.
You should also be able to remove some dependencies, all the neo4j ones should be already included when you add hibernate-ogm-neo4j


Top
 Profile  
 
 Post subject: Re: Hibernate with Neo4j:Unable to build Entity Manager
PostPosted: Tue Sep 16, 2014 11:10 am 
Newbie

Joined: Sat Jul 12, 2014 7:31 am
Posts: 6
ssorry for being so quite. My problems did not vanish so here I come with some project.

here it is:
Code:
http://speedy.sh/spebR/hibernateNeo.7z


I also added DB which I would like to use.

hope to hear(read?) you soon


Top
 Profile  
 
 Post subject: Re: Hibernate with Neo4j:Unable to build Entity Manager
PostPosted: Tue Sep 16, 2014 12:14 pm 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
Hi,
as fdar as I can see you are adding a lot of dependencies in your pom that are not needed.

You can start the project with only this dependencies:

Code:
    <dependencies>
        <dependency>
            <groupId>org.hibernate.ogm</groupId>
            <artifactId>hibernate-ogm-neo4j</artifactId>
            <version>4.1.0.Beta6</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.jbossts</groupId>
            <artifactId>jbossjta</artifactId>
            <version>4.16.6.Final</version>
        </dependency>
    </dependencies>


In the persistence.xml you also have to remove the following line:
Code:
<property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossStandAloneJtaPlatform" />


After this the porject will start.


Top
 Profile  
 
 Post subject: Re: Hibernate with Neo4j:Unable to build Entity Manager
PostPosted: Sat Sep 20, 2014 8:04 am 
Newbie

Joined: Sat Jul 12, 2014 7:31 am
Posts: 6
now project works. but I find and persist operation does not get any result. maybe some hints?

my application:

Code:
...
Integer id = 123;
EntityManagerFactory emf = Persistence.createEntityManagerFactory("ogm-jpa-tutorial");
TransactionManager tm = getTransactionManager();
     EntityManager em = emf.createEntityManager();
   
     tm.begin();
em = emf.createEntityManager();
Movie m = new Movie(id.toString(), "movie "+id.toString());
em.persist(m);
em.close();
      tm.commit();

tm.begin();
     em = emf.createEntityManager();
Movie ten = em.find(Movie.class, coldId.toString());
em.close();
      tm.commit();
...


My variable ten is always null.

cheers


Top
 Profile  
 
 Post subject: Re: Hibernate with Neo4j:Unable to build Entity Manager
PostPosted: Tue Sep 23, 2014 12:02 pm 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
I'm trying to figure out what's causing the problem.

In the menwhile you might try begin and commit transaction using
Code:
em.getTransaction().begin()
and
Code:
em.getTransaction().commit()


Cheers,
Davide


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