0 Replies Latest reply on Mar 30, 2012 7:31 AM by goutam mukherjee

    "Connection refused" error while trying to run Spring Batch

    goutam mukherjee Newbie

      We are trying to run Spring Batch from a Camel flow in FUSE ESB taking the basis of the sample from a post of another forum. We are getting the error - "SAXParseException: cvc-elt.1.a: Cannot find the declaration of element 'beans'." and before that we are getting "Connection refused". Have written a camel processor invoked from the camel routebuilder. The processor invokes a Spring Batch job. It is flowing up to the invocation of the job but then the error happens. Please find the spring batch job file and the exception trace below.

       

      The error is probably because the schema location is defined as http and we are using internet connection that uses a proxy. However we tried different options to try to mention the schema location from local file system after downloading the schema files but that is not working either.

       

      We are using apache-servicemix-4.4.1-fuse-02-05, Spring 3.0.5, Spring Batch 2.1.8. We have installed spring batch through feature:install and then installed our application.

       

       

      -


       

      <?xml version="1.0" encoding="UTF-8"?>

      <beans xmlns="http://www.springframework.org/schema/beans"

            xmlns:sb="http://www.springframework.org/schema/batch"

           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-3.0.xsd

                http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.1.xsd"

       

            

      -


       

      14:01:02,742 | INFO  | xtenderThread-10 | OsgiSpringCamelContext           | 90 - org.apache.camel.camel-core - 2.8.0.fuse-02-05 | Apache Camel 2.8.0-fuse-02-05 (CamelContext: 218-camel-6) started in 0.260 seconds

      14:01:02,742 | INFO  | xtenderThread-10 | OsgiBundleXmlApplicationContext  | 76 - org.springframework.context - 3.0.5.RELEASE | Publishing application context as OSGi service with properties {org.springframework.context.service.name=SpringBatch-0.0.1-SNAPSHOT, Bundle-SymbolicName=SpringBatch-0.0.1-SNAPSHOT, Bundle-Version=0.0.0}

      14:01:02,752 | INFO  | xtenderThread-10 | ContextLoaderListener            | 85 - org.springframework.osgi.extender - 1.2.1 | Application context successfully refreshed (OsgiBundleXmlApplicationContext(bundle=SpringBatch-0.0.1-SNAPSHOT, config=osgibundle:/META-INF/spring/*.xml))

      14:02:03,781 | INFO  | rojectsLStestsrc | plicationContextProxy4Singletons | 76 - org.springframework.context - 3.0.5.RELEASE | Refreshing hello.ApplicationContextProxy4Singletons@17ff1ad: startup date ; root of context hierarchy

      14:02:03,781 | INFO  | rojectsLStestsrc | DefaultListableBeanFactory       | 74 - org.springframework.beans - 3.0.5.RELEASE | Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@147a87e: defining beans []; root of factory hierarchy

      14:02:03,791 | INFO  | rojectsLStestsrc | XmlBeanDefinitionReader          | 74 - org.springframework.beans - 3.0.5.RELEASE | Loading XML bean definitions from class path resource

      14:02:04,801 | WARN  | rojectsLStestsrc | XmlBeanDefinitionReader          | 74 - org.springframework.beans - 3.0.5.RELEASE | Ignored XML validation warning

      java.net.ConnectException: Connection refused: connect

           at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)[:]

           at org.apache.xerces.util.ErrorHandlerWrapper.warning(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.traversers.XSDHandler.reportSchemaWarning(Unknown Source)[:]

           at org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument1(Unknown Source)[:]

           at org.apache.xerces.impl.xs.traversers.XSDHandler.getSchemaDocument(Unknown Source)[:]

           at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)[:]

           at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)[:]

           at org.apache.xerces.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown Source)[:]

           at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)[:]

           at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown Source)[:]

           at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)[:]

           at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.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.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)[74:org.springframework.beans:3.0.5.RELEASE]

           at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)[74:org.springframework.beans:3.0.5.RELEASE]

           at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)[74:org.springframework.beans:3.0.5.RELEASE]

           at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)[74:org.springframework.beans:3.0.5.RELEASE]

           at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)[74:org.springframework.beans:3.0.5.RELEASE]

           at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:122)[76:org.springframework.context:3.0.5.RELEASE]

           at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:92)[76:org.springframework.context:3.0.5.RELEASE]

           at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)[76:org.springframework.context:3.0.5.RELEASE]

           at org.springframework.batch.core.configuration.support.ClassPathXmlApplicationContextFactory$ResourceXmlApplicationContext.(ApplicationContextJobFactory.java:41)[216:org.springframework.batch.core:2.1.8.RELEASE]

           at hello.SpringBatchJobRunner.createJob(SpringBatchJobRunner.java:98)[218:SpringBatch-0.0.1-SNAPSHOT:0]