• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Axis 1.4 Error plz help Connect Exception

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Please help me im getting the following exception in Axis 1.4 :-

[Ljava.lang.StackTraceElement;@13d9c02
AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException faultSubcode: faultString: java.net.ConnectException: Connection timed out faultActor:
faultNode:
faultDetail: {http://xml.apache.org/axis/}
stackTrace:java.net.ConnectException: Connection timed out at java.net.PlainSocketImpl.socketConnect(Native Method).........

I have created a Stub from the provided WSDL with WSDL2Java.class in AXIS 1.4, the call for the Web Service executes very well on my machine but it creates a problem when i deploy the code in other machines. I had gone through various websites, they had suggested to change firewall settings, I am unaware that is it really a need to change firewall settings or there is something else that is required? If a firewall settings needs to be changed then please reply me the steps to change it.
 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you regenerate the stubs with the new WSDL file from the server that you deployed your application to? If you didn't, you'll need to set the client application to point to the correct target URL. How about post your sample code here?
 
Jairam Gharge
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had created the Stub and added that call in the Servlet, the URL is pointing at the perfect location.
The web service is working fine because i am able to receive response from the Web Service into my Servlet. But the issue is when i try to use this servlet on other machine it gave me the above error.
Please help.
Thanks in advance.
 
Duc Vo
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jairam Gharge:
I had created the Stub and added that call in the Servlet, the URL is pointing at the perfect location.
The web service is working fine because i am able to receive response from the Web Service into my Servlet. But the issue is when i try to use this servlet on other machine it gave me the above error.
Please help.
Thanks in advance.


Bother to post the code segment which is the root of the exception and the exception details?

When you move your servlet to another server, it seems that it isn't reconfigured to send the web service call to the original server but its hosted server (i.e. http://localhost:8080/something). If you are using AXIS when creating the service locator set its target end point to the full web service end point URL.
 
Jairam Gharge
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok,
Here is my lines of code written in my Servlet:-
CommunitiesPort , CommunitiesPortServiceLocator and other 2 java files are created through WSDL2Java.claa of Axis 1.4

This line is firing an exception

CommunitiesPort communitiesport=new CommunitiesPortServiceLocator().getCommunitiesPort();
String userValues[] =communitiesport.citizenProfile("WS_USER", "WS_PASSW0RD",cookieCitizenIdValue);

I access my application by http://localhost:8080/communities

I simply created the WAR file and deployed that on other machine in WebApps of Tomcat.

Then I got this exception in my Apache Logs in Catalina.log file.

These are the lines of my Stub class:-

public java.lang.String[] citizenProfile(java.lang.String in0, java.lang.String in1, java.lang.String in2) throws java.rmi.RemoteException {
if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[0]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("http://DefaultNamespace", "citizenProfile"));

setRequestHeaders(_call);
setAttachments(_call);
try { java.lang.Object _resp = _call.invoke(new java.lang.Object[] {in0, in1, in2});

if (_resp instanceof java.rmi.RemoteException) {
throw (java.rmi.RemoteException)_resp;
}
else {
extractAttachments(_call);
try {
return (java.lang.String[]) _resp;
} catch (java.lang.Exception _exception) {
return (java.lang.String[]) org.apache.axis.utils.JavaUtils.convert(_resp, java.lang.String[].class);
}
}
} catch (org.apache.axis.AxisFault axisFaultException) {
throw axisFaultException;
}
}

Thanks for repling till now.
Please help me to find a solution to get out from this Exception.
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jairam Gharge:
I had gone through various websites, they had suggested to change firewall settings, I am unaware that is it really a need to change firewall settings or there is something else that is required?



It is more likely that you need to set up the web service client's proxy settings (to let the request pass through the firewall - that is how the web browsers gets through it).

See here and Client-Side Axis: Axis Properties: Network Configuration

The web service is working fine because i am able to receive response from the Web Service into my Servlet.



Here it sounds like you can only get the web service client to work if the web service provider and the web service consumer are both running on your machine. Now in that case it could be an issue with your personal firewall if you are trying to access the web service provider on your machine from a web service consumer on another machine. By default most personal firewalls will not let ports like 80 or 8080 be accessed from the outside. Even if you are not running a personal firewall, a corporate firewall could also be preventing access if your machine (with the web service provider) is behind one from the perspective of the outside web service consumer - the corporate firewall would be configured to only allow outside access to certain servers at certian URLs and ports with specified protocols - and from the sound of it your "ad hoc" web service server wouldn't be included in that "corporate" configuration.
[ December 15, 2008: Message edited by: Peer Reynders ]
 
Duc Vo
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is the machine that you deployed the application to is on a DMZ?
Is the web service server in side your network or does it belong to an external network?
Can you telnet from the deployment machine to the web services server on the provided service port (normally 80)? Should be something like

If it does connect then it is not a firewall problem.
If it doesn't and the deployment machine is in DMZ, you'll need to ask your network administrator to open the outbound connection from that server to the webservice server on the service port.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic