if(req.getContentType().startsWith("multipart/form-data")){
String inline1="",inline2="",inline="";
try{
ServletInputStream sis= req.getInputStream();
int len =req.getContentLength();
System.err.println("InputStream length:"+len);
byte b[] = new byte[len];
sis.read(b,0,len);
int x=0;
do {
inline+=(char)b[x];x++;
}while(x<len);
sis.close();
}catch (SocketException se) {
System.err.println("SocketException caught :"+se.getMessage());
}
catch (Exception e) {
System.err.println("Exception caught:"+e.getMessage());
}
System.err.println(inline);
inline="";
please overlook any perenthesis missing or a comma here.
My problem is the code above works great with tomcat, but when I use it with weblogic
6.0sp1 it just crashes in the middle of reading and gives me the following error
<Apr 26, 2001 2:33:43 PM GMT-06:00> <Error> <Posix Performance Pack> <Uncaught
Throwable in processSockets
java.lang.NullPointerException
at weblogic.socket.TunnelContext.getServlet(TunnelContext.java:24)
at weblogic.servlet.internal.MuxableSocketHTTP.dispatch(MuxableSocketHTTP.java:465)
at weblogic.socket.PosixSocketMuxer.deliverGoodNews(PosixSocketMuxer.java:449)
at weblogic.socket.PosixSocketMuxer.processSockets(PosixSocketMuxer.java:378)
at weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:23)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
I am stuck with this problem for last 2 days I will be very much obliged if some
one could please help me.
Hope it helps.