JDK-4249722 : URL.openStream() throws NULL ptr exception with FTP protocol and .zip file
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 1.3.0
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_9
  • CPU: generic
  • Submitted: 1999-06-25
  • Updated: 1999-08-04
  • Resolved: 1999-07-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.3.0 betaFixed
Related Reports
Duplicate :  
Description
daniel.daugherty@Eng 1999-06-25

I encountered this problem during my Kestrel Build I Quick Look.
The OS on which the test was running is Solaris 2.6. I have
reproduced the bug with the following java command configs:

    - green threads, JIT enabled
    - green threads, no JIT
    - native threads, JIT enabled
    - native threads, no JIT

I retested using Kestrel Build H and the failure does not occur.

From tests/url/GetURL.java:

            } else {
                logdebug("parsing URL: " + theurl);
                URL url = new URL(theurl);
                connected = false;
                for(int i=0; i<3; i++) {
                    try {
                        logdebug("opening stream to URL: " + theurl);
                        in = url.openStream();	<=== NULL pointer execption
                        connected = true;
                        break;

Here is the no-JIT portion of the reproduction log:

java version "1.3"
Classic VM (build JDK-1.3-I, green threads, nojit)
+ java -Djava.compiler= -DproxyHost=webcache.east.sun.com -DproxyPort=8080 -Dftp.proxyHost=webcache.east.sun.com -Dftp.proxyPort=8080 GetURL -v -d -u ftp://ftp.javasoft.com/docs/jdk1.0.2/JDK-1_0_2-apidocs.zip -o do_repro.out 
DEBUG: parsing URL: ftp://ftp.javasoft.com/docs/jdk1.0.2/JDK-1_0_2-apidocs.zip
DEBUG: opening stream to URL: ftp://ftp.javasoft.com/docs/jdk1.0.2/JDK-1_0_2-apidocs.zip
ERROR: GetURL.main(): exception occurred:
java.lang.NullPointerException
java.lang.NullPointerException
	at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:522)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:475)
	at java.net.URL.openStream(URL.java:808)
	at GetURL.main(GetURL.java:103)
FINALSTATUS:GetURL:EXIT_ERROR:2:Number of ERRORS:1:TEST INCOMPLETE
+ set +x 

daniel.daugherty@Eng 1999-07-15

I just retested Kestrel Build I and the failure still occurs with a
different stack trace:

java version "1.3"
Classic VM (build JDK-1.3-L, green threads, nojit)
+ java -DproxyHost=webcache.east.sun.com -DproxyPort=8080 -Dftp.proxyHost=webcache.east.sun.com -Dftp.proxyPort=8080 GetURL -v -d -u ftp://ftp.javasoft.com/docs/jdk1.0.2/JDK-1_0_2-apidocs.zip -o do_repro.out 
Warning: JIT compiler "sunwjit" not found. Will use interpreter.
DEBUG: parsing URL: ftp://ftp.javasoft.com/docs/jdk1.0.2/JDK-1_0_2-apidocs.zip
DEBUG: opening stream to URL: ftp://ftp.javasoft.com/docs/jdk1.0.2/JDK-1_0_2-apidocs.zip
ERROR: GetURL.main(): exception occurred:
java.lang.ClassCastException: java.io.BufferedInputStream
java.lang.ClassCastException: java.io.BufferedInputStream
	at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:538)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:475)
	at java.net.URL.openStream(URL.java:805)
	at GetURL.main(GetURL.java:103)
FINALSTATUS:GetURL:EXIT_ERROR:2:Number of ERRORS:1:TEST INCOMPLETE

I reproduced the failure using both the java.net test suite *and* the
attached archive 4249722_repro.tar.Z. Was the archive used to test
the proposed fix? It certainly reproduces the bug with Build L so I'm
curious if the bug is not always reproducible.

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: generic kestrel-beta FIXED IN: kestrel-beta INTEGRATED IN: kestrel-beta
14-06-2004

EVALUATION gary.ellison@eng 1999-06-29 sun.net.www.http.HttpClient.java fails to initialize the PushbackInputStream socketInput object when using a proxy for a protocol other than http. When a proxy is in use the private privilegedSuperOpenServer() method is used rather than the public openServer() method. This method does not initialize the socketInput object. In the previous version of HttpClient socketInput was initialized in the parseHTTP() method. In the current version the initialization was moved to the public openServer() method. yingxian.wang@eng 1999-07-07 We should use privilegedOpenServer instead of privilegedSuperOpenServer.
07-07-1999