Bonjour à tous, ça faisait un moment que je n'étais pas passé par là, mais quand les problèmes incompréhensibles surviennent c'est ici que je viens
Alors j'essaye de suivre ce bon tutorial sur Spring MVC : http://www.springframework.org/docs/...ep-Part-1.html . Et tout se passait pas trop mal jusqu'à ce que j'arrive à l'étape 14 sur la page 2 (Step 14 – Improve the view and the controller).
En fait, je ne comprends vraiment pas ce qu'il se passe : mon war se déploie bien, j'arrive à aller à la racine de ma webapp, mais quand j'appelle une url en *.htm (le mapping renvoie sur ma DispatcherServlet), JBoss me crache cette exception :
Alors mon interrogation vient du fait qu'il semble manifestement arriver à démarrer mon appli Spring vu que j'ai quelques lignes de log d'initialisation :
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 org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [SpringAppController]: Constructor threw exception; nested exception is java.lang.Error: Unresolved compilation problems: Controller cannot be resolved to a type LogFactory cannot be resolved ModelAndView cannot be resolved to a type HttpServletRequest cannot be resolved to a type HttpServletResponse cannot be resolved to a type ServletException cannot be resolved to a type The method info(String) is undefined for the type Log ModelAndView cannot be resolved to a type java.lang.Error: Unresolved compilation problems: Controller cannot be resolved to a type LogFactory cannot be resolved ModelAndView cannot be resolved to a type HttpServletRequest cannot be resolved to a type HttpServletResponse cannot be resolved to a type ServletException cannot be resolved to a type The method info(String) is undefined for the type Log ModelAndView cannot be resolved to a type at SpringAppController.<init>(SpringAppController.java:6) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:494) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:171) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:148)
Mais par contre, une fois que j'appelle le Dispatcher, on dirait qu'il ne retrouve plus ses petits et qu'il ne sait plus ce qu'est une servlet ni un logger, ni quoi que ce soit en fait...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 15:53:37,305 INFO [DispatcherServlet] Initializing servlet 'springapp' 15:53:37,557 INFO [CollectionFactory] JDK 1.4+ collections available 15:53:37,576 INFO [DispatcherServlet] FrameworkServlet 'springapp': initialization started 15:53:37,577 INFO [0]] Loading WebApplicationContext for Spring FrameworkServlet 'springapp' 15:53:37,815 INFO [XmlBeanDefinitionReader] Loading XML bean definitions from ServletContext resource [/WEB-INF/springapp-servlet.xml] 15:53:37,923 INFO [XmlWebApplicationContext] Bean factory for application context [WebApplicationContext for namespace 'springapp-servlet']: org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [SpringAppController,urlMapping]; root of BeanFactory hierarchy 15:53:37,944 INFO [XmlWebApplicationContext] 2 beans defined in application context [WebApplicationContext for namespace 'springapp-servlet']
L'archi de mon war est la suivante :
Ca m'énerve un peu cette histoire, parce que je comprends pas le problème donc forcément j'ai aucune idée de comment le régler..
Si quelqu'un a une idée je suis preneur, merci beaucoup d'avance.
Partager