Amit,
On 4/4/24 22:21, Amit Pande wrote:
I am in the process of migrating from Tomcat 9 (9.0.87) to Tomcat 10.1
(10.1.20).
https://tomcat.apache.org/migration-10.1.html Using the migration tool, I have
migrated the applications (which use Spring libraries 5.x).
While testing the migrated apps( which use web socket), ran into:
org.springframework.web.util.NestedServletException: Handler dispatch failed;
nested exception is java.lang.NoSuchMethodError: 'void
org.apache.tomcat.websocket.server.WsServerContainer.doUpgrade(jakarta.servlet.http.HttpServletRequest,
jakarta.servlet.http.HttpServletResponse,
jakarta.websocket.server.ServerEndpointConfig, java.util.Map)
https://github.com/apache/tomcat/blob/9.0.x/java/org/apache/tomcat/websocket/server/WsServerContainer.java
* @deprecated This method will be removed in Apache Tomcat 10.1 onwards. It
has been replaced by
* {@link #upgradeHttpToWebSocket(Object, Object,
ServerEndpointConfig, Map)}
*/
@Deprecated
public void doUpgrade(HttpServletRequest request, HttpServletResponse
response, ServerEndpointConfig sec,
Map<String, String> pathParams) throws ServletException,
IOException {
UpgradeUtil.doUpgrade(this, request, response, sec, pathParams);
}
Is this an issue with the migration tool to appropriately replace the removed
methods?
Or the applications using web sockets with Tomcat 9.x are required to be
updated before moving to Tomcat 10.1, instead of using the migration tool as an
intermediate step to upgrade to Tomcat 10.1 without having to update the
applications at the same time?
FWIW, Spring 5 to Spring 6 is a major upgrade and Tomcat 10 is a requirement.
The Migration Tool doesn't rewrite your code, it only rewrites the class
names referenced by your class files. (Okay, it also re-writes strings
in your files which match those class names as well.) But it will not
change method calls. It is not a Deprecation Cleanup Tool.
You should change your Java EE-compatible application to use
upgradeHttpToWebSocket(Object, Object, ServerEndpointConfig, Map) first,
then run the Migration Tool on your application.
-chris
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org