-->
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.  [ 5 posts ] 
Author Message
 Post subject: OGM000059: Unable to find a GridType for string, OGM, Redis
PostPosted: Tue Dec 22, 2015 6:36 am 
Newbie

Joined: Tue Dec 22, 2015 6:11 am
Posts: 4
Hello,
Can Somebody help me ?
Hibernate OGM, Version 5 5.0.0.Alpha1, Redis 3.0 On Windows, Eclipse Java SE 1.8.
i have the following Exception:


INFO: OGM000001: Hibernate OGM 5.0.0.Alpha1
Exception in thread "main" javax.persistence.PersistenceException: [PersistenceUnit: HLS] Unable to build Hibernate SessionFactory
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:877)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:805)
at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:58)
at org.hibernate.ogm.jpa.HibernateOgmPersistence.createEntityManagerFactory(HibernateOgmPersistence.java:59)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:39)
at test.Main.main(Main.java:11)
Caused by: org.hibernate.MappingException: Could not get constructor for org.hibernate.ogm.persister.impl.SingleTableOgmEntityPersister
at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:123)
at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:77)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:346)
at org.hibernate.ogm.boot.impl.OgmSessionFactoryBuilderImpl.build(OgmSessionFactoryBuilderImpl.java:54)
at org.hibernate.ogm.boot.impl.OgmSessionFactoryBuilderImpl.build(OgmSessionFactoryBuilderImpl.java:23)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:802)
... 5 more
Caused by: org.hibernate.HibernateException: OGM000068: Could not configure property test.Autor#name
at org.hibernate.ogm.persister.impl.OgmEntityPersister.<init>(OgmEntityPersister.java:306)
at org.hibernate.ogm.persister.impl.SingleTableOgmEntityPersister.<init>(SingleTableOgmEntityPersister.java:34)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:96)
... 10 more
Caused by: org.hibernate.HibernateException: OGM000059: Unable to find a GridType for string
at org.hibernate.ogm.type.impl.TypeTranslatorImpl.getType(TypeTranslatorImpl.java:85)
at org.hibernate.ogm.persister.impl.OgmEntityPersister.<init>(OgmEntityPersister.java:303)
... 16 more


The Code:

package test;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

@Entity
public class Autor {

@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE)
private int id;

private long wert;

private String name;

public Autor() {

}

public int getId() {
return id;
}

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

public long getWert() {
return wert;
}

public void setWert(long wert) {
this.wert = wert;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

}



public class Main {

public static void main(String[] args) {
EntityManagerFactory emf = Persistence
.createEntityManagerFactory("HLS");
EntityManager em = emf.createEntityManager();

Autor a = new Autor();
Autor b = new Autor();
Autor c = new Autor();

em.getTransaction().begin();
em.persist(a);
em.persist(b);
em.persist(c);
em.getTransaction().commit();

System.out.println("ende");
}
}


Perisstence.xml:

<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="HLS" transaction-type="RESOURCE_LOCAL">
<description>
Persistence unit ...
</description>
<provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>
<properties>
<property name="hibernate.ogm.datastore.provider" value="redis_experimental"/>
<property name="hibernate.ogm.datastore.host" value="localhost:6379"/>
<property name="hibernate.ogm.datastore.database" value="0"/>
<property name="hibernate.ogm.datastore.redis.association_storage" value="IN_ENTITY"/>
<property name="hibernate.ogm.datastore.document.map_storage" value="BY_KEY"/>
</properties>
</persistence-unit>
</persistence>


Top
 Profile  
 
 Post subject: Re: OGM000059: Unable to find a GridType for string, OGM, Redis
PostPosted: Tue Dec 22, 2015 11:13 am 
Hibernate Team
Hibernate Team

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

I can't reproduce this issue with the provided classes, it's initialized properly for me when running your test. Could you create a complete Maven project which reproduces this and attach it to a new issue in our JIRA tracker (https://hibernate.atlassian.net/browse/OGM)?

Very odd that String is flagged as not supported, because it is for sure :)

Thanks,

--Gunnar

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


Top
 Profile  
 
 Post subject: Re: OGM000059: Unable to find a GridType for string, OGM, Redis
PostPosted: Tue Dec 22, 2015 12:39 pm 
Newbie

Joined: Tue Dec 22, 2015 6:11 am
Posts: 4
Hello Gunnar,

thanks for you Answer.

sorry but i have not Idea to make MAVEN or JIRA.

In the Classpath are the Jar-Files for Hibernate-OGM.

hibernate-ogm-5.0.0.Alpha1-dist -> dist -> lib ->
all Jar-Files from
Core
couchdb and
Redis

best regards, Homan


Top
 Profile  
 
 Post subject: Re: OGM000059: Unable to find a GridType for string, OGM, Redis
PostPosted: Wed Dec 23, 2015 7:24 am 
Newbie

Joined: Tue Dec 22, 2015 6:11 am
Posts: 4
I put just also the jar Files from hibernate-release-5.0.6.Final and the Jar-Files from hibernate-ogm-5.0.0.Beta1-dist in the Classpath. But i have also the exception :-(


Top
 Profile  
 
 Post subject: Re: OGM000059: Unable to find a GridType for string, OGM, Redis
PostPosted: Mon Dec 28, 2015 6:41 am 
Newbie

Joined: Tue Dec 22, 2015 6:11 am
Posts: 4
You Can reproduce the Exception in one normally Java-Project in Eclipse(Luna), and put the jar Files in the classpath. (Project, properties, Java BuildPath, Libaries, Add External Jars


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