|
Hi Mike, The dir /test does exist as I've all the jar file sin /test dir. Unfortunately, I don't have a debugger, however when I ran the pgm again without the full file name as.. java -Djava.version=1.2 -classpath .:/test/jt400.jar Fsa http://www.slashdot.org/ /test slashdot.xml Everything fine so far Destination: /test The pgm WORKED!!!! WHY???? Inspecting the file slashdot.xml, the content appears as.... ************Beginning of data************** //Frequently used domains for performance function FindProxyForURL(url, host) { if (shExpMatch(host,"*.ml.com")&& (shExpMatch(host,"*.sea.us.ml.com")|| shExpMatch(host,"*.worldnet.ml.com"))) return "DIRECT"; //West Street VOR Proxy Section else if (shExpMatch(host,"idceb.aan.amex.com")|| shExpMatch(host,"idcea.aan.amex.com")|| shExpMatch(host,"idcet.aan.amex.com")|| shExpMatch(host,"www.bizbonds.net")|| shExpMatch(host,"*.members.equilend.com")) return "PROXY 209.65.19.76:8080;"; and so on on on... //Teleport VOR Proxy Section else if (shExpMatch(host,"www.faquery.vendorservices.greenawnings.net")|| shExpMatch(host,"nawftest.checkfree-cis.com")|| Looks like some kind of html returning back. But why it doesn't work when I specify the file name, that's the CRUNCH QUESTION???? rgds, Rajesh Anand Email:Rajesh_anand@xxxxxx -----Original Message----- From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Michael Hawes Sent: 04 January 2005 15:50 To: Java Programming on and around the iSeries / AS400 Subject: RE: Java Error Hi Rajesh , I've copied your program and run it on my system fine. The proxy stuff makes no difference. Your trying to create the file '/test/slashdot.xml' and it's telling you something is missing (file not found. Make sure the directory /test exists. Did you step through this is a debugger? You'd see that the url read works ok and you would see the line it failed on, i.e. that the write fails and you could then think about why the write fails. Regards Mike --- "Anand, Rajesh" <Rajesh_Anand@xxxxxx> wrote: > 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 === message truncated === ___________________________________________________________ ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com -- 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 mailing list archive is Copyright 1997-2024 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.