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

Spring Java Discussion :

Spring 3.0 Annotation


Sujet :

Spring Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Nouveau candidat au Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Janvier 2013
    Messages
    1
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2013
    Messages : 1
    Par défaut Spring 3.0 Annotation
    Salut ,

    Je viens de débuter avec le framework Spring 3.0 , et j'ai eu une erreur quand j'ai migré vers l'utilisation des annotations. Alors voilà le code de ma dispatcher-servlet.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
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:p="http://www.springframework.org/schema/p"
           xmlns:aop="http://www.springframework.org/schema/aop"
           xmlns:tx="http://www.springframework.org/schema/tx"
           xmlns:context="http://www.springframework.org/schema/context"
           xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
           http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
     
     
     
        <!– Using annotations –>
     
     
        <context:annotation-config />
     
     
     
       <!– Naming View Configuration –>
     
         <bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping"/>
     
     
        <!--
        Most controllers will use the ControllerClassNameHandlerMapping above, but
        for the index controller we are using ParameterizableViewController, so we must
        define an explicit mapping for it.
        -->
     
        <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
            <property name="mappings">
                <props>
                    <prop key="index.htm">indexController</prop>
                </props>
            </property>
        </bean>
     
        <!--
        The index controller.
        -->
     
        <bean name="indexController"
              class="org.springframework.web.servlet.mvc.ParameterizableViewController"
              p:viewName="index" />
     
        <bean id="viewResolver"
              class="org.springframework.web.servlet.view.InternalResourceViewResolver"
              p:prefix="/WEB-INF/jsp/"
              p:suffix=".jsp" />
     
     
        <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
            <property name="basename" value="properties.messages" />
        </bean>  
     
        <bean name="/inscription.htm" class="web.InscriController" />
     
         <context:component-scan base-package="web" />   
     
    </beans>
    Et voilà l'erreur :

    GRAVE: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.

    Alors qu'en dites vous ?

  2. #2
    Membre actif
    Profil pro
    Inscrit en
    Février 2004
    Messages
    72
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2004
    Messages : 72
    Par défaut
    J'ai l'impression que c'est ton fichier XML qui n'est pas valide.

    Tes balises de commentaires m'ont l'air louches

    Change :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <!– Naming View Configuration –>
    Par :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <!-- Naming View Configuration -->
    De même pour les autres commentaires qui ne suivent pas la nomenclature.

Discussions similaires

  1. [Framework] spring et l'annotation @autowired
    Par snetechen dans le forum Spring
    Réponses: 9
    Dernier message: 08/07/2013, 17h08
  2. [Data] transaction + spring 2.5 + annotations
    Par zorro13 dans le forum Spring
    Réponses: 1
    Dernier message: 28/11/2008, 12h28
  3. [Framework] Spring IOC et JPA Annotation
    Par jujuz dans le forum Spring
    Réponses: 2
    Dernier message: 09/06/2008, 13h31
  4. Réponses: 1
    Dernier message: 03/06/2008, 20h36
  5. [Data] [Grails+hibernate+spring] Annotations NoSuchMethodError
    Par quilo dans le forum Spring
    Réponses: 1
    Dernier message: 29/09/2007, 11h52

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