Добрый день, Подскажите пожалуйста. Выходит ошибка при удалении контракта в скрипте. Что может быть ?
Код:
public String deleteContract(int contractId){
Connection con = null;
try{
ServerContext context = ServerContext.get();
if (context == null){
System.out.println("server context == null !!! ");
}
ru.bitel.common.sql.ConnectionSet connectionSet = context.getConnectionSet();
con = connectionSet.getConnection();
ContractRemover contractRemover = new ContractRemover(con, "/");
if (contractRemover == null){
System.out.println("contractStatusService == null !!! ");
}else{
String result = contractRemover.removeContract(contractId, false);
System.out.println("------------------------------------------------------------------");
if (!con.getAutoCommit())
con.commit();
System.out.println("------------------------------------------------------------------");
System.out.println(result);
return result;
}
} catch(Exception ex){
ex.printStackTrace();
return ex.getMessage();
}finally{
try{
con.close();
}catch(Exception ex){
System.out.println("Не удалось закрыть соединение Connection");
}
}
return null;
}
Код:
04-10/19:55:10 INFO [http-nio-0.0.0.0-79-exec-9] CommonKernelEventProcessor - Process event cid:38498; event:Event[ru.bitel.bgbilling.kernel.event.events.system.ContractDeleteEvent] moduleId: 0; pluginId: no; cid: 38498; scid: -1; userId: 0; timestamp: 1681145710586
04-10/19:55:10 INFO [http-nio-0.0.0.0-79-exec-9] CommonKernelEventProcessor - Process event cid:38498; event:Event[ru.bitel.bgbilling.kernel.event.events.system.ContractDeleteEvent] moduleId: 0; pluginId: no; cid: 38498; scid: -1; userId: 0; timestamp: 1681145710590
04-10/19:55:10 INFO [http-nio-0.0.0.0-79-exec-9] LoggingPrintStream - ------------------------------------------------------------------
04-10/19:55:10 INFO [http-nio-0.0.0.0-79-exec-9] LoggingPrintStream - ------------------------------------------------------------------
04-10/19:55:10 INFO [http-nio-0.0.0.0-79-exec-9] LoggingPrintStream -
04-10/19:55:10 ERROR [http-nio-0.0.0.0-79-exec-9] AbstractJaxWsHandler -
java.lang.reflect.InvocationTargetException
at ru.bitel.bgbilling.kernel.container.service.server.ServiceInfo.invoke(ServiceInfo.java:118)
at ru.bitel.bgbilling.kernel.container.ws.server.AbstractJaxWsHandler.invoke0(AbstractJaxWsHandler.java:265)
at ru.bitel.bgbilling.kernel.container.ws.server.AbstractJaxWsHandler.access$000(AbstractJaxWsHandler.java:52)
at ru.bitel.bgbilling.kernel.container.ws.server.AbstractJaxWsHandler$3.run(AbstractJaxWsHandler.java:312)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at ru.bitel.bgbilling.kernel.container.ws.server.AbstractJaxWsHandler.invoke(AbstractJaxWsHandler.java:306)
at ru.bitel.bgbilling.kernel.container.ws.server.JaxWsHandler.invoke(JaxWsHandler.java:312)
at ru.bitel.bgbilling.kernel.container.ws.server.AbstractJaxWsHandler$ServiceInstanceResolver$1.invoke(AbstractJaxWsHandler.java:411)
at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:119)
at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:58)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:1106)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:1020)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:989)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:847)
at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:389)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:838)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:392)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:139)
at ru.bitel.bgbilling.kernel.container.ws.server.JaxWSAdapter.handle(JaxWSAdapter.java:303)
at ru.bitel.bgbilling.kernel.base.server.servlet.Executer.doPost(Executer.java:184)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:624)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: ru.bitel.bgbilling.common.BGException: java.sql.SQLException: Connection is closed.
at ru.bitel.common.sql.ConnectionSet.commit(ConnectionSet.java:234)
at ru.bitel.bgbilling.kernel.container.managed.ServerContext.commit(ServerContext.java:288)
at ru.bitel.bgbilling.kernel.container.service.server.ServiceInfo.invoke(ServiceInfo.java:103)
... 40 more
Caused by: java.sql.SQLException: Connection is closed.
at ru.bitel.bgbilling.server.dbcp.PoolGuardConnectionWrapper.checkOpen(PoolGuardConnectionWrapper.java:39)
at ru.bitel.bgbilling.server.dbcp.PoolGuardConnectionWrapper.getAutoCommit(PoolGuardConnectionWrapper.java:94)
at ru.bitel.common.sql.ConnectionSet.commit(ConnectionSet.java:209)
... 42 more