J'essaye d'utiliser eclipse avec Spring et hibernate.
J'ai réalisé le tuto vidéo suivant : [ame="http://vimeo.com/15705668"]Tutoriel JSF, Spring et Hibernate on Vimeo[/ame]
Mais voila mon fichier de configuration de Spring n'arrive pas à être charger.
application-context.xml
Suite à un appel basique
Code : Sélectionner tout - Visualiser dans une fenêtre à part 
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
L'erreur :
Code : Sélectionner tout - Visualiser dans une fenêtre à part 
2
3
4
Je pense que c'est un problème de librairie.org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [application-context.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.config.internalTransactionAdvisor': Cannot create inner bean '(inner bean)' of type [org.springframework.transaction.interceptor.TransactionInterceptor] while setting bean property 'transactionInterceptor'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)': Cannot resolve reference to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [application-context.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [application-context.xml]: Invocation of init method failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.hibernate.cfg.AnnotationConfiguration]: Constructor threw exception; nested exception is java.lang.ClassCastException: org.hibernate.annotations.common.reflection.java.JavaReflectionManager cannot be cast to org.hibernate.annotations.common.reflection.MetadataProviderInjector
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:478)
Donc voici les librairies installées :
J'ai lu que les dernière version d'hibernate n'utilise plus commons-loggin mais slf4j (si on enlève ceux installé on obtient la même erreur).
Si j'enleve commons-loggin j'obtient l'erreur suivante :
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.springframework.util.ClassUtils.<clinit>(ClassUtils.java:73)
at org.springframework.core.io.DefaultResourceLoader.<init>(DefaultResourceLoader.java:53)
at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:199)
at org.springframework.context.support.AbstractRefreshableApplicationContext.<init>(AbstractRefreshableApplicationContext.java:84)
at org.springframework.context.support.AbstractRefreshableConfigApplicationContext.<init>(AbstractRefreshableConfigApplicationContext.java:59)
at org.springframework.context.support.AbstractXmlApplicationContext.<init>(AbstractXmlApplicationContext.java:58)
Il doit me manquer soit une librairie soit une ligne a changer pour adapter à SLF4 mais je ne vois pas et je commence à désespérer.
Merci de m'aider ou de me guider.

 

 
		
		 
         
 

 
			
			

 
   
 


 Configuration Hibernate Spring
 Configuration Hibernate Spring
				
 Répondre avec citation
  Répondre avec citation

 
   
						
 
   
 
 
						
Partager