I use this:
to load my ApplicationContext. myfile.xml is in src/main/resourcesCode:ApplicationContext context = new ClassPathXmlApplicationContext("myfile.xml");
My problem is that inside STS, maven puts the file in target/classes and everything is OK, but, when I create the JAR, myfile.xml is in /resources and it doesn't find the file.
If I change the sentece by
it works in the Jar but it doesn't work inside STS, because myfile.xml is at target/classes.Code:ApplicationContext context = new ClassPathXmlApplicationContext("resources/myfile.xml");
I've burned Google and I can't find any solutions.
I'm sure this is a common problem with a easy solution, that I can't obviously find. Thanks for your help and I apologize for my horrible English.


Reply With Quote
that says "no hay ningun atributo de manifiesto principal en myfile.jar". The translation from spanish is something like "There isn't any main attribute of the manifest in myfile.jar". I've checked I have a /META-INF/MANIFEST.MF
