Fast Object Database for Java - with JPA/JDO support

Exception while accessing the Persistence unit ...?



I am new to ObjectDB I was trying your eclipse/jee6/glassfish tutorial. I am getting the following exception:

[#|2012-04-09T00:00:52.999-0400|SEVERE|glassfish3.0.1||_ThreadID=27;_ThreadName=Thread-1;|java.lang.IllegalStateException: Unable to retrieve EntityManagerFactory for unitName GuestbookPU
at com.sun.enterprise.container.common.impl.EntityManagerWrapper.init(
at com.sun.enterprise.container.common.impl.EntityManagerWrapper._getDelegate(
at com.sun.enterprise.container.common.impl.EntityManagerWrapper.createQuery(
at guest.GuestDao.getAllGuests(

Can someone help me ? The only change I did to the code was add the unit name to the DAO class: (if I remove it then the exception thrown is the same with null for the Unit Name)





Maybe the persistence.xml file has an error or maybe it is located in the wrong directory, because it seems that the persistence unit is unknown.

Try repeating the tutorial steps one by one carefully or download and use the ready to use Maven version of the tutorial.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)


I have gone over the turorial few times.

Here is my persistence.xml and attached please find the eclipse project layout: (Note eclipse is deploying the application and I can access the web page but I am unable to do any Database operations.)

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns=""

  <persistence-unit name="GuestbookPU" transaction-type="JTA">
      <property name="javax.persistence.jdbc.url" value="$objectdb/db/guests.odb"/>
      <property name="javax.persistence.jdbc.user" value="admin"/>
      <property name="javax.persistence.jdbc.password" value="admin"/>


Please post a zip file with your complete Eclipse project.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Attached please find the eclipse project in a zip file.


Thank you in advance.


This is the actual project ... sorry!



When I deploy the eclipse generated war file I get the same result. All DB operations fail.

When I deploy the Maven generated war file everything works fine with GlassFish.

Any help would be greatly appreciated.


Best Wishes



Can you take a look at my eclipse project and let me know what I am doing wrong?

I really would like to get the development in eclipse going.

Best Wishes


There are 2 problems with your persistence.xml file:

  • It has a wrong name - persistance.xml instead of persistence.xml
  • The transaction-type should be JTA instead of RESOURCE_LOCAL.
ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Thank you! Those corrections fixed the problem.

Post Reply