Skip to content

NoSuchMethodError when invoke JettyWebSocketSession.getRemoteAddress in jetty 10 #27120

Closed
@leonchen83

Description

@leonchen83

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();
	}

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions