IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Wildfly/JBoss Java Discussion :

[ Spring MVC ] [ JBoss ] Erreur à l'instanciation..


Sujet :

Wildfly/JBoss Java

  1. #1
    Nouveau membre du Club Avatar de legzo
    Profil pro
    Inscrit en
    Juin 2005
    Messages
    52
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2005
    Messages : 52
    Points : 39
    Points
    39
    Par défaut [ Spring MVC ] [ JBoss ] Erreur à l'instanciation..
    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 :


    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)
    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
    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']
    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...

    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.

  2. #2
    Nouveau membre du Club Avatar de legzo
    Profil pro
    Inscrit en
    Juin 2005
    Messages
    52
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2005
    Messages : 52
    Points : 39
    Points
    39
    Par défaut
    Pour information, j'ai réussi à régler le problème. En fait à un moment dans le tutorial, les jsps sont déplacées dans un sous répertoire /jsp et il est précisé que :

    This strategy might not work in all application servers and if this is the case with the one you are using, just move the jsp directory up a level.
    J'y avais pas trop fait gaffe, mais le problème semblait venir de là... Pourtant je suis quasi sûr d'avoir déjà fait une webapp avec JBoss et des jsps dans un sous répertoire de mon WEB-INF, mais peut être que j'hallucine.

    Quiconque a des infos là dessus m'intéresse!

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Spring-mvc + Ajax = Erreur 406 Inacceptable
    Par deli2025 dans le forum Développement Web en Java
    Réponses: 1
    Dernier message: 17/03/2014, 16h24
  2. [Spring MVC] erreur de controleur
    Par cedcrow dans le forum Spring Web
    Réponses: 1
    Dernier message: 22/07/2008, 10h39
  3. [SPRING MVC]Erreur sur un Integer dans un Validator
    Par manuzinho dans le forum Spring Web
    Réponses: 2
    Dernier message: 31/08/2007, 15h58
  4. [Spring MVC] erreur dans popup !
    Par Tail dans le forum Spring Web
    Réponses: 1
    Dernier message: 02/07/2007, 14h31
  5. [Spring MVC][Validator] Ne stop pas si il y a une erreurs
    Par Hikage dans le forum Spring Web
    Réponses: 3
    Dernier message: 15/02/2006, 09h43

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo