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.
<import resource="classpath*:/META-INF/ApplicationContext.xml"/>
Fragment Directory structure from a dependent jar module.
Fragment from a dependent ApplicationContext.xmlCode:src/main/resources subscription.xsd META-INF ApplicationContext.xml
When I load the war in tomcat but I fail to load "jaxbMarshaller" bean because a resource is not found:-Code:.... <bean id="jaxbMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller" > <property name="schema" value="subscription.xsd"/> <property name="contextPath" value="com.fred.ws.jaxb"/> </bean> ......
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
value="jar:file:SubscriptionWSClient-0.0.1-SNAPSHOT.jar!/subscription.xsd"
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.


Reply With Quote