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 :

Erreur : Document root element "beans", must match DOCTYPE root "null".


Sujet :

Spring Java

  1. #1
    Membre habitué

    Profil pro
    Inscrit en
    Décembre 2002
    Messages
    120
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : Belgique

    Informations forums :
    Inscription : Décembre 2002
    Messages : 120
    Points : 133
    Points
    133
    Par défaut Erreur : Document root element "beans", must match DOCTYPE root "null".
    Bonsoir tous le monde,

    Voila j'essaie tant bien que mal de démarer une servlet, mais à chaque fois je suis confronté à cette exception.

    voici mon fichier prospection-servlet-config
    Code xml : 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
     
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="       http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
     
     
    	<bean name="prospection.htm" class="org.springframework.webflow.executor.mvc.FlowController">
    		<property name="flowExecutor" ref="flowExecutor"/>
    	</bean>
     
    	<!-- Resolves flow view names to .jsp templates -->
    	<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    		<property name="prefix" value="/WEB-INF/jsp/"/>
    		<property name="suffix" value=".jsp"/>
    	</bean>
     
    </beans>

    22:44:06,125 INFO [STDOUT] 21-02-08 22:44:06 ERROR [DispatcherServlet] Context initialization failed
    org.springframework.beans.factory.BeanDefinitionStoreException: Line 5 in XML document from ServletContext resource [/WEB-INF/prospection-servlet-config.xml] is invalid; nested exc
    eption is org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE root "null".
    org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE root "null".
    at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
    at org.apache.xerces.impl.dtd.XMLDTDValidator.rootElementSpecified(Unknown Source)
    at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)
    at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:222)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:173)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:148)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:129)
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:145)
    at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:126)
    at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
    at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:89)
    Est ce que quelqu'un sait comment je pourrais régler le problème ?

    merci d'avance

  2. #2
    Membre habitué

    Profil pro
    Inscrit en
    Décembre 2002
    Messages
    120
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : Belgique

    Informations forums :
    Inscription : Décembre 2002
    Messages : 120
    Points : 133
    Points
    133
    Par défaut
    Bon ok; j'ai résolu mon premier problème du fichier Servlet, en fait j'ai supprimé toutes les déclarations xsi xmlsn pour ne laisser que <beans> et j'ai rajouté une DTD. du coups sa passe.
    FICHER CORRIGE :

    Code xml : 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
     
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>
     
     
    	<bean name="prospection.htm" class="org.springframework.webflow.executor.mvc.FlowController">
    		<property name="flowExecutor" ref="flowExecutor"/>
    	</bean>
     
    	<!-- Resolves flow view names to .jsp templates -->
    	<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    		<property name="prefix" value="/WEB-INF/jsp/"/>
    		<property name="suffix" value=".jsp"/>
    	</bean>
     
    </beans>



    Par contre maintenant j'ai le même style d'erreur pour mon fichier de configuration de webflow

    Code xml : 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
     
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:flow="http://www.springframework.org/schema/webflow-config"
           xsi:schemaLocation="
               http://www.springframework.org/schema/beans
               http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
               http://www.springframework.org/schema/webflow-config
               http://www.springframework.org/schema/webflow-config/spring-webflow-config-1.0.xsd">
     
     
    	<!-- Creates the registry of flow definitions for this application -->
    	<flow:registry id="flowRegistry">
    		<flow:location path="/WEB-INF/flows/**-flow.xml"/>
    	</flow:registry>
    	<!-- Launches new flow executions and resumes existing executions. -->	
    	<flow:executor id="flowExecutor" registry-ref="flowRegistry"/>
     
     
     
    </beans>

  3. #3
    Membre habitué

    Profil pro
    Inscrit en
    Décembre 2002
    Messages
    120
    Détails du profil
    Informations personnelles :
    Âge : 42
    Localisation : Belgique

    Informations forums :
    Inscription : Décembre 2002
    Messages : 120
    Points : 133
    Points
    133
    Par défaut
    A priori si j'utilise spring 2.0 le problème ne se pose plus.
    Je vais donc faire sa.

  4. #4
    Rédacteur
    Avatar de Hikage
    Profil pro
    Inscrit en
    Mai 2004
    Messages
    1 177
    Détails du profil
    Informations personnelles :
    Âge : 40
    Localisation : Belgique

    Informations forums :
    Inscription : Mai 2004
    Messages : 1 177
    Points : 6 301
    Points
    6 301
    Par défaut
    Normal, les schéma XML ne son apparus que dans la version 2.0
    Hikage
    SCJP / SCWCD & SCWSJD Certified / Spring Framework Certified
    [Personal Web] [CV]

    F.A.Q Spring Framework - Participez !

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

Discussions similaires

  1. Réponses: 1
    Dernier message: 29/04/2012, 11h30
  2. Réponses: 2
    Dernier message: 13/05/2011, 10h45
  3. faces-config", must match DOCTYPE root "null"
    Par mimaaaa dans le forum JSF
    Réponses: 6
    Dernier message: 16/09/2008, 15h10
  4. [Eclipse / Jonas] Erreur "jonas-entity missing for bean"
    Par citygirl dans le forum Eclipse Java
    Réponses: 1
    Dernier message: 16/05/2005, 11h59

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