title: Why doesn't an exported runnable JAR of a Spring project work in another system?
body: <p>I have created an executable JAR for a Spring project through Eclipse.</p>
  
  <p>It worked as I expected on my system, but when I am trying to execute the same JAR on another system, it does not work. It throws an exception like:</p>
  
  <pre><code>Exception--&gt;
  org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from
   relative location [applicationContext-DAO.xml]
  Offending resource: class path resource [resources/applicationContext.xml]; nested exception is org.springframework.beans.factory.xml.X
  mlBeanDefinitionStoreException: Line 6 in XML document from class path resource [resources/applicationContext-DAO.xml] is invalid; nest
  ed exception is org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 336; cvc-elt.1: Cannot find the declaration of element 'bea
  ns'.
          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(DefaultBeanDefinition
  DocumentReader.java:271)
          at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentR
  eader.java:196)
          at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocument
  Reader.java:181)
          at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDoc
  umentReader.java:140)
          at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocum
  entReader.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 com.nextenders.server.ApplicationContext.initContextFile(ApplicationContext.java:88)
          at com.nextenders.server.ApplicationContext.&lt;init&gt;(ApplicationContext.java:60)
          at com.nextenders.server.ApplicationContext.getInstance(ApplicationContext.java:45)
          at com.nextenders.common.DaoReceiver.processRequest(DaoReceiver.java:49)
          at com.nextenders.common.DaoHandler.handleRequest(DaoHandler.java:12)
          at com.nextenders.facadeimplementation.facade.UtilityFacade.main(UtilityFacade.java:625)
  Caused by: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 6 in XML document from class path resource [reso
  urces/applicationContext-DAO.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 336; cvc-
  elt.1: Cannot find the declaration of element 'beans'.
          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.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinition
  DocumentReader.java:255)
          ... 14 more
  Caused by: org.xml.sax.SAXParseException; lineNumber: 6; columnNumber: 336; cvc-elt.1: Cannot find the declaration of element 'beans'.
          at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
          at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
          at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
          at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
          at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
          at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
          at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
          at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
          at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(Unknown Source)
          at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
          at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
          at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
          at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
          at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
          at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
          at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
          at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
          at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
          at com.sun.org.apache.xerces.internal.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)
          ... 17 more
  
  C:\programforforkdocument&gt;
  </code></pre>
  
  <p>I am not getting what is the issue? I have one doubt like is it something related to the path? Might my system be getting the proper path while executing because it is created from my system?</p>
  
  <p><strong>Update: New Error:</strong></p>
  
  <pre><code>org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 9 in
   XML document from class path resource [resources/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.
  </code></pre>
  
  <p>I am using <strong>spring--3.2.0.RC2.jar</strong> and my schema entry like </p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
      xmlns:tx="http://www.springframework.org/schema/tx"
      xsi:schemaLocation="http://www.springframework.org/schema/beans  http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd"&gt;
  </code></pre>