spring-boot-maven-plugin 2.2.x Failed to retrieve RMIServer stub

Created on 19 Nov 2019  路  14Comments  路  Source: spring-projects/spring-boot

Upgrade Spring from 2.1.10 to 2.2.1 (including maven plugin) cause fail:

Could not contact Spring Boot application: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is

problem occurs when the plugin starts the app, there is no problem with Spring 2.2.x and maven plugin downgraded to 2.1.10.

workaround: downgrade the maven plugin to 2.1.x

superseded

Most helpful comment

@grimmohe thanks for the feedback and the error log. Do you have a process listening on port 9001? That's the default port that's used to establish a JMX connection between the forked process with the app and the Maven process. Alternatively you could try to set a different jmxPort in your plugin configuration to check if that helps.

All 14 comments

@zsalab thanks for the report but it's very hard to help you with the amount of details you've provided. Spring Boot 2.2 now forks the process by default but I can't say if that's related.

To help you further, can you please share a small sample that reproduces the problem?

This forking can be the root cause, but interesting not appear on MacOS just in the CI (linux).... I will try to provide some example, but unfortunately, I lost to much time to find the workaround... will do my best, but maybe that ticket can help others if they see the same error

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

I've got this problem on Windows but it works on Linux.
Downgrading to 2.1.x also helps.

Thanks, @tanbt. That's interesting. If you'd like us to investigate a bit, we would be happy to do so if you can provide a minimal sample that reproduces the problem.

Here's my reproduce: demo.zip.
It's a simple project from Spring Initializr with Spring Web dependency, then I add to pom.xml a profile which uses the plugin:

        <profile>
            <id>it</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-maven-plugin</artifactId>
                        <!-- Use a downgraded version to workaround -->
                        <!-- <version>2.1.16.RELEASE</version> -->
                        <executions>
                            <execution>
                                <id>start-spring-boot</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>start</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>stop-spring-boot</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>stop</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

Running this profile (e.g. mvn verify -Pit) causes the issue on Windows.

@tanbt thank you for the sample. Unfortunately I cannot reproduce using Windows10 and Java 8. Can you run this command with -X > out.log and share a link of the output (attaching the logs here or using gist.github.com). Thanks!

Windows 10
Java 11.0.4
Spring 2.3.2.RELEASE

mvn clean install && mvn -X spring-boot:start > error.log

error.log

@grimmohe thanks for the feedback and the error log. Do you have a process listening on port 9001? That's the default port that's used to establish a JMX connection between the forked process with the app and the Maven process. Alternatively you could try to set a different jmxPort in your plugin configuration to check if that helps.

There realy is some system process right after reboot.
image

I configured like you suggested and its working again.

        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <configuration>
          <jmxPort>9011</jmxPort>
        </configuration>

Thank you.

@tanbt does changing the JMX port fixes the issue for you as well?

@snicoll Thanks! jmxPort works for me as well!

Thanks for the feedback. I am going to close this one in favour of #22401 to which I鈥檝e added a comment to document the need to tweak the port.

Was this page helpful?
0 / 5 - 0 ratings