This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

its seems that your module doesn't recognize / cannot access the the other context.
i think its better if you use import in your root context, so any of different context can be seen as one context configuration.
<import resource="your-another-xml.xml"/>

Comment

I'll have a crack at doing the direct import, but it would be a very much less than ideal solution as it would completely tie my modules together (relying on direct imports from files that are not in the same module).

I was rather hoping that I could use the classpath* syntax as it would import all *-context.xml files in the classpath, but this doesn't seem to work. I was hoping that some classpath/context guru would save me from my incompetance.

Comment

Actually, ant-style wildcards and classpath* are known to not work too well together, thanks to underlying Java issues. Take a look here for details.

Typically when I use classpath*, I expect that the config files will be in a fixed location (classpath*:/spring/*-config.xml, for example). For that matter, by using imports, you can get away with a fixed name for each file (classpath*:/module-config.xml).

Hope this helps
- Don

Comment

Ah, so if I were to place the files one directory down (i.e., by having /spring/ in the path, or similar) it might work?

I didn't really want to have fixed names for the files, I just wanted to have something like: "classpath*:**/*context.xml" to get any file that ends with context.xml. I only used fixed names in web.xml to try to get the context to find them.

Comment

Can you suggest me the best solution to work with the multipule context files. Where i have similar kind of set up(i.e need to load the diffrent context files extising in sub-projects, all the those sub-project created as jars and placed as part of main web application).

Comment

you can get away with a fixed name for each file (classpath*:/module-config.xml).

Is it possible to have multiple URL Patterns, with multiple context files, scenario is some thing like this, if context file URL pattern is /test and context2 is /test2, where /test /test2 are two different projects, in this case how to load context files.