Announcement Announcement Module
Collapse
No announcement yet.
Spring batch admin doesn't start with xsd validation disabled Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring batch admin doesn't start with xsd validation disabled

    I've embedded spring batch admin in my web application and disabled xsd validation in order to be able to configure some transaction properties (as per http://forum.springsource.org/showth...xsd-validation ).
    But disabling xsd validation it seems that some bean initialization suffers from missing default values: the application doesn't start complaining
    Caused by: java.lang.IllegalArgumentException: Invalid log level ''. The (case-insensitive) supported values are: FATAL,ERROR,WARN,INFO,DEBUG,TRACE
    at org.springframework.integration.handler.LoggingHan dler.<init>(LoggingHandler.java:69)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Construc tor.java:513)
    at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:126)
    Steps to reproduce using the spring batch admin sample module:
    * modify the web.xml in order to use a custom class to load the application context from xml
    * build the app
    * deploy and run
    where
    Code:
    	<context-param>
    		<param-name>contextClass</param-name>
    		<param-value>com.acme.NovalidationXmlWebApplicationContext</param-value>
    	</context-param>
    is a web.xml snippet needed to use a custom class to load the xml with no schema validation and
    Code:
    package com.acme;
    
    import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
    import org.springframework.web.context.support.XmlWebApplicationContext;
    
    /**
     * XML application context with no xsd validation.
     * 
     * @author Davide Cavestro
     *
     */
    public class NovalidationXmlWebApplicationContext extends XmlWebApplicationContext {
    
    	public NovalidationXmlWebApplicationContext () {
    		// no-op
    	}
    	
    	protected void initBeanDefinitionReader(XmlBeanDefinitionReader beanDefinitionReader) {
    		beanDefinitionReader.setValidating (false);
    //the following settings bring to same result: IllegalArgumentException
    //		beanDefinitionReader.setValidationMode (XmlBeanDefinitionReader.VALIDATION_NONE);
    //		beanDefinitionReader.setNamespaceAware (true);
    	}
    }
    is the class that disables xsd validation.

    What's wrong with my configuration?
    The main side effect is that my application cannot disable xsd validation and still embed spring batch admin.
    Last edited by d_cavestro; Jul 17th, 2012, 12:00 PM. Reason: Explained the main side effect
Working...
X