title: Why doesn't a runnable JAR exported from Eclipse work?
body: <p>I have a project which runs fine from within Eclipse.
  But when I export it to a runnable JAR with dependencies packed into it it won't run.
  The error, when running the JAR from console is:</p>
  
  <p>EDIT (didnt run it with -jar before):</p>
  
  <pre><code>INFO: Loading XML bean definitions from class path resource [applicationContext-
  framework.xml]
  Exception in thread "main" java.lang.reflect.InvocationTargetException
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
          at java.lang.reflect.Method.invoke(Unknown Source)
          at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoa
  der.java:58)
  Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: IOExc
  eption parsing XML document from class path resource [applicationContext-framewo
  rk.xml]; nested exception is java.io.FileNotFoundException: class path resource
  [applicationContext-framework.xml] cannot be opened because it does not exist
          at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
  nDefinitions(XmlBeanDefinitionReader.java:349)
          at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
  nDefinitions(XmlBeanDefinitionReader.java:310)
          at org.springframework.beans.factory.support.AbstractBeanDefinitionReade
  r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
          at org.springframework.beans.factory.support.AbstractBeanDefinitionReade
  r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
          at org.springframework.beans.factory.support.AbstractBeanDefinitionReade
  r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
          at org.springframework.beans.factory.support.AbstractBeanDefinitionReade
  r.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)
          at org.springframework.context.support.AbstractXmlApplicationContext.loa
  dBeanDefinitions(AbstractXmlApplicationContext.java:113)
          at org.springframework.context.support.AbstractXmlApplicationContext.loa
  dBeanDefinitions(AbstractXmlApplicationContext.java:80)
          at org.springframework.context.support.AbstractRefreshableApplicationCon
  text.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
          at org.springframework.context.support.AbstractApplicationContext.obtain
  FreshBeanFactory(AbstractApplicationContext.java:422)
          at org.springframework.context.support.AbstractApplicationContext.refres
  h(AbstractApplicationContext.java:352)
          at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;i
  nit&gt;(ClassPathXmlApplicationContext.java:139)
          at org.springframework.context.support.ClassPathXmlApplicationContext.&lt;i
  nit&gt;(ClassPathXmlApplicationContext.java:93)
          at com.horstmann.violet.UMLEditorApplication.getApplicationContext(UMLEd
  itorApplication.java:111)
          at com.horstmann.violet.UMLEditorApplication.&lt;init&gt;(UMLEditorApplication
  .java:94)
          at com.horstmann.violet.UMLEditorApplication.main(UMLEditorApplication.j
  ava:84)
          ... 5 more
  Caused by: java.io.FileNotFoundException: class path resource [applicationContex
  t-framework.xml] cannot be opened because it does not exist
          at org.springframework.core.io.ClassPathResource.getInputStream(ClassPat
  hResource.java:143)
          at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBea
  nDefinitions(XmlBeanDefinitionReader.java:336)
          ... 20 more 
  </code></pre>
  
  <p>but the file is in <code>resources/</code> from the JAR-root.</p>
  
  <p>What am I missing or doing wrong?</p>