Tutoriel Tapestry5, Spring [..] par Baptiste Meurant
Bonsoir,
je viens de déployer ce tuto ( http://baptiste-meurant.developpez.c...ing-hibernate/ ) sous tomcat puis Jboss,
à partir des sources fournies et le déployement ne s'est pas bien passé :
(I) Lors du déployement sous Tomcat, j'ai rencontré plusieurs erreurs :
1-
Code:
1 2 3 4 5
| SEVERE: Error reading tld listeners java.lang.NullPointerException
java.lang.NullPointerException
at org.apache.log4j.Category.isEnabledFor(Category.java:746) |
-> il s'agit d'un problème de compatibilité entre la version de Tomcat et la version de commons-logging utilisée (voir le lien http://blog.bazoud.com/post/2007/02/...ommons-logging pour la résolution du bug).
2-
Code:
1 2 3 4
| GRAVE: Error listenerStart
11 nov. 2007 22:37:41 org.apache.catalina.core.StandardContext start
GRAVE: Erreur de démarrage du contexte [/TapestrySpring2] suite aux erreurs précédentes
11 nov. 2007 22:37:42 org.apache.coyote.http11.Http11BaseProtocol start |
Là, je n'ai pas d'info sur l'origine de l'erreur.
(II) Lors du déploiement, Jboss est plus locace sur les erreurs rencontrées :
Code:
1 2 3 4 5 6 7 8 9
| 22:47:02,312 ERROR [ContextLoader] Context initialization failed
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.io.FileNotFoundException: class path resource [hibernate.cfg.xml] cannot be resolved to URL because it does not exist
Caused by:
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.io.FileNotFoundException: class path resource [hibernate.cfg.xml] cannot be resolved to URL because it does not exist
Caused by:
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.io.FileNotFoundException: class path resource [hibernate.cfg.xml] cannot be resolved to URL because it does not exist
Caused by:
java.io.FileNotFoundException: class path resource [hibernate.cfg.xml] cannot be resolved to URL because it does not exist
at org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:155) |
Code:
1 2 3 4 5
| 22:59:12,791 ERROR [StandardContext] Error listenerStart
22:59:12,791 ERROR [StandardContext] Context [/TapestrySpring2] startup failed due to previous errors
22:59:12,792 INFO [[/TapestrySpring2]] Closing Spring root WebApplicationContext
22:59:12,797 ERROR [WebModule] Starting failed jboss.web.deployment:war=TapestrySpring2.war,id=-233925444
org.jboss.deployment.DeploymentException: URL file:/usr/local/jboss-4.0.2/server/default/deploy/TapestrySpring2.war/ deployment failed |
- Bilan :
Mes problèmes de déploiement (me) semblent liées à :
(1) - un problème de version de librairie utilisée dans l'application,
(2)- un problème de classpath
Me reste donc le (2) à résoudre, sauf si qq'un m'apporte gentillement la solution 8-)
[Résolu] Tutoriel Tapestry5, Spring [..] par Baptiste Meurant
.. suite à une erreur mes fichiers html se trouvaient hors du dossier WEB-INF .
Une fois ces fichiers replacés dans ce dossier, je ne constate plus aucun problème de déploiement.
Merci à l'auteur pour ce tutoriel qui me semble excellent pour qui veut s'initier à Spring ou Ajax :D