issues reading classpath resources using Spring and Karaf [message #1322451] |
Tue, 29 April 2014 17:39  |
Eclipse User |
|
|
|
Using Karaf 3.0.0 to port J2EE WAR apps to OSGi. Having issues with finding classpath resources in applicationContext.xml, for example. Please view this thread in karaf forum (not getting much help: 'Does not exist in file system' is the topic). thx.
I have tried to simplify the trouble-shooting of this problem by cloning the Eclipse project and breaking down to bare bones classes, xml, etc.
Now the problem I'm having is that the Spring beans config xml does not seem to be being found and/or parsed b/c I have an invalid bean config in there (for testing purposes) with a reference to a non-existing bean (which should cause an exception during parsing/resolution by Spring). No exception is thrown in the karaf log.
I have the following export-package config in pom.xml:
<Export-Package>
'=WEB-INF.lib',
'=WEB-INF',
'=WEB-INF.lib.classes',
</Export-Package>
The Spring config file is in WEB-INF/classes directory in the WAB.
I have also tried exploding the WAR and moving the Spring config xml to WEB-INF (this is how it works in another successfully deployed WAB) and copying exploded directory to deploy dir in karaf. Same behavior, no exception on startup of karaf.
Here is the partial web.xml:
<servlet>
<servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/workflow-ws-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
Finding resources with Spring/karaf seems like such a nightmare....
Please advise. thx.
|
|
|
|
Powered by
FUDForum. Page generated in 0.02758 seconds