Mac 编译Spring boot项目报错java.rmi.ConnectException: Connection refused to host: 127.0.0.1

位置:首页>文章>详情   分类: 教程分享 > Java教程   阅读(1085)   2023-03-28 11:29:14

问题描述

Mac 编译Spring boot项目的时候报错:
java.lang.RuntimeException: Cannot reconnect.
	at org.jetbrains.idea.maven.server.RemoteObjectWrapper.perform(RemoteObjectWrapper.java:82)
	at org.jetbrains.idea.maven.server.MavenEmbedderWrapper.customizeForResolve(MavenEmbedderWrapper.java:38)
	at org.jetbrains.idea.maven.project.MavenProjectResolver.downloadSourcesAndJavadocs(MavenProjectResolver.java:253)
	at org.jetbrains.idea.maven.project.MavenProjectsProcessorArtifactsDownloadingTask.perform(MavenProjectsProcessorArtifactsDownloadingTask.java:40)
	at org.jetbrains.idea.maven.project.MavenProjectsProcessor.doProcessPendingTasks(MavenProjectsProcessor.java:146)
	at org.jetbrains.idea.maven.project.MavenProjectsProcessor$1.run(MavenProjectsProcessor.java:115)
	at org.jetbrains.idea.maven.utils.MavenUtil.lambda$runInBackground$5(MavenUtil.java:518)
	at com.intellij.util.RunnableCallable.call(RunnableCallable.java:20)
	at com.intellij.util.RunnableCallable.call(RunnableCallable.java:11)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.call(ApplicationImpl.java:270)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is: 
	java.net.ConnectException: Connection refused: connect
	at java.rmi/sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:623)
	at java.rmi/sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:209)
	at java.rmi/sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:196)
	at java.rmi/sun.rmi.server.UnicastRef.invoke(UnicastRef.java:132)
	at java.rmi/java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:217)
	at java.rmi/java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:162)
	at com.sun.proxy.$Proxy132.createEmbedder(Unknown Source)
	at jdk.internal.reflect.GeneratedMethodAccessor4171.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at com.intellij.execution.rmi.RemoteUtil.invokeRemote(RemoteUtil.java:150)
	at com.intellij.execution.rmi.RemoteUtil.access$400(RemoteUtil.java:21)
	at com.intellij.execution.rmi.RemoteUtil$1.lambda$invoke$0(RemoteUtil.java:134)
	at com.intellij.openapi.util.ClassLoaderUtil.computeWithClassLoader(ClassLoaderUtil.java:31)
	at com.intellij.execution.rmi.RemoteUtil.executeWithClassLoader(RemoteUtil.java:202)
	at com.intellij.execution.rmi.RemoteUtil$1.invoke(RemoteUtil.java:134)
	at com.sun.proxy.$Proxy132.createEmbedder(Unknown Source)
	at org.jetbrains.idea.maven.server.MavenServerConnector.createEmbedder(MavenServerConnector.java:191)
	at org.jetbrains.idea.maven.server.MavenServerManager$2.create(MavenServerManager.java:344)
	at org.jetbrains.idea.maven.server.MavenServerManager$2.create(MavenServerManager.java:332)
	at org.jetbrains.idea.maven.server.RemoteObjectWrapper.getOrCreateWrappee(RemoteObjectWrapper.java:41)
	at org.jetbrains.idea.maven.server.MavenEmbedderWrapper.doCustomize(MavenEmbedderWrapper.java:79)
	at org.jetbrains.idea.maven.server.MavenEmbedderWrapper.lambda$customizeForResolve$0(MavenEmbedderWrapper.java:39)
	at org.jetbrains.idea.maven.server.RemoteObjectWrapper.perform(RemoteObjectWrapper.java:76)
	... 17 more
Caused by: java.net.ConnectException: Connection refused: connect
	at java.base/java.net.PlainSocketImpl.connect0(Native Method)
	at java.base/java.net.PlainSocketImpl.socketConnect(PlainSocketImpl.java:101)
	at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)
	at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)
	at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403)
	at java.base/java.net.Socket.connect(Socket.java:609)
	at java.base/java.net.Socket.connect(Socket.java:558)
	at java.base/java.net.Socket.<init>(Socket.java:454)
	at java.base/java.net.Socket.<init>(Socket.java:231)
	at com.intellij.execution.rmi.RemoteServer$1.createSocket(RemoteServer.java:122)
	at java.rmi/sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:617)
	... 40 more
 

解决办法

settings—》Build,Execution,Deployment—》Build Tools—》Maven—》Importing—》JDK for importer选择你安装的JDK版本

他这里默认是个混合版本 11 & 8 就会出问题。我这里安装的是jdk8所以直接选jdk8
 
标签: idea Spring boot maven
地址:https://www.leftso.com/article/826.html

相关阅读

问题描述Mac 编译Spring boot项目的时候报错:java.lang.RuntimeException: Cannot reconnect. at org.jetbrains.idea...
idea 2021.3打开maven项目闪退问题查看idea日志,发现报错:idea闪退日志大概意思就是maven的pom.xml文件里面包含了非法字符:冒号,经查看,项目名称&lt;name&...
idea maven https私服下载报错解决idea 打开设置菜单,找到setting-&gtl;Build,Excution,Deployment-&gtl;Build Tools&gtl...
spring boot 导入本地jar包spring boot maven 打war包时候导入本地jar包
Spring Boot 2.0 Redis整合,通过spring boot 2.0整合Redis作为spring缓存框架的实现。
Spring Boot编译如何更改默认JDK版本?,spring boot,java
idea Mybatis generator插件的配置和使用,在eclipse中,我们可以在eclipse的插件市场安装一个Mybatis generator的插件。然后对Mybatis gen...
spring boot项目打war包再部署到外部tomcat中
spring boot是一个崭新的spring框架分支项目,本文讲解基本的数据库配置