×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




        Hi Magne,

        The CRUNCH Question is WHY IT WORKS ON YOUR ISERIES AND NOT
MINE?????

        IS it because the PROXY server is blocking it and I don't know
how & why?

        But I have already bypassed the proxy server or at least that's
what the code does I believe.

        WHY IT IS NOT WORKING?????

        Rgds,

Rajesh Anand
Email:Rajesh_anand@xxxxxx


-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx
[mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Magne Kofoed
Sent: 04 January 2005 15:22
To: Java Programming on and around the iSeries / AS400
Subject: Re: Java Error


Hi Rajesh,

i took away the proxy setting in your program, compiled and 
tested. It worked on my iSeries (with JDK 1.4).

Here is the src code and run statement:
>javac Fsa.java 
  
$                                                            
                                 
> java -Djava.version=1.4 -classpath .: Fsa 
http://www.slashdot.org/slashdot.xml . slashdot.xml 
  Everything fine so far              
Destination: .                                               
$                                                            
                                 

import java.net.*; 
import java.io.*; 
public class Fsa { 
public static void main(String[] args) throws Exception 
{ 
if(args.length < 3){ 
System.out.println("Error !"); 
System.out.println("Pls input <url> <path> <filename>"); 
return; 
} 
String test = args[0]; 
String path = args[1]; 
String filename = args[2]; 
String inputLine; 
// 
//System.getProperties().put( "proxySet", "true" ); 
//System.getProperties().put( "proxyHost", "proxy.ml.com" ); 
//System.getProperties().put( "proxyPort", "8083" ); 
URL fsa = new URL(test); 
BufferedReader in = new BufferedReader(new InputStreamReader
(fsa.openStream())); 
System.out.println("Everything fine so far"); 
File outputfile = new File(path, filename); 
System.out.println("Destination: " + path); 
try{ 
PrintWriter outfilestream = new PrintWriter(new 
FileOutputStream(outputfile)); 
while((inputLine = in.readLine()) != null) 
outfilestream.println(inputLine); 
outfilestream.flush(); 
outfilestream.close(); 
in.close(); 
} catch(IOException e) { 
System.out.println("Error in creating file"); 
System.exit(1); 
} 
} 
} 


Rgds,
Magne




Hi Folks, 

I've a simple program that is meant to read a xml file from 
a 
website but I get an error. 

My program is like so.... 

import java.net.*; 

import java.io.*; 



public class Fsa { 

public static void main(String[] args) throws Exception 

{ 

if(args.length < 3){ 

                    System.out.println("Error !"); 

                    System.out.println("Pls input <url> 
<path> 
<filename>");          
                    return; 

                    } 

   String test = args[0]; 

   String path = args[1]; 

  String filename = args[2]; 
   String inputLine; 
// 
System.getProperties().put( "proxySet", "true" ); 


       System.getProperties().put
( "proxyHost", "proxy.ml.com" ); 


       System.getProperties().put( "proxyPort", "8083" ); 


  URL fsa = new URL(test); 

                         
  BufferedReader in = new BufferedReader(new 
InputStreamReader(fsa.openStream()));    
  
System.out.println("Everything fine so far"); 

File outputfile = new File(path, filename); 


   System.out.println("Destination: " + path); 


  try{ 

      PrintWriter outfilestream = new PrintWriter(new 
FileOutputStream(outputfile));    
      while((inputLine = in.readLine()) != null) 

      outfilestream.println(inputLine); 

      outfilestream.flush(); 

      outfilestream.close(); 

      in.close(); 

      } catch(IOException e) { 

      System.out.println("Error in creating file"); 

      System.exit(1); 

      } 

 } 

 }                                             

When running this program with the following parameters... 

java -Djava.version=1.2 -classpath .:/test/jt400.jar Fsa 
http://www.slashdot.org/slashdot.xml /test slashdot.xml 

I GET THIS ERROR..... 

java.io.FileNotFoundException: 
http://www.slashdot.org/slashdot.xml 

     java/lang/Throwable.<init>(Ljava/lang/String;)V+4 
(Throwable.java:94)                                          
       
     java/lang/Exception.<init>(Ljava/lang/String;)V+1 
(Exception.java:42)                                          
       
     java/io/IOException.<init>(Ljava/lang/String;)V+1 
(IOException.java:47)                                        
       

sun/net/www/protocol/http/HttpURLConnection.getInputStream()
Ljava/io/Inp 
utStream;+356 (HttpURLConnection.java:530)    
     java/net/URL.openStream()Ljava/io/InputStream;+4 
(URL.java:818) 

     Fsa.main(^Ljava/lang/String;)V+0 (Fsa.java:8) 



Any help will be greatly appreciated. 

rgds, 

Rajesh Anand 
Merrill Lynch 
Email:Rajesh_anand@xxxxxx 
-- 
This is the Java Programming on and around the iSeries / AS400
(JAVA400-L) mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l. 
--------------------------------------------------------
 
If you are not an intended recipient of this e-mail, please notify the sender, 
delete it and do not read, act upon, print, disclose, copy, retain or 
redistribute it. Click here for important additional terms relating to this 
e-mail.     http://www.ml.com/email_terms/ 
--------------------------------------------------------
 


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.