ObjectOutputStream & ObjectInputStreams - null trouble
I have two apps that work in conjunction with one another. One is a "server" type app that does not have any GUI interface and handles queries to a database and processes requests from a client. The other is a "client" that is primarily a GUI and is for users to interact with database information in a structured manner.
ISSUE / TROUBLE / HELP NEEDED WITH
The problem that I am having is that I can send one Object (a String) to the server successfully and with no problems. Client app sends it, Server app receives it an processes it successfully.
If I try and send a second String, the the client compiles the array and thinks it gets sent, but the server never receives is (gets only null) and produces a IOException.
This is even with Arrays that contain the exact same number of positions and the exact same text in the exact same format and positions.
The error produced by the printStackTrace() is:
The code at line 204 that is the point where the ObjectStream is being read from:
at java.io.ObjectInputStream.readObject0 (ObjectInputStream.java:1367)
at java.io.ObjectInputStream.readObject (ObjectInputStream.java:369)
ois is an ObjectInputStream and is initialized as follows:
String addArray = (String) ois.readObject();
private ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());
The client code used to send these objects TO the server app is:
What does NOT make sense to me is that this exact same code format is used to successfully send a number of String over the objectOutputStream from the SERVER to the CLIENT app without ever sending a "null"
I have Google searched this and all to absolute no avail.
Someone please help if you can!!
Re: ObjectOutputStream & ObjectInputStreams - null trouble