-->
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: PersistenceException : NPE
PostPosted: Wed Jul 06, 2005 10:19 am 
Beginner
Beginner

Joined: Fri Sep 24, 2004 8:18 am
Posts: 24
Hi,

Given my persistence.xml below :
Code:
<?xml version="1.0" encoding="UTF-8"?>

<entity-manager>
    <name>TimeFaces</name>

    <class>example.model.a</class>
    <class>example.model.b</class>
    <class>example.model.c</class>
    <class>example.model.d</class>
   
    <provider>org.hibernate.ejb.HibernatePersistence</provider>

    <properties>
        <property name="hibernate.ejb.cfgfile" value="/hibernate.cfg.xml"/>
    </properties>
   
</entity-manager>


I got the following error :
[junit] javax.persistence.PersistenceException: java.lang.NullPointerException
[junit] at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:97)


What's wrong with the file above ?

Thanks for any help/suggestion,
nusa.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 06, 2005 3:25 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Can you give me some more information, namely the full stacktrace.
Tnaks.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 06, 2005 5:22 pm 
Beginner
Beginner

Joined: Fri Sep 24, 2004 8:18 am
Posts: 24
Will this help you ?

[junit] 22:19:52,767 ERROR Ejb3Util: === Building EntityManagerFactory failed.
[junit] javax.persistence.PersistenceException: java.lang.NullPointerException
[junit] at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:97)
[junit] at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:42)
[junit] at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:29)
[junit] at example.util.Ejb3Util.<clinit>(Ejb3Util.java:29)
[junit] at example.test.TimeFacesTest.testTimeFaces(TimeFacesTest.java:61)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[junit] at java.lang.reflect.Method.invoke(Method.java:585)
[junit] at junit.framework.TestCase.runTest(TestCase.java:154)
[junit] at example.test.TestCase.runTest(TestCase.java:14)
[junit] at junit.framework.TestCase.runBare(TestCase.java:127)
[junit] at junit.framework.TestResult$1.protect(TestResult.java:106)
[junit] at junit.framework.TestResult.runProtected(TestResult.java:124)
[junit] at junit.framework.TestResult.run(TestResult.java:109)
[junit] at junit.framework.TestCase.run(TestCase.java:118)
[junit] at junit.framework.TestSuite.runTest(TestSuite.java:208)
[junit] at junit.framework.TestSuite.run(TestSuite.java:203)
[junit] at junit.framework.TestSuite.runTest(TestSuite.java:208)
[junit] at junit.framework.TestSuite.run(TestSuite.java:203)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:297)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:672)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:567)
[junit] Caused by: java.lang.NullPointerException
[junit] at java.util.Hashtable.putAll(Hashtable.java:467)
[junit] at org.hibernate.ejb.HibernatePersistence.createFactory(HibernatePersistence.java:66)
[junit] at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:89)
[junit] ... 22 more


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 06, 2005 9:40 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Well, I know this bug used to exist, but the released version doesn't have it. Are you sure you're using the beta1 version?

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 07, 2005 5:18 am 
Beginner
Beginner

Joined: Fri Sep 24, 2004 8:18 am
Posts: 24
I just replace all hibernate jars from JBoss-4.0.3RC1 with the beta1, and it works. Merci Emmanuel.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jul 10, 2005 12:31 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
cool

_________________
Emmanuel


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.