Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Eclipselink in SE Environment not able to provide persistence

It looks like your persistence.xml is missing the root element.

Adding the <persistence> element

i.e.

<persistence xmlns="http://java.sun.com/xml/ns/persistence"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://java.sun.com/xml/ns/persistence persistence_1_0.xsd" version="1.0">

--- Your current persistence.xml contents here ---

</persistence>

JMarco wrote:
So, had a look into the persistence code and found out that the line where
something wents wrong is the one where the factory should be created.
Earlier I could see how en object of org.eclipse.persistence.jpa.PersistenceProvider has been created which has been found in the method findAllProviders(). No other providers have been added.


for (PersistenceProvider provider : providers) {
            emf = provider.createEntityManagerFactory(persistenceUnitName,
properties);
            if (emf != null){
                break;
            }
        }

I can not look deeper into it because I don't have the code of
"PersistenceProvider provider".

After beeing not able to create a EMF I can watch how my exception get
thrown which is nice to see but not very helpful :)

if (emf == null) {
            throw new PersistenceException("No Persistence provider for
EntityManager named " + persistenceUnitName);
        }

The name of the persistence unit is "EclipseLinkTest" in the persistence
file and also in my invocation of "createEntityManagerFactory()".

And yes. It's my first try to use JPA without an applicationserver in the
background. I put the project files (~4 MB) on http://drop.io/rnoilng/



Back to the top