Solved Problem with Thread (NullPointerException)

Discussion in 'BungeeCord Plugin Development' started by Neturo, May 21, 2019.

  1. Hello, i got problem in a Thread,

    Console :
    Code (Text):
    16:31:20 [SEVERE] Exception in thread "Thread-5"
    16:31:20 [SEVERE] java.lang.NullPointerException
    16:31:20 [SEVERE]     at net.neturo.ondemand.Server$1.run(Server.java:38)
    16:31:20 [SEVERE]     at java.lang.Thread.run(Thread.java:748)
     
    In my class Server.java in line 38 i got :
    Code (Text):
     File source = new File("/home/dev/models/"+ servertype.getmodelPrefix());
    Complete Thread :
    Code (Text):
            this.thread = new Thread(new Runnable() {

                @Override
                public void run(){
                    File source = new File("/home/dev/models/"+ servertype.getmodelPrefix());
                    File destination = new File("/home/dev/servers/"+ serverName);

                    //FileUtils.copyFolder(source, destination);

                    thread.interrupt();

                    if (autostart) {
                        startServer();
                    }


                }
            });
            thread.start();
    Can you help me for resolved this problem, thanks for watching
     
  2. Use bungee scheduler.
     

Share This Page