Меню

Ошибка майнкрафт java net socketexception network is unreachable


  • Search


    • Search all Forums


    • Search this Forum


    • Search this Thread


  • Tools


    • Jump to Forum


  • #1

    Feb 27, 2012

    Hello all,

    I have a server running on a Mac using Craftbukkit. Recently, my computer’s graphics card had to be replaced; and ever since, my friends could not connect to the server. Only I can, using «localhost». When anybody else tries to connect, they get the following error message: «Failed to connect to the server java.net.SocketExecption: Network is unreachable».

    Please help! Btw, I tried restarting the server, my wireless connection, and even my computer; yet still nothing works.

    Thank you so much!


  • #2

    Feb 27, 2012


    gerbil


    • View User Profile


    • View Posts


    • Send Message



    View gerbil's Profile

    • Enderman Ender
    • Join Date:

      6/3/2011
    • Posts:

      8,485
    • Member Details

    «Failed to connect to the server java.net.SocketExecption: Network is unreachable»

    This strongly implies that the IP address they are trying to use is bogus.
    A port forwarding problem would not manifest itself as a NETWORK unreachable.

    This message means that an IP router somewhere is throwing up it’s hands and saying «I have no idea where to send this»


  • #3

    Feb 28, 2012

    This strongly implies that the IP address they are trying to use is bogus.
    A port forwarding problem would not manifest itself as a NETWORK unreachable.

    This message means that an IP router somewhere is throwing up it’s hands and saying «I have no idea where to send this»

    The odd thing is that they have been using the same IP all the time, and only now am I getting this error. I got the IP to use off of IPChicken, and it is the same as always.


  • #5

    Feb 28, 2012

    I tried port forwarding, but now I have a new error: «Connection Refused». Plz help!!!!


  • #6

    Feb 28, 2012


    gerbil


    • View User Profile


    • View Posts


    • Send Message



    View gerbil's Profile

    • Enderman Ender
    • Join Date:

      6/3/2011
    • Posts:

      8,485
    • Member Details

    that error means the device where your packets are arriving is NOT LISTENING.

    So.. either your server is not running, or you are using the wrong IP address to connect with, or your port forwarding is pointed at the wrong IP address.

    This is not usually a firewall issue, as they usually just silently eat packets.


  • #7

    Feb 28, 2012

    that error means the device where your packets are arriving is NOT LISTENING.

    So.. either your server is not running, or you are using the wrong IP address to connect with, or your port forwarding is pointed at the wrong IP address.

    This is not usually a firewall issue, as they usually just silently eat packets.

    My server is running, I use the right IP, and I’m pretty sure my port forwarding is pointed at the correct IP address. Whenever I go on Verizon and port forward, it seems to work; yet when I go on canyouseeme.org and test port 25565, it also says connection refused. Man, is this annoying.

    EDIT: Other computers in my LAN can connect to my server, but still not outside of my LAN.


  • #9

    Feb 29, 2012

    Yeah it’s most likely your firewall on your pc that is blocking Minecraft.
    Did you try and turn it off for a minute and test it?

    Also being «pretty sure» that you’re using the right IP is not enough :smile.gif:

    My firewall says:
    «Typical Security (Medium)
    Inbound Policy: Reject.
    Remote Administration settings will override the security inbound policy.
    Outbound Policy: Accept.»

    And I know that something must be wrong, as I tried my external IP and internal IP.

    EDIT: It turns out that my firewall was on too high of a security! Now it works!! Thx!

  • To post a comment, please login.

Posts Quoted:

Reply

Clear All Quotes


Hi. For about 4 months now, I have been getting this error

java.net.SocketException: Network is unreachable

whenever I try to connect to a server that I did not connect to before a specific date 4-ish months ago. For example, if I connected to «workingip.net» before the issue started, I would still be able to connect to it without any issues. But if I wanted to connect to «notworkingip.net» after the issue started happening to me, I would get the error mentioned above. I am able to connect on other devices, other people with my ISP are able to connect, and others on different ISPs are also able to connect without any issues. This has persisted through different versions, modded or vanilla, different launchers, reinstallations of Minecraft, Java, and even wiping my drives.

I have tried almost everything I have come across, and a few that come to mind are flushing my DNS cache, and changing my IPv4 DNS. I searched for this issue on this forum, and the only thread I could come across was ended with nobody actually giving a solution.

DxDiag

HJT log

Any support would be greatly appreciated. If I need to provide any more logs, just let me know and I will try to get them as fast as possible.

Hi. For about 4 months now, I have been getting this error

java.net.SocketException: Network is unreachable

whenever I try to connect to a server that I did not connect to before a specific date 4-ish months ago. For example, if I connected to «workingip.net» before the issue started, I would still be able to connect to it without any issues. But if I wanted to connect to «notworkingip.net» after the issue started happening to me, I would get the error mentioned above. I am able to connect on other devices, other people with my ISP are able to connect, and others on different ISPs are also able to connect without any issues. This has persisted through different versions, modded or vanilla, different launchers, reinstallations of Minecraft, Java, and even wiping my drives.

I have tried almost everything I have come across, and a few that come to mind are flushing my DNS cache, and changing my IPv4 DNS. I searched for this issue on this forum, and the only thread I could come across was ended with nobody actually giving a solution.

DxDiag

HJT log

Any support would be greatly appreciated. If I need to provide any more logs, just let me know and I will try to get them as fast as possible.

Java.Net.SocketException: Network Is Unreachable

Today, we will discuss the possible reasons and solutions for the java.net.SocketException: Network is unreachable exception while programming in Java.

Possible Reasons and Solution for java.net.SocketException: Network is unreachable in Java

Example Code (Causing an Error):

//import required libraries
import java.io.*;
import java.net.URL;

//Main class
public class Main {

    //download method
    static void downloadXML (String webUrl, String file) throws IOException{

        //create object
        FileWriter xmlFileWriter;
        xmlFileWriter = new FileWriter(file);
        System.out.println("URL used for downloading the file is : " + webUrl);

        // this statement throws an Exception
        BufferedReader inputTextReader = new BufferedReader (
                new BufferedReader(
                        new InputStreamReader(
                                new URL(webUrl).openStream())));


        //create and initialize variables
        String string ;
        String fileInString = "";
        string = inputTextReader.readLine();

        //read file
        while (string != null  ){
            fileInString += (string + "rn");
            string = inputTextReader.readLine();

        }
        //write file
        xmlFileWriter.write(fileInString);
        xmlFileWriter.flush();
        xmlFileWriter.close();
        System.out.println("The File is Downloaded");
    }//end download() function

    //main method
    public static void main(String[] args){
        try{
            downloadXML("https://www.cellml.org/Members/stevens/docs/sample.xml",
                        "downloadXML.xml");
        }catch(IOException exception){
            exception.printStackTrace();
        }
    }//end main

}//end Main class

In this code, we pass the URL and the fileName to the downloadXML() method that reads the .xml file from the specified URL and writes it into the given fileName, which is further saved on our local system.

Though this code example is syntactically and semantically correct but generates the java.net.SocketException: Network is unreachable exception. The error is self-explanatory that tells us the network is not available at the current moment.

The reason causing this error is the connection breakdown. It can happen in Wi-Fi, 3G, or plain internet connection on the machine (computer/laptop).

Whenever we get this error, we must assume that the internet connection is not stable and may be lost from time to time while writing our application.

For instance, this happens with mobiles frequently when we are in the basements or tube, etc. It also happens while using apps on a PC/laptop, but it is less frequent.

The second reason can be incorrect Port and/or HostName. Make sure both are correct.

Additionally, you must remember two more things that can help in error identification.

  1. First, you will get a java.net.UnknownHostException error if you are completely disconnected from the internet

  2. Usually, the Network is unreachable differs from the Timeout Error. In the Timeout Error, it can’t even find where it should go.

    For instance, there can be a difference between having our Wi-Fi card off and no Wi-Fi.

Firstly, perform the usual fiddling with the firewall to ensure that the required port is open. Then, have a look into the network issues that you might have.

Turn off the firewalls and eliminate the obstacles such as routers and complications to make it work in the simplest scenario possible since it is a network-related issue, not code related problem.

Thread Status:

Not open for further replies.
  1. Trying to set up my own server. This is frustrating. I don’t have any plugins or anything, not 100% sure on what I’m doing. Any help?[​IMG]

  2. You most likely have already done it, or probably already know this, but you tried restarting your internet, portforwarding, and turning your firewall off, right?
    That was the case when I had this error..

    You put in the right information in the .bat and the right build, correct?

  3. Thanks, I didn’t even think about the firewall, which I believe is the issue, how do I go about fixing that?

  4. Start>Control Panel>Windows Firewall> Look to the sidebar to the left or right>Turn windows firewall on or off/Change notification settings> Then turn off the firewall public and private.
    ————————————————————————————————-

    With the firewall down, you’re able to access servers or others access them, but the downside is you’re open to more viruses, , so I’d get some sort of antivirus. I reccomend ESET smart security. The antivirus has a firewall too, but you can edit that easily.

Thread Status:

Not open for further replies.

Share This Page


Bukkit Forums

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Ошибка майнкрафт java net connectexception connection timed out no further information
  • Ошибка майнкрафт connection lost