I have a web application running on websphere 8 application server (WAS). In web.xml, I have:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:by/example/**/*-ctx.xml</param-value>
</context-param>
Then, when I deploy my application to WAS, it downloads all my ctx files to URLs with the prefix "wsjar: file ...", which is good.
But when in my working application I try to use the object of my application context to load resources such as this:
applicationContext.getResource("classpath*:by/example/**/I-*.sql").getUrl()
It throws an exception, an invalid URL, but if I add preffix "wsjar:" like this:
applicationContext.getResource("wsjar:classpath*:by/example/**/I-*.sql").getUrl()
It works well. But I need to create a universal system for loading resources to different application servers and servlet containers. The tomcat prefix is not required.
WAS , ContextLoader ContextLoaderListener ctx "wsjar:"?