0

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.

halfer
  • 19,824
  • 17
  • 99
  • 186
TSCHAB
  • 1
  • 3
  • Could you ask IBM whether Spring MVC works on this application server? I expect they would (or should) know. – halfer Jul 08 '19 at 18:26
  • Spring MVC definitely works with Liberty in general - I'm using it daily - so there's some specific scenario that isn't working. – dbreaux Jul 08 '19 at 23:22
  • Hello @dbreaux thank you very much for your Information. IBM does not say that Spring MVC is not working. We don't say Spring-MVC doesn't work at all. But we use the servlet 3.0 feature web-fragment jar for sharing static resources between several web-modules (WAR) in an enterprise application (EAR). And calling these resources via web-url (HTTP-GET request), causes the exception. Our Scenario is specific in a way, but based on a feature from the servlet specification. So we think the server and Spring-MVC together should work accordingly to the specification. – TSCHAB Jul 09 '19 at 06:27

0 Answers0