[5021] in java-interest
WWW-Server in Java
daemon@ATHENA.MIT.EDU (Andreas Wiener)
Fri Jan 26 05:02:40 1996
Date: Fri, 26 Jan 1996 09:03:18 +0100
From: wiener@igd.fhg.de (Andreas Wiener)
To: java-interest@java.sun.com
Hi People,
I have a Problem writing my own WWW-Server in Java.
Everything seems to work. But when I ask for a Page with the
Appletviewer that has an Applet inside I get the following Error:
appletviewer http://cider:7070/dungeon.html
thread applet-DungeonGame.class find class DungeonGame
Opening stream to: http://cider:7070/DungeonGame.class to get DungeonGame
sun.net.TelnetProtocolException: misplaced CR in input
at sun.net.TelnetInputStream.read(TelnetInputStream.java:105)
at java.io.PushbackInputStream.read(PushbackInputStream.java:56)
at java.io.DataInputStream.readLine(DataInputStream.java:244)
at sun.net.www.http.HttpClient.processRequest(HttpClient.java:224)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:172)
at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:65)
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:160)
at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:122)
at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:101)
at sun.applet.AppletPanel.run(AppletPanel.java:200)
at java.lang.Thread.run(Thread.java:289)
load: class DungeonGame not found
java.lang.ClassNotFoundException: DungeonGame
at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:125)
at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:101)
at sun.applet.AppletPanel.run(AppletPanel.java:200)
at java.lang.Thread.run(Thread.java:289)
The code of my Server looks like that:
fp = new FileInputStream( querystring );
b = new byte[40000];
try
{
len = fp.read( b );
}
catch( IOException e )
{
e.printStackTrace();
return 2;
}
fp.close();
out.write( b, 0, len );
out.flush();
where out is:
DataOutputStream out;
out = new DataOutputStream( socket.getOutputStream() );
Netscape works with it (2.0b6a Solaris). I tried Java 1.0 and 2.0beta.
What's wrong with it ? It can only be a little error, cause when I write
the bytes to a file everything is ok.
Thanks for your help
Andreas Wiener
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com