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

Format d'échange (XML, JSON...) Java Discussion :

Exception étrange : This parser does not support specification "null" version "null"


Sujet :

Format d'échange (XML, JSON...) Java

  1. #1
    Membre habitué
    Homme Profil pro
    SAQ
    Inscrit en
    Novembre 2005
    Messages
    167
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 41
    Localisation : Canada

    Informations professionnelles :
    Activité : SAQ
    Secteur : Service public

    Informations forums :
    Inscription : Novembre 2005
    Messages : 167
    Points : 194
    Points
    194
    Par défaut Exception étrange : This parser does not support specification "null" version "null"
    Salut à tous
    J'ai développé une application web avec spring grâce à maven et j'ai un problème

    Le contexte
    • Un application web utilisant springWebMVC
    • Cette application utilise un module Jar
    • Ce module Jar utilise DOM4J avec XPATH via Jaxen 1.1.1


    Le déploiement de l'application sur GlassFish 3.0.1 fonctionne très bien

    La problématique :
    Lorsque je tente d'effectuer une action sur mon application j'obtiens toujours l'erreur suivante :

    Code java : 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
     
    java.lang.UnsupportedOperationException: This parser does not support specification "null" version "null"
    	at javax.xml.parsers.SAXParserFactory.setSchema(SAXParserFactory.java:421)
    	at com.mor.blogengine.xml.io.XmlDataSourceProvider.createReaderAgainstSchema(XmlDataSourceProvider.java:84)
    	at com.mor.blogengine.xml.io.XmlDataSourceProvider.provide(XmlDataSourceProvider.java:58)
    	at com.mor.blogengine.xpath.SearchEngineConfigurator.<init>(SearchEngineConfigurator.java:38)
    	at com.mor.blogengine.xpath.SearchEngine.init(SearchEngine.java:64)
    	at com.mor.blogengine.xpath.SearchEngine.<init>(SearchEngine.java:56)
    	at com.mor.blogengine.dao.BlogCategoryRepository.getElementsForCriteria(BlogCategoryRepository.java:169)
    	at com.mor.blogengine.dao.BlogCategoryRepository.getElementsForCriteria(BlogCategoryRepository.java:33)
    	at com.mor.blogengine.controllers.CategoryController.getAllElements(CategoryController.java:67)
    	at com.mor.web.sitepersonnel.siteweb.SpringCategoryController.handleRequest(SpringCategoryController.java:52)
    	at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
    	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:771)
    	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
    	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
    	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)

    Cause possibles :
    Manque une libraire.. mais laquelle ?

    Ce que j'ai tenté:
    Code java : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    //debugging java xml specification
    System.setProperty("jaxp.debug", "1");

    Qui se trouve dans la méthode
    Code java : 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
     
     
        /**
         * Setup validation features and return reader
         * 
         * @throws javax.xml.parsers.ParserConfigurationException
         * @throws org.xml.sax.SAXException
         * @throws java.io.IOException
         * @param schemaSource
         * @return
         */
        private SAXReader createReaderAgainstSchema(URL schemaSource)
                throws SAXException, ParserConfigurationException, IOException {
            System.setProperty("jaxp.debug", "1");
            SAXParserFactory factory       = SAXParserFactory.newInstance();
            factory.setValidating(true);
            SchemaFactory    schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema");
           Schema s=schemaFactory.newSchema(new Source[] { new StreamSource(schemaSource.openStream()) });
     
     
            factory.setSchema(s);
     
            SAXParser parser = factory.newSAXParser();
            SAXReader reader = new SAXReader(parser.getXMLReader());
     
            // set the validation feature to true to report validation errors
           reader.setFeature("http://xml.org/sax/features/validation", true);
            // set the validation/schema feature to true to report validation errors against a schema
            reader.setFeature("http://apache.org/xml/features/validation/schema", true);
            //set the validation/schema-full-checking feature to true to enable full schema, grammar-constraint checking
            reader.setFeature("http://apache.org/xml/features/validation/schema-full-checking", true);
            return reader;
        }

    Lorsque je teste cette classe tout marche bien et j'obtiens la configuration JAXP suivante:

    Code java : 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
     
    JAXP: using thread context class loader (sun.misc.Launcher$AppClassLoader@5acac268) for search
    JAXP: Looking up system property 'javax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema'
    JAXP: The property is undefined.
    JAXP: found null in $java.home/jaxp.properties
    JAXP: no META-INF/services/javax.xml.validation.SchemaFactory file was found
    JAXP: attempting to use the platform default XML Schema validator
    JAXP: createInstance(com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory)
    JAXP: loaded com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory from jar:file:/K:/Program%20Files/Java/jdk1.6.0_20/jre/lib/rt.jar!/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.class
    JAXP: factory 'com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory' was found for http://www.w3.org/2001/XMLSchema
    JAXP: using thread context class loader (sun.misc.Launcher$AppClassLoader@5acac268) for search
    JAXP: Looking up system property 'javax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema'
    JAXP: The property is undefined.
    JAXP: found null in $java.home/jaxp.properties
    JAXP: no META-INF/services/javax.xml.validation.SchemaFactory file was found
    JAXP: attempting to use the platform default XML Schema validator
    JAXP: createInstance(com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory)
    JAXP: loaded com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory from jar:file:/K:/Program%20Files/Java/jdk1.6.0_20/jre/lib/rt.jar!/com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.class
    JAXP: factory 'com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory' was found for http://www.w3.org/2001/XMLSchema

    Lorsque je test toute ma librairie (utilisant cette méthode) tout passe
    Mais lorsque je tente d'exécuter une action spring, l'exception mentionnée survient!

    Ce que j'ai trouvé sur notre ami:Ceci

    Solutions ?

    Je ne sais pas

    éclairez moi SVP !

    Merci!
    Si derrière tout homme il y a une femme, devant ce même homme il y a l'ordinateur que cette femme a bousillé
    ---------

    Documentation is like sex: when it is good, it is very, very good; and when it is bad, it is better than nothing. (Dick Brandon)

  2. #2
    Membre actif Avatar de coco62
    Profil pro
    Inscrit en
    Mars 2004
    Messages
    237
    Détails du profil
    Informations personnelles :
    Âge : 53
    Localisation : France

    Informations forums :
    Inscription : Mars 2004
    Messages : 237
    Points : 278
    Points
    278
    Par défaut
    j'ai rencontré ce problème il y a quelques temps.
    La problème a été régler via un upgrade de la version de jdk.

    Passage de 1.4 à 1.5
    Eric

  3. #3
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Points : 48 807
    Points
    48 807
    Par défaut
    ton application tourne sur un conteneur type JBoss qui fournis les librairies jaxp, xml api, etc? Si oui, retirer ces librairies de ton WEB-INF/lib, celle-ci vont entrer en conflit avec celles ud conteneur et ce sera un beau melting pot

  4. #4
    Membre habitué
    Homme Profil pro
    SAQ
    Inscrit en
    Novembre 2005
    Messages
    167
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 41
    Localisation : Canada

    Informations professionnelles :
    Activité : SAQ
    Secteur : Service public

    Informations forums :
    Inscription : Novembre 2005
    Messages : 167
    Points : 194
    Points
    194
    Par défaut
    Le fait de développer l'application web SANS le support de MAVEN ( ce qui revient à que le WAR n,est pas considéré comme un module avec pom par NetBeans)
    m'a permis de spécifier moi-même le classpath associé
    Si derrière tout homme il y a une femme, devant ce même homme il y a l'ordinateur que cette femme a bousillé
    ---------

    Documentation is like sex: when it is good, it is very, very good; and when it is bad, it is better than nothing. (Dick Brandon)

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

Discussions similaires

  1. VMware - “This host does not support Intel VT-x”
    Par Taoufik109 dans le forum VMware
    Réponses: 1
    Dernier message: 13/03/2014, 12h00
  2. Object does not support this property or method
    Par Runsh63 dans le forum Macros et VBA Excel
    Réponses: 4
    Dernier message: 31/05/2011, 16h10
  3. Réponses: 7
    Dernier message: 22/02/2007, 11h29
  4. Réponses: 2
    Dernier message: 25/01/2007, 22h19
  5. Hibernate does not support SequenceGenerator.initialValue()
    Par nramariavelo dans le forum Hibernate
    Réponses: 2
    Dernier message: 28/07/2006, 15h16

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