Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

InputStream - FileNotFoundException

Lijoy John
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • 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();
PrintStream out = new PrintStream(uConnect.getOutputStream
InputStream in = uConnect.getInputStream();
StringBuffer response = new StringBuffer();
int chr;
while((!=-1) { // this is line number 94
String sResponse = response.toString();
System.out.println("**This is the response from the server::**"+ sResponse);

}catch(Exception ex){
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* 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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic