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!