Hi,
I've found a problem with loading Spring context files from external jars. Originally, it was a Maven mailing list discussion (http://www.nabble.com/-M2--Differenc....html#a5362647) but I've found that this problem refers rather to Spring than to Maven 2.
And here is the problem:
I have a jar (let's say CORE.jar) with applicationContext.xml, applicationContext-hibernate.xml, and all implementation classes inside. Then I want to use these resources in another project, which has CORE.jar on its classpath:
Unfortunately neither applicationContext.xml nor applicationContext-hibernate.xml is being loaded. However, If I change my code to this:Code:String[] contextPaths = { "classpath:applicationContext*.xml"}; ApplicationContext context = new ClassPathXmlApplicationContext(contextPaths);
everything works fine.Code:String[] contextPaths = { "applicationContext.xml", "applicationContext-hibernate.xml" }; ApplicationContext context = new ClassPathXmlApplicationContext(contextPaths);
So is it a bug or a feature?
Any thoughts?
I'm using JDK 1.5 and Spring Framework 2.0-RC2.
Regards,
Jakub Pawlowicz


Reply With Quote
