简体   繁体   English

调用stop()时,Jcoserver状态更改为STOPPING(不是STOPPED)

[英]Jcoserver status changing to STOPPING (not STOPPED) when stop() is called

I am using SAPJco3.jar for connecting to SAP using Java. 我正在使用SAPJco3.jar使用Java连接到SAP。 However, when I am trying to stop my bridge, I get some error. 但是,当我试图停止我的桥梁时,出现一些错误。

The code for disconnection is this : 断开连接的代码是这样的:

public void tearDown() {
    log.info("tearDown() | Starting tear down ...");
    log.info("tearDown() | Stopping {} JCO servers ...", jcoServerList.size());

    System.out.printf("\ntearDown()| Stopping %s JCO servers ...", jcoServerList.size());
    System.out.println();

    for (JCoServer jcoServer : jcoServerList.values()) {
        try {

            jcoServer.stop();
            jcoServer.release();

        } catch (Exception e) {
            log.error("Failed to STOP JCO server {} e={}", jcoServer.getProgramID(), e.toString());
        }
    }

    jcoServerDataManager.clearAllData();
    jcoServerDataManager = null;

    log.info("tearDown() | Done with tear down!");
}

The error I get is this : 我得到的错误是这样的:

2018-12-06 15:00:15,504|INFO ||||||SapSessionReferenceProvider| getCurrentSessionReference() | Retrieving current session reference ...
2018-12-06 15:00:15,504|INFO ||||||SapSessionReferenceProvider| getCurrentSessionReference() | Current session reference retrieved Ok (id: sap-session-Default:Test_Bridge_With_External_Test_SAP_JCO:Y3IV_3)
2018-12-06 15:00:15,504|INFO ||||||SapSessionReferenceProvider| getCurrentSessionReference() | Retrieving current session reference ...
2018-12-06 15:00:15,504|INFO ||||||SapSessionReferenceProvider| getCurrentSessionReference() | Current session reference retrieved Ok (id: sap-session-Default:Test_Bridge_With_External_Test_SAP_JCO:Y3IV_3)
2018-12-06 15:00:15,504|ERROR||||||SapConnectionManagerImpl| clearConnectionContext() | Failed to end SAP context: {}
com.sap.conn.jco.JCoException: (132) JCO_ERROR_CONCURRENT_CALL: Concurrent call detected. Connection [13] currently used in another thread: pool-2-thread-1 [100] in execute since 7999 ms. Current thread: 22184429@qtp-6003181-5 [67], action: release.
    at com.sap.conn.jco.rt.ClientConnection.acquireBusyState(ClientConnection.java:185)
    at com.sap.conn.jco.rt.PoolingFactory.releaseClient(PoolingFactory.java:655)
    at com.sap.conn.jco.rt.ConnectionManager.releaseClient(ConnectionManager.java:234)
    at com.sap.conn.jco.rt.Context.endSequence(Context.java:497)
    at com.sap.conn.jco.rt.JCoRuntime.endSequence(JCoRuntime.java:805)
    at com.sap.conn.jco.JCoContext.end(JCoContext.java:97)
    at com.zetes.crystal.sap.io.impl.SapConnectionManagerImpl.clearConnectionContext(SapConnectionManagerImpl.java:258)
    at com.zetes.crystal.sap.io.impl.SapConnectionManagerImpl.closeSapConnection(SapConnectionManagerImpl.java:145)
    at com.zetes.crystal.sap.io.impl.SapConnectionManagerImpl.tearDown(SapConnectionManagerImpl.java:76)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:297)
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeDestroyMethods(InitDestroyAnnotationBeanPostProcessor.java:270)
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeDestruction(InitDestroyAnnotationBeanPostProcessor.java:162)
    at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:140)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:487)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:462)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:480)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:462)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:430)
    at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:853)
    at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:831)
    at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:794)
    at com.zetes.crystal.setup.server.bridges.impl.BridgeManagementServiceImpl.stopBridge(BridgeManagementServiceImpl.java:614)
    at com.zetes.crystal.setup.server.bridges.impl.BridgeManagementServiceImpl.stopBridge(BridgeManagementServiceImpl.java:340)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.gwtwidgets.server.spring.GWTRPCServiceExporter.invokeMethodOnService(GWTRPCServiceExporter.java:148)
    at org.gwtwidgets.server.spring.GWTRPCServiceExporter.processCall(GWTRPCServiceExporter.java:298)
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
    at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
    at org.gwtwidgets.server.spring.GWTRPCServiceExporter.handleRequest(GWTRPCServiceExporter.java:363)
    at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:49)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
    at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
    at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:326)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:536)
    at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:930)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405)
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
2018-12-06 15:00:15,504|INFO ||||||SapUserManagementServiceImpl| SAP user <Y3IV_3> has been released
2018-12-06 15:00:15,504|INFO ||||||SapConnectionManagerImpl| tearDown() | Done with SAP connection manager tear down!
2018-12-06 15:00:15,504|INFO ||||||JcoServerConnectionFactory| tearDown() | Starting tear down ...
2018-12-06 15:00:15,504|INFO ||||||JcoServerConnectionFactory| tearDown() | Stopping 1 JCO servers ...
2018-12-06 15:00:15,504|DEBUG||||||JcoServerConnectionFactory|  >> STATUS = ALIVE
2018-12-06 15:00:15,504|DEBUG||||||JcoServerConnectionFactory| >> Stopping JCO Server :: 3IV_ZE9_CLNT_890_001
2018-12-06 15:00:15,504|INFO ||||||JcoServerConnectionFactory| JCO Server ProgID: 3IV_ZE9_CLNT_890_001 [10]       ALIVE ->   STOPPING
2018-12-06 15:00:15,504|INFO ||||||JcoServerConnectionFactory| tearDown() | Done with tear down!
2018-12-06 15:00:15,520|INFO ||||||CockpitServiceImpl| Cockpit harvester of the bridge [Default:Test_Bridge_With_External_Test_SAP_JCO] has been un-registered from Cockpit manager
2018-12-06 15:00:15,520|INFO ||||||BridgeManagementServiceImpl| bridge [Test_Bridge_With_External_Test_SAP_JCO] from site [Default] has been stopped OK
2018-12-06 15:00:15,520|DEBUG||||||SimpleThreadPool| WorkerThread is shutting down
2018-12-06 15:00:15,520|INFO ||||||BridgeConfigurationPersiterImpl| Configuration for the bridge [Test_Bridge_With_External_Test_SAP_JCO] in site [Default] has been persisted OK
2018-12-06 15:00:15,520|DEBUG||||||BridgeManagementServiceImpl| onApplicationEvent() | begin
2018-12-06 15:00:15,536|DEBUG||||||SimpleThreadPool| WorkerThread is shutting down
2018-12-06 15:00:15,567|DEBUG||||||SimpleThreadPool| WorkerThread is shutting down
2018-12-06 15:00:15,567|DEBUG||||||SimpleThreadPool| WorkerThread is shutting down
2018-12-06 15:00:15,583|DEBUG||||||SimpleThreadPool| WorkerThread is shutting down
2018-12-06 15:00:15,676|DEBUG||||||SimpleThreadPool| WorkerThread is shutting down
2018-12-06 15:00:15,676|DEBUG||||||SimpleThreadPool| WorkerThread is shutting down
2018-12-06 15:00:15,676|DEBUG||||||SimpleThreadPool| WorkerThread is shutting down
2018-12-06 15:00:15,692|DEBUG||||||SimpleThreadPool| WorkerThread is shutting down
2018-12-06 15:00:15,739|DEBUG||||||SimpleThreadPool| WorkerThread is shutting down

When I am trying to stop the bridge, already there are some connections alive for this bridge and the status of the jcoserver changes from ALIVE -> STOPPING and it never goes to STOPPED. 当我尝试停止网桥时,此网桥已经有一些活动的连接,并且jcoserver的状态从“活动”->“停止”更改为“永不停止”。 If there are no connections attached to the server, it goes to the status STOPPED without any problem. 如果没有连接到服务器的连接,则服务器将毫无问题地进入“已停止”状态。

Could any one please provide any direction for this problem? 有人可以为这个问题提供任何方向吗? Is there any way I can forcefully stop the bridge? 有什么办法可以我强制停下来?

Thanks! 谢谢!

It seems that your custom SessionReferenceProvider implementation has a bug, namely returning the same session ID in multiple threads simultaneously. 您的自定义SessionReferenceProvider实现似乎有一个错误,即同时在多个线程中返回相同的会话ID。 Do you really need an own SessionReferenceProvider ? 您是否真的需要自己的SessionReferenceProvider Or is the default one from JCo maybe already sufficient? 还是JCo的默认值可能已经足够了? Maybe you can test your scenario without registering your own SessionReferenceProvider instance and see if it works. 也许您可以在不注册自己的SessionReferenceProvider实例的情况下测试您的方案,然后查看它是否有效。

And if not already using the latest JCo patch level, I would also recommend to update it in order to exclude already fixed bugs in JCo regarding this. 而且,如果尚未使用最新的JCo补丁程序级别,我还建议对其进行更新,以排除JCo中与此相关的已修复错误。 SAP has just released JCo 3.0.19. SAP刚刚发布了JCo 3.0.19。 See https://support.sap.com/jco . 请参阅https://support.sap.com/jco

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM