Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
AW: AW: [eclipselink-users] No Persistence provider for EntityManager - Error when using EclipseLink

Hi Gordon,
 
while I tried to get EclipseLink working, I changed the name and forgot to rename, but that was only 1 reason.
Now I found out, that the Problem
    Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named default
occurs when
a)
Persistence Unit has a invalid name - thanks for the advice.
or
b)
EclipseLink cant handle the path where the project is stored.
 
If  I store my project in
C:\Documents and Settings\m03312\Data\My Local Data\javadev\eclipse_workspace_dali\DaliTest_eclipselink
the Exception occurs
If  I store my project in
N:\eclipse_workspace_dali\DaliTest_eclipselink
It does not :-/
 
Thanks for all your help,
best regards,
Alex

 
----- Ursprüngliche Mail ----
Von: Gordon Yorke <gordon.yorke@xxxxxxxxxx>
An: EclipseLink User Discussions <eclipselink-users@xxxxxxxxxxx>
Gesendet: Mittwoch, den 12. März 2008, 15:15:57 Uhr
Betreff: Re: AW: [eclipselink-users] No Persistence provider for EntityManager - Error when using EclipseLink

You need to give your persistence unit a name.  Try <persistence-unit name="default">.
--Gordon

Alex X wrote:
Hi Gordon,
 
many thanks for your fast response!
 
To answer your question:
 
1.
For testing I try to use eclipselink in Java SE enviroment, without application server.
In production there will be a apache tomcat (but not used as Java EE server)
 
2.
I think so, here is my persistence.xml
 

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

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

<persistence-unit name="">

<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>

<class>com.emd.testpersistence.PhaMatLoc</class>

<class>com.emd.testpersistence.PhaMatSales</class>

<class>com.emd.testpersistence.PhaMaterial</class>

<class>com.emd.testpersistence.PhaProduct</class>

<class>com.emd.testpersistence.SecVUserPrivDissolve</class>

<properties>

<property name="eclipselink.session-name" value="my-session"/>

<property name="eclipselink.logging.level" value="FINE"/>

<property name="eclipselink.jdbc.driver" value="oracle.jdbc.OracleDriver"/>

<property name="eclipselink.jdbc.url" value="jdbc:oracle:thin:@d11n02p02.merck.de:1521:rc02"/>

</properties>

</persistence-unit>

 

with toplink essentials I didn't need to use <provider>...</provider>

But here it doesn't seem to work.

 

3.

Yes, I see no other exception. And Eclipselink seems to do already something before, I get messages like

 

[EPS Config]: 2008.03.11 02:34:35.782--ServerSession(471035)--Thread(Thread[main,5,main])--The column name for element [private java.lang.String com.emd.testpersistence.PhaMatLoc.lcomp] is being defaulted to: LCOMP.

 

before the exception comes.

 

4.
Currently I use eclipselink-incubation-1.0M5, using eclipselink-incubation-20080228 results in the following error:
 

Exception in thread "main" Local Exception Stack:

Exception [EclipseLink-30005] (Eclipse Persistence Services - 1.0 (Build SNAPSHOT - 20080228)): org.eclipse.persistence.exceptions.PersistenceUnitLoadingException

Exception Description: An exception was thrown while searching for persistence archives with ClassLoader: sun.misc.Launcher$AppClassLoader@133056f

Internal Exception: javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 1.0 (Build SNAPSHOT - 20080228)): org.eclipse.persistence.exceptions.EntityManagerSetupException

Exception Description: Predeployment of PersistenceUnit [] failed.

Internal Exception: java.util.ConcurrentModificationException

at org.eclipse.persistence.exceptions.PersistenceUnitLoadingException.exceptionSearchingForPersistenceResources(PersistenceUnitLoadingException.java:121)

at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactory(PersistenceProvider.java:86)

at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)

at com.emd.testpersistence.MyEntityManager.main(MyEntityManager.java:89)

Caused by: javax.persistence.PersistenceException: Exception [EclipseLink-28018] (Eclipse Persistence Services - 1.0 (Build SNAPSHOT - 20080228)): org.eclipse.persistence.exceptions.EntityManagerSetupException

Exception Description: Predeployment of PersistenceUnit [] failed.

Internal Exception: java.util.ConcurrentModificationException

at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:809)

at org.eclipse.persistence.internal.jpa.JavaSECMPInitializer.callPredeploy(JavaSECMPInitializer.java:130)

at org.eclipse.persistence.internal.jpa.JavaSECMPInitializer.initPersistenceUnits(JavaSECMPInitializer.java:198)

at org.eclipse.persistence.internal.jpa.JavaSECMPInitializer.initialize(JavaSECMPInitializer.java:213)

at org.eclipse.persistence.jpa.PersistenceProvider.createEntityManagerFactory(PersistenceProvider.java:72)

... 2 more

Caused by: Exception [EclipseLink-28018] (Eclipse Persistence Services - 1.0 (Build SNAPSHOT - 20080228)): org.eclipse.persistence.exceptions.EntityManagerSetupException

Exception Description: Predeployment of PersistenceUnit [] failed.

Internal Exception: java.util.ConcurrentModificationException

at org.eclipse.persistence.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:209)

... 7 more

Caused by: java.util.ConcurrentModificationException

at java.util.HashMap$HashIterator.nextEntry(Unknown Source)

at java.util.HashMap$ValueIterator.next(Unknown Source)

at org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor.processAnnotations(MetadataProcessor.java:239)

at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:272)

at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:766)

... 6 more

 

 

best regards,
Alex

----- Ursprüngliche Mail ----
Von: Gordon Yorke <gordon.yorke@xxxxxxxxxx>
An: EclipseLink User Discussions <eclipselink-users@xxxxxxxxxxx>
Gesendet: Dienstag, den 11. März 2008, 14:16:56 Uhr
Betreff: Re: [eclipselink-users] No Persistence provider for EntityManager - Error when using EclipseLink

Hello Alex,
  What application server are you running in?  Are you specifying the
Persistence provider in your persistence.xml file?  Is that the only
exception that you see?  Are you using the latest nightly from EclipseLink?
--Gordon

Alex_S wrote:
> Hi everybody,
>
>
> I have tried to switch my application from Toplink Essentials to
> Eclipselink, but it currently doesn't work.
>
> After replacing the jar library and doing the necessary changes in
> persistence.xml and source code I always get an
>
> Exception in thread "main" javax.persistence.PersistenceException: No
> Persistence provider for EntityManager named default
>     at
> javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:89)
>     at com.emd.testpersistence.MyEntityManager.main(MyEntityManager.java:89)
>
>
> Thx for help,
> Alex

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users



E-Mails jetzt auf Ihrem Handy..


-----Integrierter Anhang folgt-----

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users



Lesen Sie Ihre E-Mails jetzt einfach von unterwegs mit Yahoo! Go.

Back to the top