I am not able to understand the problem. Please provide your maven project structure, it would really helpful understand the problem. Also please let us know which version of spring you are using. I checked the java doc(spring version 2.0) for ClassPathXmlApplicationContextclass and found that there is no constructor which takes two string argument. As you stated in your problem.
Joined: Feb 23, 2009
thanks for your reply. I am currently trying to fix the problem, but no luck so far.
This is the (simplified) project structure.
- database (depends on configuration)
- services (depends on database and on configuration)
in the source/main/resources folder, the database and services projects have a spring folder which contains the files services-context.xml and database-context.xml.
the configuration project contains a class that holds the application context. In essence, is encapsulates this:
Now, I solely run a main method in the database project and trigger the application context to initialize, I expect it to find the database-context.xml, and in fact it does.
When I run a main method in the services project and trigger the app context to initialize, I expect it to find the database-context.xml and the services-context.xml. As the services project depends on the database project, this shouldn't be a problem. However, it ends up finding the services-context.xml but not the database-context.xml.
I have checked the class path, the database-context.xml is included, but spring won't consider it.