I have a web application running on websphere application server 8 (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 app on WAS - It loads all my ctx files by urls with prefix "wsjar:file..." that is good.
But when in my working app i try to use object of my application context to load resources like this:
applicationContext.getResource("classpath*:by/example/**/I-*.sql").getUrl()
It's throws exception that url incorrect - 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 universal system to load resources on different app servers, and servlets containers. In tomcat prefix not needed.
How can i load resources in my app on WAS in the same way as ContextLoader via ContextLoaderListener load my ctx files without preffix "wsjar:"?
For WebSphere Application Server Version 7.0 or later, you must use Spring Framework Version 2.5.
Deploying on WebSphere Liberty Profile (WLP) The providedRuntime directive makes sure that the war plugin moves the embeeded tomcat jar files to /WEB-INF/lib-provided from /WEB-INF/lib directory. The premise of Spring Boot is to develop and run Spring applications as standalones - extremely good for development teams.
The application class-loader policy controls the isolation of applications that run in the system (on the server). An application class loader groups enterprise bean (EJB) modules, shared libraries, resource adapter archives (RAR files), and dependency Java™ archive (JAR) files associated to an application.
When i use full package names i have no problems with IBM WAS. Like this:
classpath:com/tdp/abc/facilitador/boost/config/reglaBoostWS-support.xml
I didn't try using asteriks for pointing multiple files. Maybe listing all individuals files can work for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With