It sounds like your META-INF/persistence.xml file isn't found on your classpath when running your RCP application. I really wish that createEntityManagerFactory would do something other than return null if a persistence unit isn't found.
I'd suggest taking a close look at the classpath for your RCP application. Hopefully this helps! -Rick On Mon, Jul 20, 2009 at 8:50 AM, Christopher Giblin <[email protected]>wrote: > > Hi, > When I run my test as a standalone Java program, things work. > When I launch the same code from within a plugin in an Eclipse RCP app, > Persistence.createEntityManagerFactory returns null. > > I have called Persistence.createEntityManagerFactory both ways, with and > without persistence.xml. Get null both ways. > > I have googled and have done everything recommended in those posts, > including initializing the factory with properties and making sure the jdbc > driver is on the class path. Still get null. > > I feel I am now going round in circles. Any hints? > > Thanks, chris > > > > >
