springboot 热加载为何出现端口号占用问题,如何解决?

根据此文 http://www.jb51.net/article/1... 在 pom 文件中加入

    <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <dependencies>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>springloaded</artifactId>
                <version>1.2.6.RELEASE</version>
            </dependency>
        </dependencies>
    </plugin>

然后想实现热加载 可是很容易出现端口号被占用的状况,而且即使有时候没出现这种状况,也没能够热加载

Failed to start end point associated with ProtocolHandler [http-nio-8001] java.net.BindException: Address already in use: bind The Tomcat connector configured to listen on port 8001 failed to start. The port may already be in use or the connector may be misconfigured.

我仔细的在每次启动前把占用端口号的进程关掉,确保没有进程使用该端口再启动的

阅读 6.4k
1 个回答
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题