I've had some experience pipelining ctakes behind a servlet (not the demo servlet) and, without going deep into the code, My feeling is that there are no globally static data resources with instance level content. It's all just configuration and dictionaries. Threading errors would only occur if threads shared a CAS object. Or if one thread was trying to modify the configuration that another thread was using.
If you're looking for high performance, I would keep a small pool of instantiated CAS objects with their Annotators loaded. Then as each request comes in via a different thread, you grab a CAS off the pool, call reset on it to clean out all the annotations and then run the annotation process, output put the contents and hand it back to the pool. Obviously entrance and exit to the pool resources would have to be guarded by semaphores or another thread safe mechanism. - Peter On 2/2/17, 1:47 PM, "shahid ashraf" <sha...@trialx.com> wrote: >Thanks sean.. > >Seems it might have issue with thread safety of ctakes modules... mainly >postagger. i too am guessing :P > > >On Fri, Feb 3, 2017 at 2:46 AM, Finan, Sean < >sean.fi...@childrens.harvard.edu> wrote: > >> Hi Shahid, >> >> >> >> Just fyi, That client app is not part of ctakes or supported by the >> general ctakes community. My initial guess would be that it ran out of >> memory or had an empty or unreadable document. Again, this is a >>complete >> shot in the dark as I don¹t use that servlet and the error report has >> nothing specific with regard to ctakes. >> >> >> >> Sean >> >> >> >> *From:* shahid ashraf [mailto:sha...@trialx.com] >> *Sent:* Thursday, February 02, 2017 8:37 AM >> *To:* Finan, Sean; dev@ctakes.apache.org; Andrey Kurdumov; >> masanz.ja...@gmail.com >> *Subject:* Annotator processing failed >> >> >> >> I am using ctakes examples java servlet from here >>https://urldefense.proofpoint.com/v2/url?u=http-3A__healthnlp.github&d=Dw >>IFaQ&c=B73tqXN8Ec0ocRmZHMCntw&r=5LM1YwNyMUq7CWiSepCCsjTjwuVF4uswNF8BK5Orm >>10&m=n62PXSo5vUbtPKgTOb6r9eHOKo1b0coTcSA0ZvIfOvc&s=yxBTEl4n0E2IfwyzT99vkS >>KjRtANaj73OXm5RPPgVqw&e= . >> io/examples/ >> >><https://urldefense.proofpoint.com/v2/url?u=http-3A__healthnlp.github.io_ >>examples_&d=DwMFaQ&c=qS4goWBT7poplM69zy_3xhKwEW14JZMSdioCoppxeFU&r=fs67Gv >>lGZstTpyIisCYNYmQCP6r0bcpKGd4f7d4gTao&m=-pS4a8HsJtgy3fXJt8JmXdvd3X9gG3l5U >>R-hkoRDG0A&s=qaWZ-ReKaj42RMRONEYR2tHoDSKM2KFJT9DyzNdzNi4&e=> >> >> After processing some documents maybe 1000+ it gets this error >> >> javax.servlet.ServletException: >>org.apache.uima.analysis_engine.AnalysisEngineProcessException: >>Annotator processing failed. >> >> >>org.apache.ctakes.web.client.servlet.DemoServlet.doPost(DemoServlet.java: >>103) >> >> javax.servlet.http.HttpServlet.service(HttpServlet.java:650) >> >> javax.servlet.http.HttpServlet.service(HttpServlet.java:731) >> >> >>org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) >> >> *root cause* >> >> org.apache.uima.analysis_engine.AnalysisEngineProcessException: >>Annotator processing failed. >> >> >>org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAna >>lysisComponentProcess(PrimitiveAnalysisEngine_impl.java:412) >> >> >>org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.process >>AndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:314) >> >> >>org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.pr >>ocessUntilNextOutputCas(ASB_impl.java:570) >> >> >>org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.<i >>nit>(ASB_impl.java:412) >> >> >>org.apache.uima.analysis_engine.asb.impl.ASB_impl.process(ASB_impl.java:3 >>44) >> >> >>org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.process >>AndOutputNewCASes(AggregateAnalysisEngine_impl.java:265) >> >> >>org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.pr >>ocessUntilNextOutputCas(ASB_impl.java:570) >> >> >>org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.<i >>nit>(ASB_impl.java:412) >> >> >>org.apache.uima.analysis_engine.asb.impl.ASB_impl.process(ASB_impl.java:3 >>44) >> >> >>org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.process >>AndOutputNewCASes(AggregateAnalysisEngine_impl.java:265) >> >> >>org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(Analy >>sisEngineImplBase.java:269) >> >> >>org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(Analy >>sisEngineImplBase.java:284) >> >> >>org.apache.ctakes.web.client.servlet.DemoServlet.doPost(DemoServlet.java: >>92) >> >> javax.servlet.http.HttpServlet.service(HttpServlet.java:650) >> >> javax.servlet.http.HttpServlet.service(HttpServlet.java:731) >> >> >>org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) >> >> *root cause* >> >> java.lang.NullPointerException >> >> >> >> -- >> >> with Regards >> >> Shahid Ashraf >> > > > >-- >with Regards >Shahid Ashraf