Bonjour, j'ai une erreur de persistance lors de mon export de jar.

Car le programme se lance correctement sous Eclipse, mais une fois exporté, il me sort la stack suivante :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
[2013-08-01 09:50:56,083] INFO  org.hibernate.annotations.common.Version  - HCANN000001: Hibernate Commons Annotations {4.0.2.Final}
[2013-08-01 09:50:56,095] INFO  org.hibernate.Version  - HHH000412: Hibernate Core {4.2.3.Final}
[2013-08-01 09:50:56,099] INFO  org.hibernate.cfg.Environment  - HHH000206: hibernate.properties not found
[2013-08-01 09:50:56,103] INFO  org.hibernate.cfg.Environment  - HHH000021: Bytecode provider name : javassist
[2013-08-01 09:50:56,206] FATAL com.cwfse.main.Cmain  - bdd init
javax.persistence.PersistenceException: Unable to configure EntityManagerFactory
	at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:387)
	at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:58)
	at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63)
	at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)
	at com.cwfse.main.Cmain.main(Cmain.java:145)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
	at java.lang.String.substring(Unknown Source)
	at org.hibernate.ejb.packaging.JarVisitorFactory.getJarURLFromURLEntry(JarVisitorFactory.java:60)
	at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:353)
je ne comprends pas trop la cause .... je ne vois pas pourquoi il ne récupère pas ses infos.

Sinon mon projet est dans le cadre d'une base hsqldb embarquée voici mon xml

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
  version="2.0" xmlns="http://java.sun.com/xml/ns/persistence">
  <persistence-unit name="CWFSE" transaction-type="RESOURCE_LOCAL">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <class>com.cwfse.model.entities.MessagesErreur</class>
    <class>com.cwfse.model.entities.DocXslEntity</class>
    <class>com.cwfse.model.entities.RadiosPropEntity</class>
    <class>com.cwfse.model.entities.PratConfigEntity</class>
    <class>com.cwfse.model.entities.ReferEntity</class>
    <properties>
      <property name="javax.persistence.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
      <property name="javax.persistence.jdbc.url" value="jdbc:hsqldb:file:bdd/cwfse_p;shutdown=true"/>
      <property name="javax.persistence.jdbc.user" value="sa"/>
      <property name="javax.persistence.jdbc.password" value=""/>
     <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
      <property name="hibernate.hbm2ddl.auto" value="update"/>
    </properties>
  </persistence-unit>
  <persistence-unit name="Session_App" transaction-type="RESOURCE_LOCAL">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <class>com.cwfse.model.entities.BeneficiaireEntity</class>
    <class>com.cwfse.model.entities.PatientEntity</class>
    <properties>
      <property name="javax.persistence.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
      <property name="javax.persistence.jdbc.url" value="jdbc:hsqldb:mem:testdb"/>
      <property name="javax.persistence.jdbc.user" value="sa"/>
      <property name="javax.persistence.jdbc.password" value=""/>
      <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
      <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
    </properties>
  </persistence-unit>
</persistence>
et la portion de code de mon main

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
private static final String PERSISTENCE_UNIT_NAME = "CWFSE";
	public static EntityManagerFactory factory;
	private static EntityManager em;
	private static Logger logger= Logger.getLogger(Cmain.class);
 
	/**
         * Point d'entrée de l'Application
         * @param args (paramètres de la VM)
         */
	public static void main(String[] args) {
 
 
		isConnect = false;
		isDead =false;
		 /* Port à utiliser pour communiquer avec l'instance de l'application lancée.*/
		final int PORT = 11666;
		  // Message à envoyer à l'application lancée lorsqu'une autre instance essaye de démarrer.
		  final String MESSAGE = "instance de CWFSE déjà lancée";
		  // Actions à effectuer lorsqu'une autre instance essaye de démarrer.
 
		  logger.info(PERSISTENCE_UNIT_NAME);
		 if(null == uniqueInstance){
		  uniqueInstance = new UniqueInstance(PORT, MESSAGE, null);
		 }
		  // Si aucune autre instance n'est lancée...
		  if(uniqueInstance.launch()) {
			  PropertyConfigurator.configure(Cmain.class.getClassLoader().getResource("log4J.properties"));
			  SupprimeLog();
 
			  try {
	               factory= Persistence.createEntityManagerFactory("CWFSE");
                } catch (Exception e2) {
	               logger.fatal("bdd init",e2);
                }
quelqu'un aurez une idée de l'erreur ?