• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Connection Refused Error

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am trying to connect to an xml file on HTTP server through Java Application using following code.
try
{
URL url = new URL("http://***.***.**.**:4319/***.xml");

is = url.openStream();
InputSource xmlFile = new InputSource(is);
parser.parse(xmlFile);
}
catch (FileNotFoundException fnfe)
{
logger.logAlways(fnfe.getMessage(),LOG_SOURCE);
if (fnfe.getMessage() == null)
logger.logError(fnfe);
}
catch (SAXException saxe)
{
logger.logAlways(saxe.getMessage(),LOG_SOURCE);
logger.logError(saxe);
}
finally
{
if(is != null)
is.close();
}
This code has been working for more than a year.
But recently I found a strange problem.
I am getting "Connection refused" from this code
but I can connect to the xml file from browser.
Does anybody have any idea?
[ June 14, 2002: Message edited by: supriya_s ]
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I�m having the same problem with similar code.
My application works fine in JBoss but receive the same error (Connection refused) in the same point when i deploy it in SAP portal... I have changed the way i get the xml file by using a Fileinputstream class and asking the servletcontext for the real path where my xml file is placed instead of getting it using the URL and an "java.net.URL" class... It fixes the problem for SAP portal but it fails for Jboss... Probably in JBoss i�m not getting the right real path.. but anyway.. my question is:
Is it possible that some app servers refused a connection to them made by one of the applications they hold due to any kind of security reasons?
Thanks a lot in advance
(in Spanish/En espa�ol)
Tengo el mismo problema con un c�digo similar.
Mi aplicaci�n funciona correctamente en JBoss pero recibo el mismo error (Connection refused) en el mismo punto cuando la despliego en SAP portal. He cambiado la forma de obtener el fichero xml usando la clase FileinputStream y preguntando al contexto del servlet por la ruta f�sica real donde est� mi fichero xml en vez de usar una url y la clase "java.net.URL" para obtenerlo. Esta soluci�n arregla el problema en SAP portal pero no funciona en JBoss... Probablemente no estoy obteniendo el path correcto en JBoss, pero en cualquier caso la pregunta es:
Es posible que algunos servidores de aplicaciones rechacen una conexi�n �sobre ellos mismos hecha por una aplicaci�n que ellos mismos tienen instalada por alg�n motivo de seguridad?
Muchas gracias por adelantado.
 
In the renaissance, how big were the dinosaurs? Did you have tiny ads?
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic