java web服务从类中检索空列表

时间:2012-11-20 01:54:05

标签: java web-services

这是我需要申请的班级 我班上有一个静态初始化
当我运行网络方法时,我得到了例外

@WebService( serviceName = "SalesManager")

public class SalesManager {
       private static ServerListner serverLister;
       private static  Set<Client> clients;
       public static Set<Sale> sales;
       private static String status;
public SalesManager(){}
// this is the static block which should run once
static {
    ApplicationContext serverLoader = new ClassPathXmlApplicationContext("salesLoader.xml")
    clients  = new LinkedHashSet<Client>();
    sales = (Set<Sale>) serverLoader.getBean("sales");
    serverLister = (ServerListner) serverLoader.getBean("Serverlistner");
    status = "Created";  }
//this is the webmothod which I need to run
@WebMethod (operationName = "getOpenSales")
public Set<Sale>  getOpenSales (){
return SalesManager.sales; }

0 个答案:

没有答案