Spring-MVC - Load static resource from web-jar causes exception in WebSphere Liberty

193 Views Asked by At

We are porting a JEE-enterprise application from WebSphere to Liberty 19.0.0.6. For sharing static resources (PNG image here) we use a web-fragment jar-library with the images located in META-INF/resources package. Our UI uses Spring-MVC with the DispatcherServlet mapped to, and it shall handle the load of the Image. It does that well using the DefaultServletHttpRequestHandler sourcecode. (You can find the sourcecode here).

But in this class Spring MVC is detecting the web Server, to forward the request of loading the image. This causes a mapping clash exception in WebSphere Liberty server, but the server delivers the image. Anyway you get huge stacktraces all over the place (console, logs, …).

We were in discussion with the IBM Support about that problem. The solution works well on the previous server WebSphere traditional, but not on Liberty any more. Right now the status is, that IBM thinks Spring-MVC uses server-internal classes in an unsupported scenario.

[ERROR ] SRVE0777E: Es wurde eine Ausnahme von der Anwendungsklasse 'com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.service:1.605' ausgelöst. javax.servlet.ServletException: java.lang.Exception: Mapping clash for com.ibm.ws.webcontainer.osgi.servlet.EntryServletWrapper@356db043: Target com.ibm.ws.webcontainer.osgi.servlet.EntryServletWrapper@df6117c8 already exists at node images at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.service(DefaultExtensionProcessor.java:1605) at [internal classes] at org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler.handleRequest(DefaultServletHttpRequestHandler.java:122) at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:51) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:963) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:897) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) at [internal classes] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at [internal classes]

Is that problem already known for WebSphere Liberty server, are there other software projects affected by this problem? In our point of view, right now this means Spring-MVC is not fully supported on Liberty server. So we either need a different server or have to migrate away from Spring-MVC. What is your point of view here? Are you using internal code from IBM that just doesn't work any more? And if so can that be fixed in Spring-MVC for Liberty server.

0

There are 0 best solutions below