Beitrag 198 von 610 (32%) | Antworten Beitrag schreiben | Anfang zurück weiter Ende |
|
Hallo Ihr,
ich brauche mal wieder eure Hilfe. Folgender Code sollte den Zweck haben, dass vom Applet ein Objekt an das Servlet geschickt wird. Die funktioniert auch mit der JVM von Microsoft einwandfrei. Sobald aber die JVM von SUN ins Spiel kommt, bekomme ich eine Fehlermeldung (s.u.) sobald der Explorer beendet wird.
Hat jemand eine Ahnung, woran es liegen könnte?
Gruß
Ralf
Applet:
...
try {
URL servURL = new URL( "http://localhost:8080/rk/servlet/rk.TippSpeichern" );
URLConnection servConn = servURL.openConnection();
servConn.setUseCaches( false );
servConn.setDoOutput( true );
servConn.setRequestProperty( "Content-Type", "application/octet-stream" );
ObjectOutputStream oos = new ObjectOutputStream( servConn.getOutputStream() );
oos.writeObject( (String) URLEncoder.encode( strLine ) );
oos.close();
} catch ( Exception ex ) {
}
...
Servlet:public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
...
try {
ois = new ObjectInputStream( request.getInputStream() );
NeuerTipp = (String) ois.readObject();
ois.close();
} catch ( Exception ex ) {
}
...
try {
DataInputStream myData = new DataInputStream( new FileInputStream( fileName ) );
for ( Zeile=1; (strLine=myData.readLine())!=null; Zeile++ )
myZeile.put( new Integer( Zeile ).toString(), strLine );
myData.close();
...
PrintWriter pw = new PrintWriter( new FileWriter( fileName ), true );
for ( Zeile=1; Zeile<=myZeile.size(); Zeile++ )
pw.println( (String) myZeile.get( new Integer( Zeile ).toString() ) );
pw.close();
} catch ( IOException ioe ) {
}//catch
...
Fehlermeldung:
2002-09-27 03:46:17 - ContextManager: SocketException reading request, ignored - java.net.SocketException: Connection reset by peer: JVM_recv in socket input stream read
at java.net.SocketInputStream.socketRead(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:86)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:186)
at java.io.BufferedInputStream.read(BufferedInputStream.java:204)
at org.apache.tomcat.service.http.HttpRequestAdapter.doRead(HttpRequestAdapter.java:115)
at org.apache.tomcat.core.BufferedServletInputStream.doRead(BufferedServletInputStream.java:106)
at org.apache.tomcat.core.BufferedServletInputStream.read(BufferedServletInputStream.java:128)
at javax.servlet.ServletInputStream.readLine(ServletInputStream.java:138)
at org.apache.tomcat.service.http.HttpRequestAdapter.readNextRequest(HttpRequestAdapter.java:129)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:195)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)