• Post Reply Bookmark Topic Watch Topic
  • New Topic

Solved : Can someone help with Object Input/Output Stream...

 
achana chan
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
I am trying to capture 2 values from the browser/applet and using object input/output stream, pass them to the servlet on the app-server.
JAVA console is showing me meaningless error :

This is the code snippet from the applet in which I am trying to write to the outputstream, so that at the other end they can be read from the input stream :

and this is the code on the server side. The input stream should be able to read the two inbound parameters...

Somehow I believe the two paramaters
String usr = ois.readUTF();
String pwd = ois.readUTF();
caused this problem because the code worked well for one parameter of type integer.
Update:
I tried writeUTF() instead of writeObject() and got the same response code 500, pretty meaningless message for me.
Update:
readObject() one end
writeObject() other end


[ November 22, 2002: Message edited by: achana chan ]
[ November 22, 2002: Message edited by: achana chan ]

[ November 22, 2002: Message edited by: achana chan ]
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to streams.
 
David Weitzman
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error is not meaningless. It is an HTTP code that tells you there is an exception being thrown in the servlet (or more generally, that there was an 'internal error' in the server).
The full stack trace should be in your servlet container's log file. With the small excerpt you've given, it's difficult to tell what the problem is. First you need to identify the precise problem, so either head to the log file or insert a try-catch around the servlet code and print the exception somewhere convenient to read.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!