Announcement Announcement Module
Collapse
No announcement yet.
Spring Batch Admin app throws an error on startup Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Batch Admin app throws an error on startup

    Hi all,

    I am a Spring Batch newbie. I am trying to deploy Spring Batch Admin as web application on Websphere. Basically I just added the 2 jars "spring-batch-admin-manager-1.2.0.RELEASE.jar" and "spring-batch-admin-resources-1.2.0.RELEASE.jar" into the lib folder of my web application, and I added the code from the sample web.xml to my web.xml. Then when my application starts up it gives the following exception...

    Code:
    [9/22/11 14:33:20:675 EDT] 0000001b servlet       E com.ibm.ws.webcontainer.servlet.ServletWrapper init Uncaught.init.exception.thrown.by.servlet
    [9/22/11 14:33:20:675 EDT] 0000001b webapp        E com.ibm.ws.webcontainer.webapp.WebApp commonInitializationFinally SRVE0266E: Error occured while initializing servlets: {0}
          Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath*:/META-INF/spring/batch/bootstrap/**/*.xml]
    Offending resource: URL [wsjar:file:/C:/Users/244582/IBM/rationalsdp/workspace/SpringBatchWeb/WebContent/WEB-INF/lib/spring-batch-admin-resources-1.2.0.RELEASE.jar!/org/springframework/batch/admin/web/resources/webapp-config.xml]; nested exception is org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 38 in XML document from URL [wsjar:file:/C:/Users/244582/IBM/rationalsdp/workspace/SpringBatchWeb/WebContent/WEB-INF/lib/spring-batch-admin-manager-1.2.0.RELEASE.jar!/META-INF/spring/batch/bootstrap/integration/configuration-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'cron' is not allowed to appear in element 'poller'.
    	at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
    	at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
    	at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:245)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:196)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:181)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:111)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
    	at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
    	at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
    	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131)
    	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:522)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:436)
    	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:377)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:278)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
    	at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1649)
    	at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:410)
    	... 78 more
    Caused by: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 38 in XML document from URL [wsjar:file:/C:/Users/244582/IBM/rationalsdp/workspace/SpringBatchWeb/WebContent/WEB-INF/lib/spring-batch-admin-manager-1.2.0.RELEASE.jar!/META-INF/spring/batch/bootstrap/integration/configuration-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'cron' is not allowed to appear in element 'poller'.
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
    	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
    	at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:239)
    	... 99 more
    Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'cron' is not allowed to appear in element 'poller'.
    	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.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
    	at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
    	at org.apache.xerces.impl.xs.XMLSchemaValidator.processAttributes(Unknown Source)
    	at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
    	at org.apache.xerces.impl.xs.XMLSchemaValidator.emptyElement(Unknown Source)
    	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(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.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
    	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
    	... 104 more
    I think it does not like the following code in the configuration-context.xml located in the spring batch admin manager jar...

    Code:
    <file:inbound-channel-adapter directory="${batch.job.configuration.file.dir}" channel="job-configuration-files"
    		filename-pattern=".*\.xml">
    		<poller max-messages-per-poll="1" cron="5/1 * * * * *" />
    	</file:inbound-channel-adapter>
    But why? Am I using an old SAX parser? If so if there any way to Websphere to use a newer one, or can I cange this file somehoe to make it work?

    Any help would be great appreciated.

    Thank you,
    Jahan

  • #2
    Hi all,

    I believe this is resolved. I think the reason was because I did not have the Spring Integration jars in my class path. It seems these jars are a dependency for Spring Batch Admin.

    Comment


    • #3
      cvc-complex-type.3.2.2: Attribute 'cron' is not allowed to appear in element 'poller'

      Hi,

      I need to configure JMX in my Spring Batch Application. I added Spring 1.2 manager, resource and integration jars and on the server startup,
      I am getting the same error. Please suggest.

      Error:
      Caused by: org.springframework.beans.factory.xml.XmlBeanDefin itionStoreException: Line 38 in XML document from URL [jar:file:/D:/EclipseWorkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/SpringBatchWeb/WEB-INF/lib/spring-batch-admin-manager-1.2.0.RELEASE.jar!/META-INF/spring/batch/bootstrap/integration/configuration-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'cron' is not allowed to appear in element 'poller'.
      at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:396)
      at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:334)
      at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:302)
      at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:143)
      at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:178)
      at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.importBeanDefinitionResour ce(DefaultBeanDefinitionDocumentReader.java:187)
      ... 33 more
      Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'cron' is not allowed to appear in element 'poller'.
      at com.sun.org.apache.xerces.internal.util.ErrorHandl erWrapper.createSAXParseException(Unknown Source)
      at com.sun.org.apache.xerces.internal.util.ErrorHandl erWrapper.error(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLErrorRe porter.reportError(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLErrorRe porter.reportError(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.xs.XMLSche maValidator$XSIErrorReporter.reportError(Unknown Source)

      Thanks,
      Sudhakar

      Comment

      Working...
      X