-->
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.  [ 7 posts ] 
Author Message
 Post subject: Error when upgrade from 4.1.0.Beta2 to Beta3
PostPosted: Thu May 29, 2014 8:34 pm 
Newbie

Joined: Thu May 29, 2014 8:25 pm
Posts: 7
I have a very simple test project works with 4.1.0.Beta2 and neo4j-community_windows-x64_2_0_3. What I did was change Beta2 to Beta3 in pom.xml file and re-ran it then get following error:
Quote:
May 29, 2014 8:16:51 PM org.hibernate.jpa.internal.util.LogHelper logPersistenceUnitInformation
INFO: HHH000204: Processing PersistenceUnitInfo [
name: demo
...]
May 29, 2014 8:16:51 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.3.1.Final}
May 29, 2014 8:16:51 PM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
May 29, 2014 8:16:51 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
May 29, 2014 8:16:56 PM org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.4.Final}
Exception in thread "main" javax.persistence.PersistenceException: Unable to build entity manager factory
at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:81)
at org.hibernate.ogm.jpa.HibernateOgmPersistence.createEntityManagerFactory(HibernateOgmPersistence.java:61)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:39)
at devday.Application.main(Application.java:17)
Caused by: org.hibernate.engine.jndi.JndiException: Error parsing JNDI name [---PlaceHolderDSForOGM---]
at org.hibernate.engine.jndi.internal.JndiServiceImpl.parseName(JndiServiceImpl.java:141)
at org.hibernate.engine.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:112)
at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.configure(DatasourceConnectionProviderImpl.java:115)
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:89)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:206)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:178)
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.buildJdbcConnectionAccess(JdbcServicesImpl.java:260)
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:94)
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:89)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:206)
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:178)
at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1885)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1843)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843)
at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:399)
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842)
at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:73)
... 4 more
Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getNameParser(Unknown Source)
at org.hibernate.engine.jndi.internal.JndiServiceImpl.parseName(JndiServiceImpl.java:135)
... 21 more

pom.xml:
Code:
   <dependencies>
      <dependency>
         <groupId>org.hibernate.ogm</groupId>
         <artifactId>hibernate-ogm-neo4j</artifactId>
         <version>4.1.0.Beta3</version>
      </dependency>
   </dependencies>

persistence.xml
Code:
   <persistence-unit name="demo" transaction-type="JTA">
      <provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>
      <properties>
         <property name="hibernate.ogm.datastore.provider" value="neo4j" />
         <property name="hibernate.ogm.neo4j.database_path" value="C:/dev/database/Neo4j/default.graphdb" />
      </properties>
   </persistence-unit>

What else do I need change? Thank you!


Top
 Profile  
 
 Post subject: Re: Error when upgrade from 4.1.0.Beta2 to Beta3
PostPosted: Fri May 30, 2014 5:53 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
Hi,
one quick thing that I see is that the provider should be "neo4j_embedded" and not "neo4j".

Code:
<property name="hibernate.ogm.datastore.provider" value="neo4j_embedded" />


Top
 Profile  
 
 Post subject: Re: Error when upgrade from 4.1.0.Beta2 to Beta3
PostPosted: Fri May 30, 2014 7:27 am 
Newbie

Joined: Thu May 29, 2014 8:25 pm
Posts: 7
I used "neo4j_embedded" before and it failed, then I changed to "neo4j" because a document said so, but still not working. Same error.


Last edited by kenjliang on Fri May 30, 2014 9:11 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Error when upgrade from 4.1.0.Beta2 to Beta3
PostPosted: Fri May 30, 2014 7:44 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
I'm afraid I need more details about the project to help.

Could you provide a test case?


Top
 Profile  
 
 Post subject: Re: Error when upgrade from 4.1.0.Beta2 to Beta3
PostPosted: Fri May 30, 2014 9:10 am 
Newbie

Joined: Thu May 29, 2014 8:25 pm
Posts: 7
Quote:
https://bitbucket.org/kenjliang/ogm/src
run the "go.bat" to build and execute the demo.

It is using Beta2, change to Beta3 will see the error.


Last edited by kenjliang on Fri May 30, 2014 4:40 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Error when upgrade from 4.1.0.Beta2 to Beta3
PostPosted: Fri May 30, 2014 1:02 pm 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
Hi,
it seems that there is something is wrong in the generated jar but I don't understand exactly what it is.

If you use the pom at the following link:
https://gist.github.com/DavideD/2f0c87f88ff22b6ad68a

and change the second line of the go.bat to:
Code:
call java -jar target/demo-1.0.jar


everything should work.

What I did is to copy the dependencies in a separate lib and change the manifest in the jar to refer to that folder.

Hope this help,
Davide


Top
 Profile  
 
 Post subject: Re: Error when upgrade from 4.1.0.Beta2 to Beta3
PostPosted: Fri May 30, 2014 2:01 pm 
Newbie

Joined: Thu May 29, 2014 8:25 pm
Posts: 7
Thank you very much, Davided80!

It works now.


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