Cannot initialize PrintWriter field in constructor of a Thread
<p>There is need to create a new thread for each connection. Thread should have function to write to socket even if it is in run() waiting for client input: <code>String clientCommand = in.readLine()</code>. The function <code>update</code> should meet this requirements and be able to write to socket using <code>PrintWriter outWr</code> but it seems to be <code>null</code>, even if setting it in thread constructor.
Cannot initialize <code>PrintWriter outWr</code> in constructor. After <code>try</code> construction <code>outWr</code> remains to be <code>null</code>. How to fix it?</p>

<hr>

<pre><code>public class Server {
    public static void main(String[] args) { 
        ...
        ClientServiceThread cliThread = new ClientServiceThread(clientSocket, id++, auction);
        ...
}
</code></pre>

<hr>

<pre><code>public class ClientServiceThread extends Thread  {
private PrintWriter outWr;

ClientServiceThread(Socket s, int clientID, Auction a) {
        try {
            PrintWriter outWr = new PrintWriter(new OutputStreamWriter(
                    m_clientSocket.getOutputStream()));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
public void run() {....; String clientCommand = in.readLine(); ... }
public void update(String msg){outWr.println(msg);}
</code></pre>
