NullPointerException when dealing with ArrayList
<p>I am unable to access the static ArrayList anywhere inside the class,  every time I do so I get a NullPointerException.  While debugging in eclipse, it doesn't even show them as a variable.  I'm sure this is something simple that I'm overlooking but I have spent a few days attempting to figure it out.  What maybe the reason I'm can't see the to ArrayList.</p>

<p>/////////////CODE/////////////</p>

<pre><code>    package com.gmfb.chessapp;

    import java.io.IOException;
    import java.io.ObjectInputStream;
    import java.io.Serializable;
    import java.net.Socket;
    import java.util.ArrayList;

    public class GameServer implements Runnable,Serializable{

        static final int PORT=5000;
        static final long serialVersionUID = 1L;
        public static ArrayList&lt;GameSession&gt; gameSessionsList = new ArrayList&lt;GameSession&gt;();
        public static ArrayList&lt;Player&gt; userList = new ArrayList&lt;Player&gt;(); 

        private Socket socket;

        GameServer(Socket S){
            socket=S;
        }

        public GameServer() {}

        @Override
        public void run() {

            ObjectInputStream in = null;
    //      ObjectOutputStream out = null;

            try {
                in = new ObjectInputStream(socket.getInputStream());
            } catch (IOException e1) {
                System.out.println("Unable to open input stream with socket.");
            }
    /*      try {
                out = new ObjectOutputStream(socket.getOutputStream());
            } catch (IOException e1) {
                System.out.println("Unable to open output stream with socket.");
            }
    */
            ServerSessionObject SSO;

            try{
            SSO = (ServerSessionObject) in.readObject();
            }catch (Exception e){
                System.out.println("Unable to load ServerSessionObject object");
                System.out.println(e.getMessage());
                e.printStackTrace();
                return;
            }

            if (SSO.currentTask==ServerSessionObject.Task.createUser) createUser(SSO);
            if (SSO.currentTask==ServerSessionObject.Task.login) login(SSO);
            if (SSO.currentTask==ServerSessionObject.Task.madeMove) madeMove(SSO);
            if (SSO.currentTask==ServerSessionObject.Task.loadGame) loadGame(SSO);
            if (SSO.currentTask==ServerSessionObject.Task.createGame) createGame(SSO);
            if (SSO.currentTask==ServerSessionObject.Task.getList) getList(SSO);        
            if (SSO.debug) printInfo();

            //send back SSO

        }

        private void printInfo() {
            System.out.println("USER LIST:");
            GameServer.userList.toString();
            System.out.println("GAMS SESSIONS LIST:");
            GameServer.gameSessionsList.toString();
        }

        private void createGame(ServerSessionObject SSO) {

            GameServer.gameSessionsList.add(new GameSession(SSO.player));
            SSO.currentTask=ServerSessionObject.Task.getList;
        }

        private void loadGame(ServerSessionObject SSO) {

            for (GameSession temp:GameServer.gameSessionsList)
                if (temp.getGameID()==SSO.gameID)
                    SSO.game=temp;      
        }

        private void createUser(ServerSessionObject SSO) {

            Player temp = new Player(SSO.login.getUserID(),SSO.login.getPassword());

            if (!GameServer.userList.contains(temp)) GameServer.userList.add(temp);
            else{
                System.out.println("User already exist.");
                return;
            }
            SSO.currentTask=ServerSessionObject.Task.getList;       
        }

        private void getList(ServerSessionObject SSO) {

            SSO.currentGames = new ArrayList&lt;GameSession&gt;();
            for (GameSession GS:GameServer.gameSessionsList)
                if ((SSO.player.equals(GS.getCreator()) ||
                    SSO.player.equals(GS.getJoiner())))
                        SSO.currentGames.add(GS);
        }

        private void madeMove(ServerSessionObject SSO) {

            for (GameSession temp:GameServer.gameSessionsList)
                if (temp.getGameID()==SSO.game.getGameID())
                    GameServer.gameSessionsList.remove(temp);
            GameServer.gameSessionsList.add(SSO.game);
        }

        private void login(ServerSessionObject SSO) {

            Player user = findPlayer(SSO.login.getUserID());
            if (user==null){
                System.out.println("User can not be found.");
                return;
            }
            SSO.currentTask=ServerSessionObject.Task.getList;
            SSO.player=user;
        }

        private Player findPlayer(String userID) {

            for (Player player:GameServer.userList)
                if  (player.getUserID()==userID)  return player;
            return null;
        }   
    }


/////////////////////////////////////////////////////////////////////////
package com.gmfb.chessapp;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class ServerMain {

    public static void main(String[] args) {

        @SuppressWarnings("unused")
        GameServer GS = new GameServer();

        ServerSavedState SSS=null;
        ObjectInputStream OS = null;

        try {
            OS = new ObjectInputStream(new FileInputStream("serverSavedState.ser"));
        } catch (IOException e1) {
            System.out.println("Unable to open serverSavedState.ser");
        }
        if (OS!=null){
            try {
                SSS=(ServerSavedState) OS.readObject();
                GameServer.gameSessionsList=SSS.savedGameSessionsList;
                GameServer.userList=SSS.savedUserList;
            } catch (ClassNotFoundException | IOException e) {
                System.out.println("Unexpected Error, ServerSavedState not restored.");
            }
            try {
                OS.close();
            } catch (IOException e) {
                System.out.println("Unable to close ObjectInputStream.");
            }
        }

        Runnable saveServerJob = new ServerSavedState();
        Thread saveThread = new Thread(saveServerJob);
        saveThread.start();

        Socket socket=null;
        ServerSocket serverSocket=null;

        try {
            serverSocket = new ServerSocket(GameServer.PORT);
            while(true){    
                socket = serverSocket.accept();
                Runnable serverConectionJob = new GameServer(socket);
                Thread serverConnection = new Thread(serverConectionJob);
                serverConnection.start();
                System.out.println("New client connected and new session thread started.");
            }
        } catch (IOException e) {
            System.out.println("Error occured while accepting the socket");
            e.printStackTrace();
        }
    }
}
</code></pre>

<p>///////////////////////////////////////////////////////////////</p>

<pre><code>package com.gmfb.chessapp;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.ArrayList;

public class ServerSavedState implements Runnable, Serializable{

    private static final long serialVersionUID = GameServer.serialVersionUID;
    private static final int saveFrequency = 5000; //5 seconds

    ArrayList&lt;GameSession&gt; savedGameSessionsList;
    ArrayList&lt;Player&gt; savedUserList;

    public void updateSGSL(ArrayList&lt;GameSession&gt; SGSL){

        savedGameSessionsList=SGSL;
    }

    public void updateSUL(ArrayList&lt;Player&gt; SUL){

        savedUserList=SUL;
    }

    @Override
    public void run() {

        ObjectOutputStream OS=null;

        while(true){

            boolean good=true;
            updateSGSL(GameServer.gameSessionsList);
            updateSUL(GameServer.userList); 

            try {
                Thread.sleep(saveFrequency);
            } catch (InterruptedException e2) {
                System.out.println("Unable to sleep.");
            }

            try {
                OS = new ObjectOutputStream(new FileOutputStream("serverSavedState.ser"));
            } catch (IOException e1) {
                System.out.println("Unable to open serverSavedState to file");
                good=false;
            }       

            try {
                OS.writeObject(this);
                OS.close();
            } catch (IOException e) {
                System.out.println("Unable to save serverSavedState to file");
                good=false;
            }

            if (good)
                System.out.println("Server state saved successfully!");
            else System.out.println("Server state saved unsuccessfully!");
        }
    }
}
</code></pre>

<p>StackTrace</p>

<pre><code>Exception in thread "Thread-1" java.lang.NullPointerException  
    at com.gmfb.chessapp.GameServer.createUser(GameServer.java:88) 
    at com.gmfb.chessapp.GameServer.run(GameServer.java:52) 
</code></pre>
