これは、初期化する必要がある私のクラスです。Web メソッドを実行すると
、クラスに静的な初期化があり
ます。例外が発生します。
@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; }