Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
How do we close Livelink Session Object with LAPI?
David_Benjamin
We have developed a J2ee application which uses LAPI to connect to the Livelink Server for creating a folder hierarchy and sets appropriate permissions on the folders. The j2ee app is deployed on a Websphere application server which is hosted on a AIX box. The issue that we are facing is when multiple users try to access the application, a SocketClosed Exception is thrown from the Livelink Server.We get this exception in the System.err on the Websphere server. On the application logs, we see a Unknown Event Id 1 and Unknown Event Id 2. The application stops to work and the only way we can get the app to work again is restart the app server instance on the Websphere server. This opens up all the sockets again. Opentext recommended that we need to increase the ephermal port range on the Websphere server ( basically the operating system ) and reduce the Time_out parameter to 30 secs from a 240 sec default.Has anyone encountered this issue before? Do you think that this might be related to Livelink session object not being closed for every transaction a user makes? There is no function in LAPI to close a session object. The documentation says that the session object is garbage collected when LAPI is used with Java. I strongly suspect this is the reason for the issue. I am closing all the Livelink database objects (resultsets, statement objects) except the Livelink Session object.Please suggest.
Find more posts tagged with
Comments
eLink User
Message from Carsten Kulms via eLinkIt is correct that there is no need to close a session when usingJava-LAPI. Can you please provide the exception and the stacktrace (only the partwhere com.opentext... classes are involved). Also usually aSocketException has a meaningfull message set.Additionally you may check the status of tcp/ip connections (at OSlevel) when the application hangs.
David_Benjamin
Thanks! for your reply Carsten.Here is the stack trace [10/6/06 12:59:40:753 EDT] 5aa24711 SystemErr R java.net.SocketException: Socket closed[10/6/06 12:59:40:754 EDT] 5aa24711 SystemErr R at java.net.SocketInputStream.socketRead0(Native Method)[10/6/06 12:59:40:754 EDT] 5aa24711 SystemErr R at java.net.SocketInputStream.read(SocketInputStream.java(Compiled Code))[10/6/06 12:59:40:754 EDT] 5aa24711 SystemErr R at java.io.BufferedInputStream.fill(BufferedInputStream.java(Compiled Code))[10/6/06 12:59:40:754 EDT] 5aa24711 SystemErr R at java.io.BufferedInputStream.read(BufferedInputStream.java(Compiled Code))[10/6/06 12:59:40:754 EDT] 5aa24711 SystemErr R at java.io.FilterInputStream.read(FilterInputStream.java(Inlined Compiled Code))[10/6/06 12:59:40:754 EDT] 5aa24711 SystemErr R at java.io.PushbackInputStream.read(PushbackInputStream.java(Compiled Code))[10/6/06 12:59:40:754 EDT] 5aa24711 SystemErr R at java.io.FilterInputStream.read(FilterInputStream.java(Compiled Code))[10/6/06 12:59:40:754 EDT] 5aa24711 SystemErr R at com.opentext.api.LLValue.crack(LLValue.java:1536)[10/6/06 12:59:40:754 EDT] 5aa24711 SystemErr R at com.opentext.api.LLInputStream.readValue(LLInputStream.java:68)[10/6/06 12:59:40:755 EDT] 5aa24711 SystemErr R at com.opentext.api.LLConnect.crackInputStream(LLConnect.java:1227)[10/6/06 12:59:40:755 EDT] 5aa24711 SystemErr R at com.opentext.api.LLConnect.executeTraditional(LLConnect.java:1522)[10/6/06 12:59:40:755 EDT] 5aa24711 SystemErr R at com.opentext.api.LLConnect.execute(LLConnect.java:341)[10/6/06 12:59:40:755 EDT] 5aa24711 SystemErr R at com.opentext.api.LAPI_DOCUMENTS.CopyObject(LAPI_DOCUMENTS.java:270)[10/6/06 12:59:40:755 EDT] 5aa24711 SystemErr R at com.metlife.policy.business.FolderCopy.copyFolder(FolderCopy.java:145)[10/6/06 12:59:40:755 EDT] 5aa24711 SystemErr R at com.metlife.policy.business.ProcessPolicy.start(ProcessPolicy.java:59)[10/6/06 12:59:40:755 EDT] 5aa24711 SystemErr R at com.metlife.policy.controllers.PolicyController.doProcess(PolicyController.java:47)[10/6/06 12:59:40:755 EDT] 5aa24711 SystemErr R at com.metlife.policy.controllers.BaseController.doPost(BaseController.java:54)[10/6/06 12:59:40:755 EDT] 5aa24711 SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)[10/6/06 12:59:40:755 EDT] 5aa24711 SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))[10/6/06 12:59:40:755 EDT] 5aa24711 SystemErr R at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java(Compiled Code))[10/6/06 12:59:40:756 EDT] 5aa24711 SystemErr R at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled Code))[10/6/06 12:59:40:756 EDT] 5aa24711 SystemErr R at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java(Compiled Code))[10/6/06 12:59:40:756 EDT] 5aa24711 SystemErr R at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Inlined Compiled Code))[10/6/06 12:59:40:756 EDT] 5aa24711 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java(Compiled Code))[10/6/06 12:59:40:756 EDT] 5aa24711 SystemErr R at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java(Compiled Code))[10/6/06 12:59:40:756 EDT] 5aa24711 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java(Inlined Compiled Code))[10/6/06 12:59:40:756 EDT] 5aa24711 SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled Code))[10/6/06 12:59:40:756 EDT] 5aa24711 SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))[10/6/06 12:59:40:756 EDT] 5aa24711 SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled Code))[10/6/06 12:59:40:756 EDT] 5aa24711 SystemErr R at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java(Compiled Code))[10/6/06 12:59:40:756 EDT] 5aa24711 SystemErr R at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java(Compiled Code))[10/6/06 12:59:40:757 EDT] 5aa24711 SystemErr R at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java(Compiled Code))[10/6/06 12:59:40:757 EDT] 5aa24711 SystemErr R at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java(Compiled Code))[10/6/06 12:59:40:757 EDT] 5aa24711 SystemErr R at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java(Compiled Code))[10/6/06 12:59:40:757 EDT] 5aa24711 SystemErr R at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java(Compiled Code))[10/6/06 12:59:40:757 EDT] 5aa24711 SystemErr R at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java(Compiled Code))[10/6/06 12:59:40:757 EDT] 5aa24711 SystemErr R at com.ibm.ws.http.HttpConnection.run(HttpConnection.java(Compiled Code))[10/6/06 12:59:40:757 EDT] 5aa24711 SystemErr R at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))[10/6/06 12:59:40:757 EDT] 6a894712 SystemErr R java.net.SocketException: Socket closed[10/6/06 12:59:40:758 EDT] 6a894712 SystemErr R at java.net.SocketInputStream.socketRead0(Native Method)[10/6/06 12:59:40:758 EDT] 6a894712 SystemErr R at java.net.SocketInputStream.read(SocketInputStream.java(Compiled Code))[10/6/06 12:59:40:758 EDT] 6a894712 SystemErr R at java.io.BufferedInputStream.fill(BufferedInputStream.java(Compiled Code))[10/6/06 12:59:40:758 EDT] 6a894712 SystemErr R at java.io.BufferedInputStream.read(BufferedInputStream.java(Compiled Code))[10/6/06 12:59:40:758 EDT] 6a894712 SystemErr R at java.io.FilterInputStream.read(FilterInputStream.java(Inlined Compiled Code))[10/6/06 12:59:40:758 EDT] 6a894712 SystemErr R at java.io.PushbackInputStream.read(PushbackInputStream.java(Compiled Code))[10/6/06 12:59:40:758 EDT] 6a894712 SystemErr R at java.io.FilterInputStream.read(FilterInputStream.java(Compiled Code))[10/6/06 12:59:40:758 EDT] 6a894712 SystemErr R at com.opentext.api.LLValue.crack(LLValue.java:1536)[10/6/06 12:59:40:758 EDT] 6a894712 SystemErr R at com.opentext.api.LLInputStream.readValue(LLInputStream.java:68)[10/6/06 12:59:40:759 EDT] 6a894712 SystemErr R at com.opentext.api.LLConnect.crackInputStream(LLConnect.java:1227)[10/6/06 12:59:40:759 EDT] 6a894712 SystemErr R at com.opentext.api.LLConnect.executeTraditional(LLConnect.java:1522)[10/6/06 12:59:40:759 EDT] 6a894712 SystemErr R at com.opentext.api.LLConnect.execute(LLConnect.java:341)[10/6/06 12:59:40:759 EDT] 6a894712 SystemErr R at com.opentext.api.LAPI_DOCUMENTS.CopyObject(LAPI_DOCUMENTS.java:270)[10/6/06 12:59:40:759 EDT] 6a894712 SystemErr R at com.metlife.policy.business.FolderCopy.copyFolder(FolderCopy.java:145)[10/6/06 12:59:40:759 EDT] 6a894712 SystemErr R at com.metlife.policy.business.ProcessPolicy.start(ProcessPolicy.java:59)[10/6/06 12:59:40:761 EDT] 6a894712 SystemErr R at com.metlife.policy.controllers.PolicyController.doProcess(PolicyController.java:47)[10/6/06 12:59:40:761 EDT] 6a894712 SystemErr R at com.metlife.policy.controllers.BaseController.doPost(BaseController.java:54)[10/6/06 12:59:40:761 EDT] 6a894712 SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)[10/6/06 12:59:40:761 EDT] 6a894712 SystemErr R at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))[10/6/06 12:59:40:761 EDT] 6a894712 SystemErr R at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java(Compiled Code))[10/6/06 12:59:40:761 EDT] 6a894712 SystemErr R at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled Code))[10/6/06 12:59:40:761 EDT] 6a894712 SystemErr R at com.ibm.ws.webcontainer.servlet.ServicingServletState.service(StrictLifecycleServlet.java:333)[10/6/06 12:59:40:761 EDT] 6a894712 SystemErr R at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Inlined Compiled Code))[10/6/06 12:59:40:761 EDT] 6a894712 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java(Compiled Code))[10/6/06 12:59:40:761 EDT] 6a894712 SystemErr R at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java(Compiled Code))[10/6/06 12:59:40:761 EDT] 6a894712 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java(Inlined Compiled Code))[10/6/06 12:59:40:762 EDT] 6a894712 SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled Code))[10/6/06 12:59:40:762 EDT] 6a894712 SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))[10/6/06 12:59:40:762 EDT] 6a894712 SystemErr R at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled Code))[10/6/06 12:59:40:762 EDT] 6a894712 SystemErr R at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java(Compiled Code))[10/6/06 12:59:40:762 EDT] 6a894712 SystemErr R at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java(Compiled Code))[10/6/06 12:59:40:762 EDT] 6a894712 SystemErr R at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java(Compiled Code))[10/6/06 12:59:40:762 EDT] 6a894712 SystemErr R at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java(Compiled Code))[10/6/06 12:59:40:762 EDT] 6a894712 SystemErr R at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java(Compiled Code))[10/6/06 12:59:40:762 EDT] 6a894712 SystemErr R at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java(Compiled Code))[10/6/06 12:59:40:762 EDT] 6a894712 SystemErr R at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java(Compiled Code))[10/6/06 12:59:40:762 EDT] 6a894712 SystemErr R at com.ibm.ws.http.HttpConnection.run(HttpConnection.java(Compiled Code))[10/6/06 12:59:40:762 EDT] 6a894712 SystemErr R at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
eLink User
Message from Carsten Kulms via eLinkFor me it looks like the connection to the LES was successfullyestablished, but the socket is closed before the response can be read.Therefore I don't think this is the "number of free port numbers" issue.Unfortunately there are many possible causes. I suggest to check the logfiles of the LES and the network status on both machines: The one wherethe LES runs and the one on which the LAPI client runs (when theapplication hangs).Maybe you should open a support ticket on this issue. (Please provide asmuch details as possible. E.g. the stacktrace and network statusreports.)
David_Benjamin
We have already opened a ticket with Opentext a couple months back. As you said, the recommendation of "increasing the number of ephermal ports" did not resolve this issue. We have sent all the stack trace and logs to Opentext. The ticket we opened was 131745.
eLink User
Message from Carsten Kulms via eLinkI've looked in the support ticket. It was closed because the requestedlogs were never send.So please activate detailed logging of the Livelink Server (LivelinkAdministration / Configure Server Parameters / Livelink logging:Detailed thread logging) and then reproduce the problem. Please send _all_ Livelink server logs, a full Livelink system report(Livelink Administration / System Report) and current "netstat"information to OT Support. (I think you can reopen the ticket.)Please also provide a more detailed description what the applicationdoes by LAPI ("for creating a folder hierarchy and sets appropriatepermissions on the folders"; by the stacktrace it can be seen that anobject is copied -- I guess a complete folder structure. How deep is it?Are any special objects like projects, tasks, ... contained therein?)And: What exactly means "multiple users" -- is there a limit (approx.)for the number of users which can use the application concurrentlywithout error?
David_Benjamin
We had Ftped the LL logs on 09/15/2006 to Opentext with reference to ticket 131745.When i opened the ticket i was working with Roger Duplin, but later we worked with Raymond Boudreau. Each user transaction creates a folder and copies a folder hierarchy 39 folders deep. There are no other LL objects except folders. There are around 70 concurrent users for this application. The problem i think is related to the way a LL session object is maintained on a LL server. Each user creates a new LL session object and then proceeds with a transaction. But when multiple users access the application, we get a socket exception. This results in creation of incomplete folder hierarchy and failure to set permissions.Each user request in this handled by a servlet. When i synchronize the doProcess method of servlet, concurrent transactions work, but the performance goes down as transaction processing becomes sequential,and not simaltaneous. I am eager to know how best can a LL session be synchronized so that each user works with the session object until the end of the transaction.I went through the LL API documentation to see if there is any LLSession.getinstance or any method similar to it but could not find one.I believe if there is a way to synchronize the session object, this problem can be resolved.
eLink User
Message from Carsten Kulms via eLinkMaybe I failed to understand you correctly, but it sounds to me as ifyou use a single LLSession instance in the servlet across all requestsserved by the servlet. That cannot work: LLSession is not threadsafe.You have to create a new LLSession instance in the processing of eachrequest. Of course you can use the same LLSession instance multipletimes, but only in a single thread.Since LLSession merely wraps the connection parameters and credentialsfor the LAPI calls it is not expensive to create many of such objects(and left them to gc after usage).I know that this restriction is not clearly noticed in the LL APIdocumentation and apologize for that.
David_Benjamin
I am creating a new LLSession instance for each request. But i think the sessions are not managed properly on the LL server. I am not sure then what is going wrong since my code has everything that you are expecting.
eLink User
Message from Carsten Kulms via eLinkThis may require that the problem can be reproduced by OT support. Forthis it would be great if you could extract the LAPI code in questionfrom the servlet, building a small standalone LAPI application whichreproduces the error. Please then send that `demo` to OT support. (Afaikthe corresponding case has been reactivated.)