We the connection is not the problem that works fine, its when the server trys to recive the file or when the client trys to send it I think its on the server side thought bucause the connection is closed after the client says it is sent. I dont knw whats wrong here and dont know where to start to look for the solution thanks for any help.
here is the client code:
Java Code:
import java.net.*;
import java.io.*;
class Client{
    Socket clientSocket;
    byte[] byteArray;
    BufferedInputStream bis;
    BufferedOutputStream bos;
    int in;
    BufferedReader inm = null;
    PrintWriter outm = null;

public Client()
{
    try{
        clientSocket = new Socket("localhost", 4444);
        System.out.println("Client is connect");
        inm = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
        outm = new PrintWriter(clientSocket.getOutputStream(), true);
        System.out.println("Socket Closed = " +clientSocket.isClosed());
        outm.println("msg 1: Client messageing open");
        System.out.println("from server__ " +inm.readLine());
        outm.println("msg 2: Sending file");
        System.out.println("from server__ " +inm.readLine());
        sendFile();
        System.out.println("Socket closed = " +clientSocket.isClosed());
        System.out.println("from server__ " +inm.readLine());
        
    }catch(IOException e)
    {
        e.printStackTrace();
    }
}
//make public to revers fix
public void sendFile(){
    try{
        BufferedReader bo = new BufferedReader(new FileReader("request.xml"));
        //bis = new BufferedInputStream(new FileInputStream("request.xml"));
        bos = new BufferedOutputStream(clientSocket.getOutputStream( ));
        /*
        byteArray = new byte[8192];
        while ((in = bis.read(byteArray)) != -1){
        bos.write(byteArray,0,in);
        }
        // bis.close();
         bos.flush();
         *
         */
        //PrintWriter out = new PrintWriter(clientSocket.getOutputStream());
         String str;
         System.out.println("This is the xml file");
              while((str = bo.readLine()) != null)
              {
                 
                  System.out.println(str);
                  outm.write(str);
              }

        }catch(IOException e)
        {e.printStackTrace();}
}
public static void main(String[] args){
Client client = new Client();

}
}

And here is the server code:

Java Code:
import java.net.*;
import java.io.*;

class Server{
    BufferedInputStream bis;
    BufferedOutputStream bos;
    byte[] data;
    Socket socket;
    ServerSocket serverSocket;
    int in;
    BufferedReader inm = null;
    PrintWriter outm = null;

public Server()
{
    try{
        serverSocket = new ServerSocket(4444);
        System.out.println("Server setup and listening...");
        socket = serverSocket.accept();
        System.out.println("Client connect");
        System.out.println("Socket is closed = " +socket.isClosed());
        inm = new BufferedReader(new InputStreamReader(socket.getInputStream()));
        outm = new PrintWriter(socket.getOutputStream(), true);
        System.out.println("from client: " +inm.readLine());
        outm.println("ack 1: hi....");
        System.out.println("from client: " +inm.readLine());
        outm.println("ack 2: Ready....");
        receiveFile();
        System.out.println("Socket closed = " +socket.isClosed());
        outm.println("ack 3: take the file");
        }catch (IOException e)
        {
            e.printStackTrace();
        }
    }

//make public to reverse fix
public void receiveFile(){
    try{
        /*
        byte[] receivedData = new byte[8192];
        bis = new BufferedInputStream(socket.getInputStream());
        bos = new BufferedOutputStream(new FileOutputStream("request.xml"));
        while ((in = bis.read(receivedData)) != -1){
        bos.write(receivedData,0,in);
        }
        bos.flush();
    bos.close();
         *
         * */
         char gus;
         BufferedInputStream buf = new BufferedInputStream(socket.getInputStream());
         BufferedWriter bwo = new BufferedWriter(new FileWriter("result.xml"));
         System.out.println("buf.avaliable = " +buf.available());
         System.out.println("Reading file");
                while(buf.available()>0)
                {
                    gus = (char) buf.read();
                    bwo.write(gus);

                }
                bwo.flush();
                bwo.close();
                buf.close();
    }catch (IOException e)
    {
        e.printStackTrace();
    }
    }
public static void main(String[] args)
{
        Server server = new Server();
}
}