Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoSuchMethodError when invoke JettyWebSocketSession.getRemoteAddress in jetty 10 #27120

Closed
leonchen83 opened this issue Jul 2, 2021 · 2 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Milestone

Comments

@leonchen83
Copy link
Contributor

leonchen83 commented Jul 2, 2021

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();
	}
@leonchen83 leonchen83 changed the title [bug]NoSuchMethodError when invoke JettyWebSocketSession.getRemoteAddress in jetty 10 [BUG] NoSuchMethodError when invoke JettyWebSocketSession.getRemoteAddress in jetty 10 Jul 2, 2021
@leonchen83
Copy link
Contributor Author

above also affect JettyWebSocketSession.getLocalAddress

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jul 2, 2021
@snicoll snicoll changed the title [BUG] NoSuchMethodError when invoke JettyWebSocketSession.getRemoteAddress in jetty 10 NoSuchMethodError when invoke JettyWebSocketSession.getRemoteAddress in jetty 10 Jul 2, 2021
@rstoyanchev rstoyanchev self-assigned this Jul 9, 2021
@rstoyanchev rstoyanchev added this to the 5.3.9 milestone Jul 9, 2021
@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jul 9, 2021
@rstoyanchev
Copy link
Contributor

It's a binary incompatible change, so we'll also have to invoke that via reflection on Jetty 10.

snicoll added a commit that referenced this issue Jul 13, 2021
This commit uses the target type where getRemoteAddress and
getLocalAddress are defined.

See gh-27120
Zoran0104 pushed a commit to Zoran0104/spring-framework that referenced this issue Aug 20, 2021
Zoran0104 pushed a commit to Zoran0104/spring-framework that referenced this issue Aug 20, 2021
This commit uses the target type where getRemoteAddress and
getLocalAddress are defined.

See spring-projectsgh-27120
lxbzmy pushed a commit to lxbzmy/spring-framework that referenced this issue Mar 26, 2022
lxbzmy pushed a commit to lxbzmy/spring-framework that referenced this issue Mar 26, 2022
This commit uses the target type where getRemoteAddress and
getLocalAddress are defined.

See spring-projectsgh-27120
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants