javax.persistence.PersistenceException

#1

Hi

I am trying to get a basic EclipseRCP project working with Objectdb. At the very first line in creating a View

public void createPartControl(Composite parent) {

    EntityManagerFactory emf =
         Persistence.createEntityManagerFactory("$objectdb/db/pilots.odb");

I get the following:

"javax.persistence.PersistenceException: No Persistence provider for EntityManager named pilots.odb
at javax.persistence.Persistence.createEntityManagerFactory(Unknown Source)....."

 I have wrapped the objectdb.jar in a plugin and added tat as a dependency to the project. Not sure what else I should do.

 

Any help would be appreciated.

cmahony

 

 

#2

This might be a class loader issue.

Could you please upload your sample project / projects?

ObjectDB Support
#3

You may also look at:

http://sourceforge.net/apps/mediawiki/iauthor/index.php

it seems as a very early release of the project but it might serve as an example.

ObjectDB Support
#4

The project is attached. Included is the plugin wrapped objectDb runtime.

#5

It seems that currently ObjectDB has to be embedded in the plugin and trying to use it as a separate bundle fails.

See also this issue that might be related.

Anyway, your application works after:

  • Removing dependency on the com.objectdb.objectdb plugin.
  • Adding objectdb.jar to the plugin runtime classpath.
  • Fixing "SELECT p FROM Point p" to "SELECT p FROM Pilot p" in View.

Attached the project after these modifications.

ObjectDB Support
#6

Hi

 

This is another bug. I cannot get past the previously mentioned line. I keep getting given apersistence error with "

No Persistence provider for EntityManager named $objectdb/db/pilots.odb" as the cause.

 

When I tried the tutorial example in a pure java project it worked fine. trying to use it in an EclipseRCP project is not working.

 

Thanks

Craig

#7

I don't get this exception. It seems that the test works now:

ObjectDB Support
#8

Hi

Yes it works now thank you. I fixed that obvious bug. It worked only after I refreshed the workspace and cleaned then project.

Thanks for your help.

 

cmahony

Reply