Closed
Description
Affects: <Spring Framework version>
5.3.8
spring framework version
5.3.8
jetty version
10.0.5
jetty dependency
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-webapp</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.websocket</groupId>
<artifactId>websocket-jetty-server</artifactId>
</dependency>
NoSuchMethodError when invoke JettyWebSocketSession.getRemoteAddress
in jetty 10.
@Override
public InetSocketAddress getRemoteAddress() {
checkNativeSessionInitialized();
return getNativeSession().getRemoteAddress();
}
in jetty 10 getNativeSession().getRemoteAddress();
return SocketAddress
not InetSocketAddress
so we should cast SocketAddress
to InetSocketAddress
the method should be
@Override
public InetSocketAddress getRemoteAddress() {
checkNativeSessionInitialized();
return (InetSocketAddress)getNativeSession().getRemoteAddress();
}