title: How to load file from classpath with Spring 3?
body: <p>I have defined an ClassPathResource bean like so:</p>
  
  <pre><code>&lt;bean id="ivsInputResource" class="org.springframework.core.io.ClassPathResource"&gt;
      &lt;qualifier value="ivs" /&gt;
      &lt;constructor-arg index="0"
          value="classpath*:IVS90test.csv"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>But when the resource bean is injected, my app breaks with this exception:</p>
  
  <pre><code>Caused by: java.lang.IllegalStateException: Input resource must exist (reader is in 'strict' mode): class path resource [classpath*:IVS90test.csv]
      at org.springframework.batch.item.file.FlatFileItemReader.doOpen(FlatFileItemReader.java:256)
      at org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader.open(AbstractItemCountingItemStreamItemReader.java:134)
  </code></pre>
  
  <p>Obviously the resource cannot be found. When using FileSystemResource (with adjusted path) my app does work.</p>
  
  <p>How to properly load files from the classpath?</p>
  
  <p>My project is layed out as shown: </p>
  
  <p><img src="https://i.stack.imgur.com/LQigX.png" alt="screenshot of project layout in eclipse"> </p>