I build a library (a bounch of classes) that uses spring library and a context-application.xml file (to parse REST response using Marshalling).
At this point I included the jar on my project and I’m trying to call one of this classes, but it’s telling me that context-application.xml file is missing.
I’m trying to load the application context using :
ApplicationContext applicationContext = new ClassPathXmlApplicationContext("application-context.xml");
It’s not so clear (I’m a newbie in Spring framework) where to put this file used by my jar.
Is it possible? Could anyone help me?
It needs to be in the root of your CLASSPATH. In your case – the root directory of the JAR file. If you are using maven – it is the
/src/main/resourcesfolder.