IOException parsing XML document from class path resource

Maven, has standard directory for resources is which is src/main/resources, so if you keep your file here it will take it. and in the path simply give the file name.

For example

 ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("application-context.xml");

I had the same problem it worked for me


You have to replace your .xml in resources folder, and write:

 String[] contextPaths = new String[] {"Xxx.xml"};
    new ClassPathXmlApplicationContext(contextPaths);

If you didn't any addition configuration, all .html and .xml files Spring searches in resources folder by dafault


It is trying to load this file from the classpath and cannot find it. Try specifying just "combined2.xml" instead of "src/main/java/resources/combined2.xml" and make sure that src/main/java/resources is on your classpath.

By the way, in Maven, the standard directory for resources is src/main/resources, so I suggest you put this file there.