I’m trying to set up a Spring application to run in eclipse for the first time. I’m running it at as a standalone java application. The app builds without any errors but when I go to execute it, I get a ClassNotFoundException with the following stack trace:
DataLoadService [Java Application]
com.pikefin.services.DataLoadService at localhost:52871
Thread [main] (Suspended (exception ClassNotFoundException))
URLClassLoader$1.run() line: 217
AccessController.doPrivileged(PrivilegedExceptionAction<T>, AccessControlContext) line: not available [native method]
Launcher$AppClassLoader(URLClassLoader).findClass(String) line: 205
Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line: 321
Launcher$AppClassLoader.loadClass(String, boolean) line: 294
Launcher$AppClassLoader(ClassLoader).loadClass(String) line: 266
ClassPathXmlApplicationContext(AbstractApplicationContext).<init>(ApplicationContext) line: 161
ClassPathXmlApplicationContext(AbstractRefreshableApplicationContext).<init>(ApplicationContext) line: 90
ClassPathXmlApplicationContext(AbstractRefreshableConfigApplicationContext).<init>(ApplicationContext) line: 59
ClassPathXmlApplicationContext(AbstractXmlApplicationContext).<init>(ApplicationContext) line: 61
ClassPathXmlApplicationContext.<init>(String[], boolean, ApplicationContext) line: 136
ClassPathXmlApplicationContext.<init>(String) line: 83
DataLoadService.main(String[]) line: 20
/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/bin/java (Nov 6, 2012 1:14:23 PM)
It’s happening on this line of code:
ApplicationContext context=new ClassPathXmlApplicationContext("classpath:spring.xml");
spring.xml gets moved into the class/ folder during the build process so I tried adding the class folder to the launch configuration (see screenshot).

I’m working with eclipse 3.7.2 and spring 3.1.1
Check the spring libs. This issue is about the project build path and configuration.