【发布时间】:2022-01-04 01:57:44
【问题描述】:
我在尝试将 Spring 框架库从 5.3.1 升级到 5.3.14 时遇到了一些问题。当我使用 5.3.1 版本时,没有白标错误页面。但是,在我将库升级到 5.3.14 后,我在启动时收到此错误消息:
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Tue Jan 04 09:54:57 SGT 2022
There was an unexpected error (type=Internal Server Error, status=500).
在我的记录器中,我收到以下错误消息:
[1/4/22 11:40:33:606 SGT] 000000cb ServletWrappe E
com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0014E: Uncaught service() exception root cause dispatcherServlet: org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: javax/servlet/http/HttpServletResponse.setContentLengthLong(J)V (loaded from file:/C:/Program Files (x86)/IBM/WebSphere/AppServer/plugins/javax.j2ee.servlet.jar by org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@85b881d1) called from class org.springframework.http.server.ServletServerHttpResponse (loaded from file:/C:/Program%20Files%20(x86)/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/backend_war.ear/backend.war/WEB-INF/lib/spring-web-5.3.14.jar by
com.ibm.ws.classloader.CompoundClassLoader@c5d284c9[appwar:backend_war]
我正在使用 springframework.boot 2.4.0 和 springframework 5.3.14。
我尝试了here 的方法来禁用白标错误,但它仍然显示。任何想法为什么会这样?谢谢!
【问题讨论】:
-
您使用什么版本的 WebSphere?我认为您的版本与 Spring servlet 版本不兼容。
java.lang.NoSuchMethodError: javax/servlet/http/HttpServletResponse.setContentLengthLong -
@Saljack 我正在使用 8.5.5.12 可以与您核实是否兼容?如果没有,我该如何解决?
标签: java spring spring-framework-beans