日期:2014-05-20 浏览次数:20801 次
static class WebServiceHolder
{
static ImplService instance = new ImplService(WSDL_LOCATION, SERVICE);
}
public static ImplService getInstance() throws Exception{
try
{
return WebServiceHolder.instance;
}
catch(Exception e)
{
throw e;
}
}
catch(Exception e)
{
System.out.println(“XXXXX”);
throw e;
}
------解决方案--------------------
悲剧,没仔细看你的代码。
你的初始化是在静态块里面做的:
static ImplService instance = new ImplService(WSDL_LOCATION, SERVICE);
有错直接就这里已经出错了。
而getInstance只不过是返回值,当然不可能会出错。
------解决方案--------------------