You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by NY...@aol.com on 2004/07/01 20:24:48 UTC

Help Diagnosing Server-Side Problems

Hello All,
 
Your help is invaluable to the progress of our nation! I have a Web Service  
I wrote with Axis running on local tomcat 8080. I wrote a client to use the  
service for which the SOAP Envelope created is perfecto. However, once I call  
the function in the implementation file, the service fails and I receive the  
following exception:
 
AxisFault
faultCode:  {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString:  java.net.UnknownHostException:  locations
faultActor:
faultNode:
faultDetail:  ...
 
Here is my brief client. I would truly appreciate some help with this  
matter! You are the best!

James
 
public class adminHandlerClient2
{
static String router = "_http://localhost:8081/axis/adminDirect/_ 
(http://localhost:8081/axis/adminDirect/) ";
static String service =  "adminDirectService.wsdl";   
static String  
url="_http://localhost:8080/axis/services/adminHandlerServicePort_ (http://localhost:8080/axis/services/adminHandlerServicePort) ";

public static void  main(String[] args)
{
try
{
ServiceFactory sf =  ServiceFactory.newInstance();
URL u = new URL(router + "/" +  service);
QName  serviceName = new  QName(url,"adminHandlerService");
Service s = sf.createService(u,serviceName);
 
            QName portName = new QName(url,"adminHandlerServicePort");
 
            List handlerChain =  
s.getHandlerRegistry().getHandlerChain(portName);
HandlerInfo hi = new  HandlerInfo(LoggingHandler.class,null,null);
handlerChain.add(hi);
 
            //Checking for proper syntax of  call
if  (args.length==0)
{
System.err.println("Incorrect  usage of Client. Please use the following:");
System.err.println("adminHandlerClient" + " [Group Name]" + "    [Password]" 
+ "   [Account Name]" + "   [XML Path]"  );
}
else
{
System.out.println("Thank You. Processing. . .");
 
                 ...
 
  System.out.println("Now Initializing the  Handler.");
AdminHandler handler = (AdminHandler)  s.getPort(portName, 
AdminHandler.class);  
System.out.println("Handler Initialized.");
 
  boolean success =  false;
System.out.println("Calling Function. .  .");



<<<<!-- THIS IS THE LINE THAT CAUSES THE ERROR!  --->>>>>

  success = handler.postReport(groupName, password,  accountName, xmlData);
 
...
 

}
}
catch(Exception  e)
{
System.err.println("Error running  Client:");
e.printStackTrace();
}
}

Re: Help Diagnosing Server-Side Problems

Posted by Steve Loughran <st...@apache.org>.
NYY96@aol.com wrote:
> Hello All,
>  
> Your help is invaluable to the progress of our nation! I have a Web 
> Service I wrote with Axis running on local tomcat 8080. I wrote a client 
> to use the service for which the SOAP Envelope created is perfecto. 
> However, once I call the function in the implementation file, the 
> service fails and I receive the following exception:
>  
> AxisFault
>  faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
>  faultSubcode:
>  faultString: java.net.UnknownHostException: locations

that is the problem. Something in Axis (your code perhaps?) is throwing 
a java exception; Axis is forwarding it to the client wrapped as a 
cross-platform SOAP fault. You have just entered the world of 
distributed debugging.

1. Turn to the Global Axis configuration of the reference guide: 
http://ws.apache.org/axis/java/reference.html

2. find the switch: axis.development.system

3. modify your server WSDD file to set this flag, so that you get a 
stack trace sent back over the wire when things go wrong.

you should also get stack traces in the tomcat window, even if this flag 
is set to false, but setting this flag means it gets sent over the wire 
to the caller.

the other trick is to set a breakpoint on your classes/methods on the 
server, and see what happens when they get called.

-steve