Bonjour, étant débutant en hibernate -spring, j'ai tenté de suivre le tutoriel de baptiste meurant sur le développement d'une application blanche avec tapestry. mais lorsque j'essaye de l'exécuter sur le serveur voici l'erreur qu'il me ressort :
Et voici le fichier ApplicationContextDao.xml qui ncontient l'initialisation du bean sessionFactory :org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userManagerTarget' defined in ServletContext resource [/WEB-INF/ApplicationContext.xml]: Cannot resolve reference to bean 'userDao' while setting bean property 'userDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDao' defined in ServletContext resource [/WEB-INF/ApplicationContextDao.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 ServletContext resource [/WEB-INF/ApplicationContextDao.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(I)V
Et le fichier ApplicationContext.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
35
36
37
38
39
40
41
42
43
44
45 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <!-- Application context DAO layer --> <beans> <!-- General --> <bean id="userDao" class="com.web.domain.dao.hibernate3.UserDaoImpl"> <property name="sessionFactory"> <ref bean="sessionFactory" /> </property> </bean> <!-- sessionFactory --> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="configLocation"> <value>classpath:hibernate.cfg.xml</value> </property> <property name="configurationClass"> <value>org.hibernate.cfg.AnnotationConfiguration</value> </property> </bean> <!-- Configuration des transactions --> <!-- Configuration du proxy général --> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory"/> </bean> <bean id="transactionProxy" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager"> <ref bean="transactionManager"/> </property> <property name="transactionAttributes"> <props> <prop key="insert*">PROPAGATION_REQUIRED</prop> <prop key="update*">PROPAGATION_REQUIRED</prop> <prop key="save*">PROPAGATION_REQUIRED</prop> <prop key="*">PROPAGATION_REQUIRED, readOnly</prop> </props> </property> </bean> </beans>
Apparemment l'erreur viendrais de ma lib asm.. j'ai pourtant bien vérifié d'avoir la même version que celle utilisée dans le tutoriel...
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 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <bean id="userManagerTarget" class="com.web.service.impl.UserManagerImpl"> <property name="userDao"> <ref bean="userDao"/> </property> </bean> <bean id="userManager" parent="transactionProxy"> <property name="target"> <ref bean="userManagerTarget" /> </property> <property name ="transactionAttributeSource"> <bean class="org.springframework.transaction.annotation.AnnotationTransactionAttributeSource"/> </property> </bean> </beans>
Donc voilà, je suis ouvert à toute proposition (euh.. enfin pas toutes hein!! seulement les propositions techniques)
Et je vous remercie d'avance de votre aide ^^






)
Répondre avec citation




Partager