Hello to all Experts.
I have a java swing Gui giving the servlet a parameter:
--------------------------
----------
----------
----------
----------
----------
----------
----------
----------
----------
--------
String empId="rom01";
ObjectOutputStream output = new ObjectOutputStream(servlet
Connection
.getOutput
Stream());
output.writeObject(new String(empId));
--------------------------
----------
----------
----------
----------
----------
----------
----------
----------
----------
----------
--------
The servlet gets the input:
//open InputStream
ObjectInputStream input=new ObjectInputStream(req.getI
nputStream
());
String empId=(String)input.readOb
ject();
--------------------------
----------
----------
----------
----------
----------
----------
----------
----------
----------
----------
-----
//servlet doGet method opens OutputStream
ObjectOutputStream output=new ObjectOutputStream(res.get
OutputStre
am());
// Set the contenty type to application/octet-stream
res.setContentType("applic
ation/octe
t-stream")
;
Vector emp = new Vector();
emp.add(0,new String("he"));
emp.add(1,new String("she"));
output.writeObject(emp);
--------------------------
----------
----------
----------
----------
----------
----------
----------
----------
----------
----------
----------
-------
When I call the method which in turns communicates with the servlet I get this error message:
exception
java.io.EOFException
java.io.ObjectInputStream$
PeekInputS
tream.read
Fully(Obje
ctInputStr
eam.java:2
232)
java.io.ObjectInputStream$
BlockDataI
nputStream
.readShort
(ObjectInp
utStream.j
ava:2698)
...
--------------------------
----------
----------
----------
----------
----------
----------
----------
----------
----------
----------
----------
----
also the application servers gives this exception message:
java.lang.NullPointerExcep
tion
at java.lang.String.<init>(St
ring.java:
144)
at TableTest.doGet(TableTest.
java:37)
at TableTest.doPost(TableTest
.java:66)
--------------------------
----------
----------
----------
----------
----------
----------
----------
----------
----------
----------
----------
----------
----------
----------
---
I have left out try and catch blocks in order not to clutter the message.
What do you think is the problem with this code ?
Thanks
Mimo