May 11, 2012

Failed to read wsdl file from url

javax.xml.ws.WebServiceException: weblogic.wsee.wsdl.WsdlException: Failed to read wsdl file from url due to -- java.net.ConnectException: Tried all: '1' addresses, but could not connect over HTTP to server: 'sinuxu31', port: '7909'


When the above error occurs, you must check the following.


1) Check that you can view the wsdl URL using a browser
  • If the WSDL URL is not accessible then the server hosting the web service is unavailable. 
  • Check if you are blocked by any firewall rules.
  • You can use the following command in UNIX to get the wsdl file
    • wget -O google-wget.txt http://www.google.com 
    • cat google-wget.txt
 2) If the WSDL URL is accessible via Browser then check the connectivity to the external server from the server where Web service client is hosted.
  • Try ping the external server to check whether able to reach the server in the network
    • ping <external_server_host_name></external_server_host_name>
  • If the ping is not working, check that hosting server is on the network
  • Check if there is any firewall rule set to blocking the network traffic from the calling server
  • Telnet to the external server to check whether the Connection to the server is established properly
    • telnet <external_server_host_name> <port_number></port_number></external_server_host_name>
  • If telnet fails, check whether the port is opened from the calling server to get a connection to the external server
  • Do  a nslookup for the external server to check whether the DNS server name mappings
    • nslookup 
    • > <external_server_host_name>
  • If the nslookup fails, check the DNS server name mappings are done properly.

JMS Message Destination Error

In this example i am trying to create a Point to Point messaging service. i am using JEE 5 and Glassfish. I encountered the following error message when using annotations.

SEVERE: NAM0007 : Message Destination Reference java:comp/env/jms/p2pQueue has not been linked to a Message Destination
15-Sep-2009 17:02:38 com.sun.enterprise.appclient.MainWithModuleSupport
WARNING: ACC003: Application threw an exception.
javax.naming.NamingException: Message Destination Reference java:comp/env/jms/p2pQueue has not been resolved
at com.sun.enterprise.naming.NamingManagerImpl.bindObjects(NamingManagerImpl.java:521)
at com.sun.enterprise.appclient.AppContainer.preInvoke(AppContainer.java:137)
at com.sun.enterprise.appclient.MainWithModuleSupport.(MainWithModuleSupport.java:383)
at com.sun.enterprise.appclient.MainWithModuleSupport.(MainWithModuleSupport.java:259)
at com.sun.enterprise.appclient.Main.main(Main.java:200)



This is caused by the following incorrect @Resource references.

@Resource(name = "jms/p2pQueue")
private static Queue p2pQueue;
@Resource(name = "jms/QueueConnectionFactory")
private static ConnectionFactory p2pQueueFactory;


The correct annotation should be

@Resource(mappedName = "jms/p2pQueue")
private static Queue p2pQueue;
@Resource(
mappedName = "jms/QueueConnectionFactory")
private static ConnectionFactory p2pQueueFactory;