gpt4 book ai didi

java - 如何修复 IntelliJ 插件中的 "connection refused"异常

转载 作者:行者123 更新时间:2023-11-30 07:30:46 25 4
gpt4 key购买 nike

我正在从头开始开发 IntelliJ(社区版 15.0.3)的插件。
从一开始我就遇到了以下异常(exception)情况。

希望有人可以帮助我理解为什么我会收到此警告以及我应该如何解决它?

错误消息:

WARN: Connection refused: connect

java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at java.net.Socket.<init>(Socket.java:425)
at java.net.Socket.<init>(Socket.java:241)
at com.intellij.idea.SocketLock.tryActivate(SocketLock.java:184)
at com.intellij.idea.SocketLock.access$300(SocketLock.java:50)
at com.intellij.idea.SocketLock$2.call(SocketLock.java:124)
at com.intellij.idea.SocketLock$2.call(SocketLock.java:113)
at com.intellij.idea.SocketLock.underLocks(SocketLock.java:157)
at com.intellij.idea.SocketLock.lock(SocketLock.java:113)
at com.intellij.idea.StartupUtil.lockSystemFolders(StartupUtil.java:263)
at com.intellij.idea.StartupUtil.prepareAndStart(StartupUtil.java:101)
at com.intellij.idea.MainImpl.start(MainImpl.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.ide.plugins.PluginManager$2.run(PluginManager.java:90)
at java.lang.Thread.run(Thread.java:744)

MyProjectComponent.java:

import com.intellij.openapi.components.ProjectComponent;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.NotNull;

public class MyProjectComponent implements ProjectComponent {

private Project project;

public MyProjectComponent(Project project) {
this.project = project;
}

@Override
public void projectOpened() {
System.out.println("projectOpened");
}

@Override
public void projectClosed() {
System.out.println("projectClosed");
}

@Override
public void initComponent() {
System.out.println("initComponent");
}

@Override
public void disposeComponent() {
System.out.println("disposeComponent");
}

@NotNull
@Override
public String getComponentName() {
return "ProjectComponent";
}
}

最佳答案

此异常来自 IntelliJ 平台代码,而不是来自您的插件。您无需更改插件代码即可修复该问题。

关于java - 如何修复 IntelliJ 插件中的 "connection refused"异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36178786/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com