title: Creating double-clickable 'uber' jar that pulls in other jars of a spring application
body: <p>I have a mavenized, multi-module spring-based(3.0.1) application that runs in tomcat.  I'm trying to create a standalone tool that I can distribute to users via a single jar(so they can just double-click on it), that bundles in some of the modules of the application mentioned above.</p>
  
  <p>I've used the maven-shade-plugin to assemble this jar.  If I explode the jar it appears as if all of the dependencies are there and the two spring metadata files have been properly concatenated from all of the individual spring jars.  The application runs, up until the point where I attempt to instantiate a <code>ClassPathXmlApplicationContext</code>. When a user clicks a button in the application, the following method is executed:</p>
  
  <pre><code>public void createAppContext() {
     ClassPathXmlApplicationContext context = 
         new ClassPathXmlApplicationContext(springFiles);
  }
  </code></pre>
  
  <p>"springFiles" is declared in the class as follows:</p>
  
  <pre><code>public final String[] springFiles = { "/applicationContext-beans.xml" };
  </code></pre>
  
  <p>When the above method is executed the following error appears:</p>
  
  <pre>
  Exception in thread "Thread-8" java.lang.ArrayIndexOutOfBoundsException: 3350
          at org.springframework.asm.ClassReader.(Unknown Source)
          at org.springframework.asm.ClassReader.(Unknown Source)
          at org.springframework.asm.ClassReader.(Unknown Source)
          at org.springframework.core.type.classreading.SimpleMetadataReader.(SimpleMetadataReader.java:48)
          at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)
          at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:82)
          at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:76)
          at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.checkConfigurationClassCandidate(ConfigurationClassBeanDefinitionReader.java:302)
          at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:157)
          at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:132)
          at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:584)
          at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:405)
          at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)
          at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:93)
          at com.mycompany.StandaloneTool$2.run(StandaloneTool.java:124)
  </pre>
  
  <p>Any help would be greatly appreciated!</p>