Hi,
I am sending a vector from an
applet to servlet.When I tried to execute applet from browser I am getting above error in the Weblogic console.
I am sending data using ObjectInputSTream...
The code is like below...
The applet:
public void sendObjToServer(Vector loginParamaters)
{
URL url = null;
URLConnection urlConn = null;
InputStream is = null;
DataOutputStream outs = null;
ObjectInputStream ois = null;
try
{
url = new URL("http://co78565:7001/test");
urlConn = url.openConnection();
urlConn.setAllowUserInteraction(true);
urlConn.setDoOutput(true);
urlConn.setUseCaches(false);
urlConn.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
ObjectOutputStream objOutStream = new ObjectOutputStream(urlConn.getOutputStream());
objOutStream.writeObject(loginParamaters);
objOutStream.flush();
objOutStream.close();
}
catch(Exception e)
{
System.out.println("Exception exp"+e);
e.printStackTrace();
}
--------------------------
in servelt:
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
ObjectInputStream inputFromApplet = null;
PrintWriter out = null;
Hashtable hashValue = new Hashtable();
try
{
inputFromApplet = new ObjectInputStream(request.getInputStream());
loginInfo = (Vector) inputFromApplet.readObject();
inputFromApplet.close();
System.out.println(" loginInfo values in servelt "+ loginInfo);
User = (
String)loginInfo.elementAt(0);
pwd = (String)loginInfo.elementAt(1);
clt = (String)loginInfo.elementAt(2);
host = (String)loginInfo.elementAt(3);
lang = (String)loginInfo.elementAt(4);
sys = (String)loginInfo.elementAt(5);
R3ConnectionInfo ci = new R3ConnectionInfo(User, pwd, clt, host, sys, lang);
FunctionGroup group[] = RfcFunctionSearch.fetchRfcFunctions(ci, "Z*", null);
for (int i = 0; i < group.length; i++)
{
RemoteFunction functions[] = group[i].getFunctions();
String[] functionNames = new String[functions.length];
for (int j = 0; j < functions.length; j++)
{
functionNames[j] = functions[j].getFunctionName();
}
hashValue.put(((String)group[i].getGroupName()),functionNames);
}
}
catch(Exception e)
{
System.out.println(" Exception in doPost()"+ e);
}
System.out.println(" Hash Table output is :"+hashValue.toString());
sendBORList(response, hashValue);
}
-----------------------
ERROR in the CONSOLE:
Exception in doPost()java.io.StreamCorruptedException: Caught EOFException while reading the stream header
I am using weblogic server as app server and i am getting error at
inputFromApplet = new ObjectInputStream(request.getInputStream());
in the
servlet..
Any help in this regard appriciated well.
Thanks,
Madhu Palutla
[ July 12, 2002: Message edited by: Madhu Palutla ]
[ July 13, 2002: Message edited by: Madhu Palutla ]