Spring Resources loading in dependant jars.
I'm trying to get a handle setting up beans within a war file containing dependant spring jars. The dependent jars don’t seem to be able to locate the Resources contained within its own jar. Any imports of spring configuration xml files referenced within the dependent jars all work - but references to resources are lost - Any ideas on how to do this?
The assumption I'm working to is that each dependant jar contains its own configuration. All I have to do is force its spring configuration to be loaded.
Web application module:
- a war file with its spring configuration loaded via its web.xml
- is dependent upon a jar packaged in its WEB-INF/lib directory
- has its own ApplicationContext.xml containing following import which initiates context loading in the dependent jar modules.
Fragment Directory structure from a dependent jar module.
Fragment from a dependent ApplicationContext.xml
When I load the war in tomcat but I fail to load "jaxbMarshaller" bean because a resource is not found:-
<bean id="jaxbMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller" >
<property name="schema" value="subscription.xsd"/>
<property name="contextPath" value="com.fred.ws.jaxb"/>
Resource ServletContext resource [/subscription.xsd] does not exist
I’ve tried every permutation I can think of but I am at a loss to define the correct schema location
How do I specify the protocol / path to subscription.xsd placed within dependant. Or is there a better approach to the problem I am trying to address.