Configuration de persistence.xml en mode standalone (Java SE) avec Toplink
Bonjour,
Je voudrais utiliser JPA en mode standalone avec toplink. J'ai utilisé cette doc pour renseigner le fichier persistence.xml :
https://glassfish.dev.java.net/javae...e-support.html
Voici donc mon fichier persistence.xml :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
version="1.0">
<persistence-unit name="sample">
<provider>oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider</provider>
<!-- All persistence classes must be listed -->
<class>beans.Address</class>
<class>beans.Person</class>
<properties>
<!-- Provider-specific connection properties -->
<property name="toplink.jdbc.driver" value="<database driver>"/>
<property name="toplink.jdbc.url" value="<database url>"/>
<property name="toplink.jdbc.user" value="<user>"/>
<property name="toplink.jdbc.password" value="<password>"/>
<!-- Provider-specific settings -->
<property name="toplink.logging.level" value="INFO"/>
</properties>
</persistence-unit>
</persistence> |
Seulement je rencontre un erreur à l'exécution :
Code:
1 2 3 4 5 6 7 8 9 10
|
Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named sample: Provider named oracle.toplink.essentials.PersistenceProvider threw unexpected exception at create EntityManagerFactory:
oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException
Local Exception Stack:
Exception [TOPLINK-30005] (Oracle TopLink Essentials - 2.0.1 (Build b04-fcs (04/11/2008))): oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException
Exception Description: An exception was thrown while searching for persistence archives with ClassLoader: sun.misc.Launcher$AppClassLoader@1ba34f2
Internal Exception: Exception [TOPLINK-30004] (Oracle TopLink Essentials - 2.0.1 (Build b04-fcs (04/11/2008))): oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException
Exception Description: An exception was thrown while processing persistence.xml from URL: file:/home/hadrien/workspace/eclipse/hibernate/jpa/bin/
Internal Exception:
(1. The value of attribute "value" associated with an element type "null" must not contain the '<' character.) |
Il semble que l'attribut value du tag property n'admet pas le caractère "<". Or, si j'enlève les brackets, j'ai une autre exception :
Code:
1 2 3 4
|
Exception in thread "main" Local Exception Stack:
Exception [TOPLINK-4003] (Oracle TopLink Essentials - 2.0.1 (Build b04-fcs (04/11/2008))): oracle.toplink.essentials.exceptions.DatabaseException
Exception Description: Configuration error. Class [database driver] not found. |
Quelqu'un a-t-il déjà utilisé JPA avec Toplink ? Pouvez-vous m'aider à renseigner mon fichier persistence.xml ?