2 Replies Latest reply on Dec 25, 2014 10:51 AM by Nitesh jain

    SAXParseException -Cannot find the declaration of element 'beans'

    Nitesh jain Newbie

      Jboss Fuse 6.0 is unable to parse the camel_context.xml when called from a java code as below. i don't get any such error when i run in eclipse.


      ApplicationContext ac = new ClassPathXmlApplicationContext("camel_context.xml");

      CamelContext context = SpringCamelContext.springCamelContext(ac);


      camel_context.xml:

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

          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tool="http://www.springframework.org/schema/tool"

          xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd

                  http://www.springframework.org/schema/tool http://www.springframework.org/schema/tool/spring-tool-2.5.xsd">


          <bean id="testRoute" class="com.hp.som.devicecapabilities.actions.TestRouter" />


      </beans>


      log:

      2014-12-16 10:35:57,969 | INFO  | ClassPathXmlApplicationContext   | 128 - org.apache.servicemix.bundles.spring-context - 3.2.8.RELEASE_1 | Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@302d6c6e: startup date [Tue Dec 16 10:35:57 IST 2014]; root of context hierarchy

      2014-12-16 10:35:57,969 | INFO  | XmlBeanDefinitionReader          | 131 - org.apache.servicemix.bundles.spring-beans - 3.2.8.RELEASE_1 | Loading XML bean definitions from class path resource [camel_context.xml]

      2014-12-16 10:36:24,310 | WARN  | XmlBeanDefinitionReader          | 131 - org.apache.servicemix.bundles.spring-beans - 3.2.8.RELEASE_1 | Ignored XML validation warning

      java.net.ConnectException: Connection timed out: 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)[131:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]

              at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)[131:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]

              at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)[131:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]

              at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)[131:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]

              at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)[131:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]

              at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)[131:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]

              at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)[131:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]

              at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:243)[131:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]

              at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:127)[128:org.apache.servicemix.bundles.spring-context:3.2.8.RELEASE_1]

              at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:93)[128:org.apache.servicemix.bundles.spring-context:3.2.8.RELEASE_1]

              at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)[128:org.apache.servicemix.bundles.spring-context:3.2.8.RELEASE_1]

              at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)[128:org.apache.servicemix.bundles.spring-context:3.2.8.RELEASE_1]

              at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)[128:org.apache.servicemix.bundles.spring-context:3.2.8.RELEASE_1]

              at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)[128:org.apache.servicemix.bundles.spring-context:3.2.8.RELEASE_1]

              at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)[128:org.apache.servicemix.bundles.spring-context:3.2.8.RELEASE_1]

              at com.hp.som.devicecapabilities.actions.GetCache.process(GetCache.java:45)[301:com.hp.som.hazelCastNode1:1.0.0]

              at org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:103)[149:org.apache.camel.camel-core:2.12.0.redhat-610379]

              at org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:71)[149:org.apache.camel.camel-core:2.12.0.redhat-610379]

              at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[149:org.apache.camel.camel-core:2.12.0.redhat-610379]

              at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:110)[149:org.apache.camel.camel-core:2.12.0.redhat-610379]

              at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[149:org.apache.camel.camel-core:2.12.0.redhat-610379]

              at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)[149:org.apache.camel.camel-core:2.12.0.redhat-610379]

              at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[149:org.apache.camel.camel-core:2.12.0.redhat-610379]

              at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)[149:org.apache.camel.camel-core:2.12.0.redhat-610379]

              at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[149:org.apache.camel.camel-core:2.12.0.redhat-610379]

              at org.apache.camel.processor.ChoiceProcessor.process(ChoiceProcessor.java:111)[149:org.apache.camel.camel-core:2.12.0.redhat-610379]

              at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[149:org.apache.camel.camel-core:2.12.0.redhat-610379]

              at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)[149:org.apache.camel.camel-core:2.12.0.redhat-610379]

              at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[149:org.apache.camel.camel-core:2.12.0.redhat-610379]

              at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[149:org.apache.camel.camel-core:2.12.0.redhat-610379]

              at org.apache.camel.component.cxf.CxfConsumer$1.asyncInvoke(CxfConsumer.java:92)[212:org.apache.camel.camel-cxf:2.12.0.redhat-610379]

              at org.apache.camel.component.cxf.CxfConsumer$1.invoke(CxfConsumer.java:72)[212:org.apache.camel.camel-cxf:2.12.0.redhat-610379]

              at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)[171:org.apache.cxf.cxf-api:2.7.0.redhat-610379]

              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_51]

              at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_51]

              at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)[171:org.apache.cxf.cxf-api:2.7.0.redhat-610379]

              at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:107)[171:org.apache.cxf.cxf-api:2.7.0.redhat-610379]

              at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)[171:org.apache.cxf.cxf-api:2.7.0.redhat-610379]

              at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)[171:org.apache.cxf.cxf-api:2.7.0.redhat-610379]

              at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:239)[177:org.apache.cxf.cxf-rt-transports-http:2.7.0.redhat-610379]

              at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:248)[177:org.apache.cxf.cxf-rt-transports-http:2.7.0.redhat-610379]

              at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:222)[177:org.apache.cxf.cxf-rt-transports-http:2.7.0.redhat-610379]

              at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:153)[177:org.apache.cxf.cxf-rt-transports-http:2.7.0.redhat-610379]

              at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:167)[177:org.apache.cxf.cxf-rt-transports-http:2.7.0.redhat-610379]

              at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:286)[177:org.apache.cxf.cxf-rt-transports-http:2.7.0.redhat-610379]

              at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:206)[177:org.apache.cxf.cxf-rt-transports-http:2.7.0.redhat-610379]

              at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)[98:org.apache.geronimo.specs.geronimo-servlet_3.0_spec:1.0]

              at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:262)[177:org.apache.cxf.cxf-rt-transports-http:2.7.0.redhat-610379]

              at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)[99:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]

              at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)[99:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]

              at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:69)[107:org.ops4j.pax.web.pax-web-jetty:3.0.6]

              at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)[99:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]

              at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533)[99:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]

              at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)[99:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]

              at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)[99:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]

              at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:219)[107:org.ops4j.pax.web.pax-web-jetty:3.0.6]

              at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)[99:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]

              at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)[99:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]

              at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)[99:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]

              at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)[99:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]

              at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:77)[107:org.ops4j.pax.web.pax-web-jetty:3.0.6]

              at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)[99:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]

              at org.eclipse.jetty.server.Server.handle(Server.java:370)[99:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]

              at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)[99:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]

              at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982)[99:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]

              at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043)[99:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]

              at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)[99:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]

              at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)[99:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]

              at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)[99:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]

              at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)[99:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]

              at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)[99:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]

              at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)[99:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]

              at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)[99:org.eclipse.jetty.aggregate.jetty-all-server:8.1.14.v20131031]

              at java.lang.Thread.run(Thread.java:744)[:1.7.0_51

      Caused by: org.xml.sax.SAXParseException: cvc-elt.1.a: Cannot find the declaration of element 'beans'.

              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.XMLErrorReporter.reportError(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)[131:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]

              at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)[131:org.apache.servicemix.bundles.spring-beans:3.2.8.RELEASE_1]