1

this is my class whic I need to init
there is a static init on my class
when I run the web method I am getting an exception

@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 Answers0