From nobody@hyperreal.com Sat Mar 29 10:40:32 1997 Received: by taz.hyperreal.com (8.8.4/V2.0) id KAA08775; Sat, 29 Mar 1997 10:40:32 -0800 (PST) Message-Id: <199703291840.KAA08775@taz.hyperreal.com> Date: Sat, 29 Mar 1997 10:40:32 -0800 (PST) From: Reply-To: rkline@wcupa.edu To: apbugs@hyperreal.com Subject: Java 1.0.2 image loading program doesn't work for 1.2b7, but does for 1.1.3 X-Send-Pr-Version: 3.2 >Number: 285 >Category: protocol >Synopsis: Java 1.0.2 image loading program doesn't work for 1.2b7, but does for 1.1.3 >Confidential: no >Severity: serious >Priority: medium >Responsible: apache >State: closed >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Sat Mar 29 10:50:00 1997 >Last-Modified: Sat Mar 29 13:48:51 PST 1997 >Originator: rkline@wcupa.edu >Organization: >Release: 1.2b7 >Environment: Ultrix 4.2, Solaris 2.5, gcc2.7.2 >Description: The program "ImageLoad.java" below fails to load a GIF or JPEG image file on the call java ImageLoad http::/ if the is running Apache 1.2b7, but it works if running Apache 1.1.3. Errors look like protocol mistakes, saying the image is not a GIF or JPEG file. This problem was experienced on both Solaris and Ultrix running 1.2b7. Both work fine running 1.1.3. ---------------------------------------------------------------------- // ImageLoad.java import java.net.URL; import java.awt.*; class ImageLoad extends Frame { private Image im; static String URL_name; static public void main(String args[]) { URL_name = args[0]; ImageLoad app = new ImageLoad(); app.reshape(100, 100, 320, 430); app.show(); } ImageLoad() { super("Image Test"); URL file = null; try { file = new URL( URL_name ); } catch(Exception e) { System.out.println( e ); System.exit(0); } im = Toolkit.getDefaultToolkit().getImage( file ); } public void paint(Graphics g) { g.drawImage( im, 0, 0, this ); } } >How-To-Repeat: Compile and run the ImageLoad program given in the full description. Try to load an image from server running Apache 1.1.3 vs. one running Apache 1.2b7 >Fix: No, I can't be certain it's not a Java problem, only that the Java program given works for 1.1.3, but not for 1.2b >Audit-Trail: State-Changed-From-To: open-closed State-Changed-By: dgaudet State-Changed-When: Sat Mar 29 13:48:51 PST 1997 State-Changed-Why: This is a bug in the sun Java code. It misinterprets the "HTTP/1.1" string that's part of the server's response as a declaration that the response is incompatible with HTTP/1.0, which is not the case (and is required by the standards). At any rate you can work around it by adding something like this to your config: BrowserMatch "^Java 1\.0\.2" force-response-1.0 I might have the User-Agent string wrong there... Thanks for using Apache. Dean >Unformatted: