Hope this is the right place for this question.
I have a jar with all my my business/data access code/ and the spring xml files. I took this approach so I can re-use the jar in several web applications (without copying spring xml files in each application).
Is there any way to use the WebApplicationContext to load spring files from the ClassPath instead of a FileSystem?
In my web.xml, I tried to setup the ContextLoadListener's context factory class to ClassPathXmlApplicationContext.
But I get an error :
Has anyone try to do load spring xml files embedded in a jar from a web application? If so, let me know how. Thanks.
I have a jar with all my my business/data access code/ and the spring xml files. I took this approach so I can re-use the jar in several web applications (without copying spring xml files in each application).
Is there any way to use the WebApplicationContext to load spring files from the ClassPath instead of a FileSystem?
In my web.xml, I tried to setup the ContextLoadListener's context factory class to ClassPathXmlApplicationContext.
Code:
<context-param> <param-name>contextClass</param-name> <param-value>org.springframework.context.support.ClassPathXmlApplicationContext</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener>
[org.springframework.context.ApplicationContextExce ption: Custom context class [
org.springframework.context.support.ClassPathXmlAp plicationContext] is not of ty
pe ConfigurableWebApplicationContext]
org.springframework.context.support.ClassPathXmlAp plicationContext] is not of ty
pe ConfigurableWebApplicationContext]
Comment