Bonjour
Je suis débutant en jpa et je suis le tutoriel de Serge Tahe: Persistance java 5 par la pratique (que je remercie au passage pour la pertinence de ses travaux).L'exercice est une implementation Spring/jpa avec une entité Personne. Toutes les classes des trois couches ont été importées ainsi que les bibliothèques, Mysql et tomcat 5 ont été démarrés.
La classe test InitDB.java est la suivante

code:
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package tests;
 
import java.text.ParseException;
import java.text.SimpleDateFormat;
 
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
 
import service.IService;
import entites.Personne;
 
public class InitDB {
 
	// couche service
	private static IService service;
 
	// constructeur
	public static void main(String[] args) throws ParseException {
		// configuration de l'application
		ApplicationContext ctx = new ClassPathXmlApplicationContext("spring-config.xml");
		// couche service
		service = (IService) ctx.getBean("service");
		// on vide la base
		clean();
		// on la remplit
		fill();
		// on vérifie visuellement
		dumpPersonnes();
	}
 
	// affichage contenu table
	private static void dumpPersonnes() {
		System.out.format("[personnes]%n");
		for (Personne p : service.getAll()) {
			System.out.println(p);
		}
	}
 
	// remplissage table
	public static void fill() throws ParseException {
		// création personnes
		Personne p1 = new Personne("p1", "Paul", new SimpleDateFormat("dd/MM/yy").parse("31/01/2000"), true, 2);
		Personne p2 = new Personne("p2", "Sylvie", new SimpleDateFormat("dd/MM/yy").parse("05/07/2001"), false, 0);
		// qu'on sauvegarde
		service.saveArray(new Personne[] { p1, p2 });
	}
 
	// supression éléments de la table
	public static void clean() {
		for (Personne p : service.getAll()) {
			service.deleteOne(p.getId());
		}
	}
}
Cette classe crée deux personnes qu'elle enregistre dans la base de données.Tout se passe très bien sauf qu'à l'exécution j'ai ceci:

console:

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
10:07:09,821  INFO ClassPathXmlApplicationContext:305 - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1abc7b9: display name [org.springframework.context.support.ClassPathXmlApplicationContext@1abc7b9]; startup date [Thu Nov 03 10:07:09 CET 2011]; root of context hierarchy
10:07:10,114  INFO ClassPathXmlApplicationContext:317 - Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext@1abc7b9]: org.springframework.beans.factory.support.DefaultListableBeanFactory@184ec44
10:07:10,188  INFO ClassPathXmlApplicationContext:976 - Bean 'org.springframework.aop.config.internalAutoProxyCreator' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
10:07:10,227  INFO ClassPathXmlApplicationContext:976 - Bean 'dataSource' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
10:07:10,254  INFO ClassPathXmlApplicationContext:976 - Bean 'org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter#11d0a4f' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
10:07:10,258  INFO ClassPathXmlApplicationContext:976 - Bean 'org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver#18fd984' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
10:07:11,496  INFO ClassPathXmlApplicationContext:976 - Bean 'entityManagerFactory' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
10:07:11,501  INFO ClassPathXmlApplicationContext:976 - Bean 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
10:07:11,507  INFO ClassPathXmlApplicationContext:976 - Bean 'org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
10:07:11,533  INFO ClassPathXmlApplicationContext:976 - Bean 'entityManagerFactory' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
10:07:11,539  INFO ClassPathXmlApplicationContext:976 - Bean 'txManager' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
10:07:11,542  INFO ClassPathXmlApplicationContext:976 - Bean '(inner bean)' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
10:07:11,549  INFO ClassPathXmlApplicationContext:976 - Bean '(inner bean)' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
10:07:11,550  INFO ClassPathXmlApplicationContext:976 - Bean 'org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[personnes]
[3,0,p1,Paul,31/01/2000,true,2]
[4,0,p2,Sylvie,05/07/2001,false,0]
Seules les trois dernières étaient attendues. Le reste me parait étrange, je ne comprends pas. Quelqu'un peut-il m'aider.
Merci d'avance
Coulane