Minecraft 本地伺服器:內部異常:java.io.IOException:現有連接被遠端主機強行關閉
我無法從同一本地網路(Windows 7)上的電腦連接到託管在 Ubuntu 機器(16.04)上的 minecraft 伺服器。嘗試連接到伺服器的本地網路 IP 或通過外部 IP 連接返回相同的錯誤:“內部異常:java.io.IOException:現有連接被遠端主機強制關閉”。
伺服器通過終端命令在 Ubuntu 機器上執行
sudo java -Xmx2G -Xms2G -jar /minecraft/minecraft_server.1.11.2 -nogui
。伺服器似乎執行沒有問題。latest.log (伺服器)在下面。我的世界客戶端是相同的版本:1.11.2。它可以毫無問題地連接到其他我的世界伺服器。latest.log(客戶端)在下面。
兩台電腦都分配了本地網路上的 IP 地址,並將埠 25565 設置為伺服器的預設埠,並在路由器設置中轉發到 Ubuntu 機器。我還有一條 ufw 規則,允許通過它進行連接。
電腦之間可以正常通信。我在它們之間設置了一個 samba 文件共享,我可以通過本地網路和我的外部 IP 從 Windows 機器 ssh 進入 Ubuntu 機器。
Ubuntu 機器正在執行最新版本的 Java。
我的路由器缺少“硬體加速”選項或類似的選項。
我真的沒有更多的解決方案。如果人們有建議,我願意接受。
最新的.log(伺服器)
[16:00:40] [Server thread/INFO]: Starting minecraft server version 1.11.2 [16:00:40] [Server thread/INFO]: Loading properties [16:00:40] [Server thread/INFO]: Default game type: SURVIVAL [16:00:40] [Server thread/INFO]: Generating keypair [16:00:40] [Server thread/INFO]: Starting Minecraft server on *:25565 [16:00:41] [Server thread/INFO]: Using epoll channel type [16:00:42] [Server thread/INFO]: Preparing level "world" [16:00:42] [Server thread/INFO]: Preparing start region for level 0 [16:00:43] [Server thread/INFO]: Preparing spawn area: 33% [16:00:44] [Server thread/INFO]: Done (1.968s)! For help, type "help" or "?" [16:11:27] [Server thread/INFO]: Stopping the server [16:11:27] [Server thread/INFO]: Stopping server [16:11:27] [Server thread/INFO]: Saving players [16:11:27] [Server thread/INFO]: Saving worlds [16:11:27] [Server thread/INFO]: Saving chunks for level 'world'/Overworld [16:11:27] [Server thread/INFO]: Saving chunks for level 'world'/Nether [16:11:27] [Server thread/INFO]: Saving chunks for level 'world'/The End [16:11:27] [Server Shutdown Thread/INFO]: Stopping server [16:11:27] [Server Shutdown Thread/INFO]: Saving players [16:11:27] [Server Shutdown Thread/INFO]: Saving worlds
latest.log(客戶端)
[15:59:39] [Client thread/INFO]: Setting user: lolusername [15:59:39] [Client thread/INFO]: LWJGL Version: 2.9.4 [15:59:40] [Client thread/INFO]: Reloading ResourceManager: Default [15:59:41] [Sound Library Loader/INFO]: Starting up SoundSystem... [15:59:41] [Thread-5/INFO]: Initializing LWJGL OpenAL [15:59:41] [Thread-5/INFO]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) [15:59:41] [Thread-5/INFO]: OpenAL initialized. [15:59:41] [Sound Library Loader/INFO]: Sound engine started [15:59:43] [Client thread/INFO]: Created: 1024x512 textures-atlas [16:00:12] [Client thread/INFO]: Connecting to lol.exter.nal.ip, 25565 [16:00:15] [Server Connector #1/ERROR]: Couldn't connect to server java.net.ConnectException: Connection refused: no further information: lol.isp.info/lol.exter.nal.ip:25565 at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[?:1.8.0_25] at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:716) ~[?:1.8.0_25] at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:208) ~[netty-all-4.0.23.Final.jar:4.0.23.Final] at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:287) ~[netty-all-4.0.23.Final.jar:4.0.23.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:528) ~[netty-all-4.0.23.Final.jar:4.0.23.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) ~[netty-all-4.0.23.Final.jar:4.0.23.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) ~[netty-all-4.0.23.Final.jar:4.0.23.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) ~[netty-all-4.0.23.Final.jar:4.0.23.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) ~[netty-all-4.0.23.Final.jar:4.0.23.Final] at java.lang.Thread.run(Thread.java:745) ~[?:1.8.0_25] [16:03:04] [Client thread/INFO]: Connecting to 172.16.0.5, 25565 [16:03:11] [Client thread/INFO]: Connecting to 172.16.0.5, 25565 [16:05:31] [Client thread/INFO]: Connecting to lol.exter.nal.ip, 25565 [16:06:20] [Client thread/ERROR]: Can't ping mawmawlithy: Internal Exception: java.io.IOException: An existing connection was forcibly closed by the remote host [16:06:36] [Client thread/INFO]: Connecting to lol.exer.nal.ip, 25565 [16:06:39] [Client thread/INFO]: Connecting to mawmawlithy, 25565 [16:09:49] [Client thread/INFO]: Connecting to lol.exter.nal.ip, 25565
*注意:“mawmawlithy”是 ubuntu 機器的友好名稱。長篇大論,別問了。
仍然不知道是什麼導致了這個問題,但是一個全新的 Ubuntu 安裝解決了它。系統又經歷了幾次重新安裝(Ubuntu/Lubuntu),並且正在解決零問題。
我通過完全解除安裝我的 JDK 並重新安裝它解決了這個問題。然後我就可以毫無問題地登錄並玩了。