• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

FileNotFoundException - Kindly advise

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi To All,
I am facing a problem here in using the IO classes. I am having class in which I the following method as follows, this method takes 4 values as its parameters , and then I an trying to send these 4 values to a cold-fusion page(similar to html page) which has 4 text boxes which would take up this 4 values and then send back the response .
The method
-----------
public void interactServer(String s_name, String sreq_id, String sstatus, String smessage ) {

logDebug("Start interpretStatus()");
try {
String page_to_connect = "http://cd2iis02:80/inbz/admin/updatestatus.cfm?domain&"+ s_name + "requestid&"+ sreq_id + "status&"+ sstatus + "msg&"+ smessage ;

URL serverUrl = new URL(page_to_connect);
URLConnection uConnect = serverUrl.openConnection();
uConnect.setDoOutput(true);
uConnect.setUseCaches(false);
PrintStream out = new PrintStream(uConnect.getOutputStream
());
out.close();
InputStream in = uConnect.getInputStream();
StringBuffer response = new StringBuffer();
int chr;
while((chr=in.read())!=-1) { // this is line number 94
response.append((char)chr);
}
in.close();
String sResponse = response.toString();
System.out.println("**This is the response from the server::**"+ sResponse);

}catch(Exception ex){
logException(ex,ex.getMessage(),resLogging.NON_SERIOUS);
System.out.println("Trying to connect to the HTTP
page ::"+ page_to_connect);
}
logDebug("Before exiting the interactServer() method");

}
-----------------The follwoing is the error--------------
'*Exception*::java.io.FileNotFoundException: Response: '400' for url: 'http://cd2iis02:80/infobiz/admin/updatestatus.cfm?name&catherine-blanksrequestid&6414status&2302msg&Object exists , Value 0: 2302:Object exists (ERROR: Cannot insert a duplicate key into unique index epp_name_index)'
----------------------------------------------------------
I gave the follwoing url on the browser: http://cd2iis02:80/infobiz/admin/updatestatus.cfm
and it shows the page on the browser. I also tried without giving port number 80 and it still shows the web page.
I am not sure what cabe done here. Kindly advise , all response will be appreciated.
Thanks,
Regards,
John
 
author
Posts: 621
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It looks like that actual error is the "Duplicate Key" at the end of the error message. Because this is failing, the file is not being returned resulting in the filenotfound error. Other than that, I don't know too much about cold fusion.
Sean
 
Lijoy John
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sean,
Thanks for replying back.
Duplicate Key is just a message(smessage in url) I got from the database.
The url is :
String page_to_connect = "http://cd2iis02/infobiz/admin/updatestatus.cfm?domain="+sdomain_name+"&requestid="+sreq_id+"&status="+status+"&msg="+ smessage;

The error comes when the following line is encountered ::
InputStream in = uConnect.getInputStream();
Will it be advisable to use BufferredInputStream or DataInputStream instead of InputStream abstract class .
Kindly advise,
Thanks,
Regards,
John
 
reply
    Bookmark Topic Watch Topic
  • New Topic