You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by shahid ashraf <sh...@trialx.com> on 2017/02/09 18:42:52 UTC

CAS Pool

Hi Folks

This is my first mail to the mailing list. I have just started looking into
the uima architecture. Currently i am trying few things in ctakes. I need
to use the JCAS pool for multithreading.
https://uima.apache.org/d/uimaj-current/tutorials_and_users_guides.html#ugr.tug.applications.multi_threaded
I need to know the equivalent of the following while using programmable
bluider AE(org.apache.uima.fit.factory.AggregateBuilder;)

mAnalysisEngine = UIMAFramework.produceAnalysisEngine(specifier,3,0);

Currently i am building aggregate AE like this ... in which i need to set
the property/field to 3 like in above.

*In other words the questions is how to use the cas object pool for
multiprocessing iusing programmable interface(AggregrateBuilder) instead of
descriptor file approach.*

-- 
with Regards
Shahid Ashraf

Re: CAS Pool

Posted by Marshall Schor <ms...@schor.com>.
Given this, it seems likely the difference is due to either:

- a difference in how the initial CASs are populated
- some issue with cTakes running in the mode of multiple pipelines - perhaps it
isn't designed to operated this way.

For instance, (for the 2nd reason above), it looks like the lvg code calls some
utility provided by a 3rd party.  That utility might not support being called on
multiple threads, concurrently.

-Marshall


On 2/12/2017 1:28 AM, shahid ashraf wrote:
> hi Marshall
>
> Thanks for you time. Yes i too reached to the line you pointed out ... Here
> is my analysis and Questions ... (forgive me if ask mediocre questions. i
> am a newbie to UIMA, Ctakes n Java :) )
>
> *String[] output = out.split("\\|");*
>
> *but issue seems *
>
> String out = lvgCmd.MutateToString(word);
>
> returns null
>
> This only happens when running the LVG via CAS pool( 4 threads ).
>
> My caspool
>
> pipeline = UIMAFramework.produceAnalysisEngine(specifier, 2, 0);
>
>  caspool = new CasPool(2, pipeline);
>
> My Question is why this happens in CAS pool (where each CAS has its own
> resource.)
>
> and seems it happens on even ... normal words ... but when testing these
> words one by one on same code (with cas pool) String out = lvgCmd
> .MutateToString(word); it returns back the canonical form
>
>
> Here is the log when
>
> String out = lvgCmd.MutateToString(word) *FAILS*
>
> WARN LvgAnnotator - mutateToString returned null for: anemia
>
> 12 Feb 2017 11:20:32  WARN LvgAnnotator - mutateToString returned null for:
> remained
>
> 12 Feb 2017 11:20:28  WARN LvgAnnotator - mutateToString returned null for:
> course
>
> 12 Feb 2017 11:20:28  WARN LvgAnnotator - mutateToString returned null for:
> profile.
>
> 12 Feb 2017 11:20:28  WARN LvgAnnotator - mutateToString returned null for:
> a
>
> 12 Feb 2017 11:20:25  WARN LvgAnnotator - mutateToString returned null for:
> pre-specified
>
> 12 Feb 2017 11:20:25  WARN LvgAnnotator - mutateToString returned null for:
> these
>
> 12 Feb 2017 11:20:25  WARN LvgAnnotator - mutateToString returned null for:
> inhibitors
>
> 12 Feb 2017 11:20:22  WARN LvgAnnotator - mutateToString returned null for:
> Many
>
> 12 Feb 2017 11:20:20  WARN LvgAnnotator - mutateToString returned null for:
> if
>
> 12 Feb 2017 11:20:15  WARN LvgAnnotator - mutateToString returned null for:
> third
>
> 12 Feb 2017 11:20:12  WARN LvgAnnotator - mutateToString returned null for:
> Prolonged
>
> When trying these on same code ... but single thread ... we are getting
> results from LVG...
>
>
> 12 Feb 2017 11:49:32  INFO LvgAnnotator - process(JCas)
>
> 12 Feb 2017 11:49:32  INFO LvgAnnotator - annotate over full doc text
>
> 12 Feb 2017 11:49:32  INFO LvgAnnotator - apply LVG processing to get
> canonical form
>
> 12 Feb 2017 11:49:32  INFO LvgAnnotator - canonicalForm == null:
> anemia|anemia|1|1|l+b|1|
>
> anemia|anemia|2|1|l+b|1|
>
> anemia|anemia|128|1|l+b|1|
>
> anemia|anemia|1024|1|l+b|1|
>
> anemia|anemion|128|512|l+b|1|
>
> anemia|anemium|128|512|l+b|1|
>
>
> 12 Feb 2017 11:49:32  INFO LvgAnnotator - apply LVG processing to get
> canonical form
>
> 12 Feb 2017 11:49:32  INFO LvgAnnotator - canonicalForm == null:
> placebo|placebo|1|1|l+b|1|
>
> placebo|placebo|2|1|l+b|1|
>
> placebo|placebo|128|1|l+b|1|
>
> placebo|placebo|1024|1|l+b|1|
>
>
> 12 Feb 2017 11:49:32  INFO LvgAnnotator - apply LVG processing to get
> canonical form
>
> 12 Feb 2017 11:49:32  INFO LvgAnnotator - canonicalForm == null:
> Prolonged|prolong|1024|1024|l+b|1|
>
> Prolonged|prolonge|1024|1024|l+b|1|
>
> Prolonged|prolonged|1|1|l+b|1|
>
> Prolonged|prolonged|2|1|l+b|1|
>
> Prolonged|prolonged|128|1|l+b|1|
>
> Prolonged|prolonged|1024|1|l+b|1|
>
> Prolonged|prolongeed|1024|1024|l+b|1|
>
>
> 12 Feb 2017 11:49:32  INFO LvgAnnotator - apply LVG processing to get
> canonical form
>
> 12 Feb 2017 11:49:32  INFO LvgAnnotator - canonicalForm == null:
> third|third|1|1|l+b|1|
>
> third|third|2|1|l+b|1|
>
> third|third|128|1|l+b|1|
>
> third|third|1024|1|l+b|1|
>
>
> 12 Feb 2017 11:49:32  INFO LvgAnnotator - apply LVG processing to get
> canonical form
>
> 12 Feb 2017 11:49:32  INFO LvgAnnotator - canonicalForm == null:
> inhibitors|inhibitor|128|512|l+b|1|
>
> inhibitors|inhibitor|1024|1024|l+b|1|
>
> inhibitors|inhibitors|1|1|l+b|1|
>
> inhibitors|inhibitors|2|1|l+b|1|
>
> inhibitors|inhibitors|128|1|l+b|1|
>
> inhibitors|inhibitors|1024|1|l+b|1|
>
>
> 12 Feb 2017 11:49:32  INFO LvgAnnotator - apply LVG processing to get
> canonical form
>
> 12 Feb 2017 11:49:32  INFO LvgAnnotator - canonicalForm == null:
> these|these|1|1|l+b|1|
>
> these|these|2|1|l+b|1|
>
> these|these|128|1|l+b|1|
>
> these|these|1024|1|l+b|1|
>
>
> 12 Feb 2017 11:49:32  INFO LvgAnnotator - apply LVG processing to get
> canonical form
>
> 12 Feb 2017 11:49:32  INFO LvgAnnotator - canonicalForm == null:
> pre-specified|pre-specifi|1024|1024|l+b|1|
>
> pre-specified|pre-specifie|1024|1024|l+b|1|
>
> pre-specified|pre-specified|1|1|l+b|1|
>
> pre-specified|pre-specified|2|1|l+b|1|
>
> pre-specified|pre-specified|128|1|l+b|1|
>
> pre-specified|pre-specified|1024|1|l+b|1|
>
> pre-specified|pre-specifieed|1024|1024|l+b|1|
>
> pre-specified|pre-specify|1024|1024|l+b|1|
>
>
> 12 Feb 2017 11:49:32  INFO LvgAnnotator - apply LVG processing to get
> canonical form
>
> 12 Feb 2017 11:49:32  INFO LvgAnnotator - canonicalForm == null:
> profile.|profile.|1|1|l+b|1|
>
> profile.|profile.|2|1|l+b|1|
>
> profile.|profile.|128|1|l+b|1|
>
> profile.|profile.|1024|1|l+b|1|
>
>
> 12 Feb 2017 11:49:32  INFO LvgAnnotator - apply LVG processing to get
> canonical form
>
> 12 Feb 2017 11:49:32  INFO LvgAnnotator - canonicalForm == null:
> course|course|1|1|l+b|1|
>
> course|course|2|1|l+b|1|
>
> course|course|128|1|l+b|1|
>
> course|course|1024|1|l+b|1|
>
>
> 12 Feb 2017 11:49:32  INFO LvgAnnotator - apply LVG processing to get
> canonical form
>
> 12 Feb 2017 11:49:32  INFO LvgAnnotator - canonicalForm == null:
> remained|remain|1024|1024|l+b|1|
>
> remained|remaine|1024|1024|l+b|1|
>
> remained|remained|1|1|l+b|1|
>
> remained|remained|2|1|l+b|1|
>
> remained|remained|128|1|l+b|1|
>
> remained|remained|1024|1|l+b|1|
>
> remained|remaineed|1024|1024|l+b|1|
>
>
> On Sun, Feb 12, 2017 at 8:05 AM, Marshall Schor <ms...@schor.com> wrote:
>
>> Hi,
>>
>> Thanks for posting the release and the cause of the NullPointerException.
>>
>> The release looks to be a not-yet-released version of the development
>> currently
>> being done for the next version of cTakes.  I looked at the current "trunk"
>> version for that module in SVN.
>>
>> I can't be sure (because you are running with a -SNAPSHOT which gets
>> replaced
>> all the time as development occurs on the Trunk), but if the code in SVN
>> matches
>> what you're running, then the problem is on this line:
>>
>> String[] output = out.split("\\|");
>>
>> Getting a NullPointerException happens if "out" is null.
>>
>> "out" is set in the previous line:
>>
>> String out = lvgCmd.MutateToString(word);
>>
>> I don't know about cTakes code, so you should best take up this analysis
>> further
>> with them, to try and see why the MutateToString returned a null result.
>> Please ask your question on the cTakes mailing list.  At this point UIMA
>> is only
>> reporting the error that occurred there.
>>
>> -Marshall
>>
>>
>> On 2/11/2017 12:58 AM, shahid ashraf wrote:
>>
>> ctakes.version>3.2.3-SNAPSHOT</ctakes.version>
>>
>>
>> On Sat, Feb 11, 2017 at 4:24 AM, Marshall Schor <msa@schor.com
>> <ma...@schor.com>> wrote:
>>
>> Thanks!
>>
>> It says the NullPointerException occurred in
>>
>> org.apache.ctakes.lvg.ae <http://org.apache.ctakes.lvg.ae>.
>> LvgAnnotator.setCanonicalForm(LvgAnnotator.java:365)
>>
>> In the current version of cTakes, this is a blank line :-)
>>
>> So, can you tell me the exact version of cTakes you are running?
>> -Marshall
>>
>
>


Re: CAS Pool

Posted by shahid ashraf <sh...@trialx.com>.
hi Marshall

Thanks for you time. Yes i too reached to the line you pointed out ... Here
is my analysis and Questions ... (forgive me if ask mediocre questions. i
am a newbie to UIMA, Ctakes n Java :) )

*String[] output = out.split("\\|");*

*but issue seems *

String out = lvgCmd.MutateToString(word);

returns null

This only happens when running the LVG via CAS pool( 4 threads ).

My caspool

pipeline = UIMAFramework.produceAnalysisEngine(specifier, 2, 0);

 caspool = new CasPool(2, pipeline);

My Question is why this happens in CAS pool (where each CAS has its own
resource.)

and seems it happens on even ... normal words ... but when testing these
words one by one on same code (with cas pool) String out = lvgCmd
.MutateToString(word); it returns back the canonical form


Here is the log when

String out = lvgCmd.MutateToString(word) *FAILS*

WARN LvgAnnotator - mutateToString returned null for: anemia

12 Feb 2017 11:20:32  WARN LvgAnnotator - mutateToString returned null for:
remained

12 Feb 2017 11:20:28  WARN LvgAnnotator - mutateToString returned null for:
course

12 Feb 2017 11:20:28  WARN LvgAnnotator - mutateToString returned null for:
profile.

12 Feb 2017 11:20:28  WARN LvgAnnotator - mutateToString returned null for:
a

12 Feb 2017 11:20:25  WARN LvgAnnotator - mutateToString returned null for:
pre-specified

12 Feb 2017 11:20:25  WARN LvgAnnotator - mutateToString returned null for:
these

12 Feb 2017 11:20:25  WARN LvgAnnotator - mutateToString returned null for:
inhibitors

12 Feb 2017 11:20:22  WARN LvgAnnotator - mutateToString returned null for:
Many

12 Feb 2017 11:20:20  WARN LvgAnnotator - mutateToString returned null for:
if

12 Feb 2017 11:20:15  WARN LvgAnnotator - mutateToString returned null for:
third

12 Feb 2017 11:20:12  WARN LvgAnnotator - mutateToString returned null for:
Prolonged

When trying these on same code ... but single thread ... we are getting
results from LVG...


12 Feb 2017 11:49:32  INFO LvgAnnotator - process(JCas)

12 Feb 2017 11:49:32  INFO LvgAnnotator - annotate over full doc text

12 Feb 2017 11:49:32  INFO LvgAnnotator - apply LVG processing to get
canonical form

12 Feb 2017 11:49:32  INFO LvgAnnotator - canonicalForm == null:
anemia|anemia|1|1|l+b|1|

anemia|anemia|2|1|l+b|1|

anemia|anemia|128|1|l+b|1|

anemia|anemia|1024|1|l+b|1|

anemia|anemion|128|512|l+b|1|

anemia|anemium|128|512|l+b|1|


12 Feb 2017 11:49:32  INFO LvgAnnotator - apply LVG processing to get
canonical form

12 Feb 2017 11:49:32  INFO LvgAnnotator - canonicalForm == null:
placebo|placebo|1|1|l+b|1|

placebo|placebo|2|1|l+b|1|

placebo|placebo|128|1|l+b|1|

placebo|placebo|1024|1|l+b|1|


12 Feb 2017 11:49:32  INFO LvgAnnotator - apply LVG processing to get
canonical form

12 Feb 2017 11:49:32  INFO LvgAnnotator - canonicalForm == null:
Prolonged|prolong|1024|1024|l+b|1|

Prolonged|prolonge|1024|1024|l+b|1|

Prolonged|prolonged|1|1|l+b|1|

Prolonged|prolonged|2|1|l+b|1|

Prolonged|prolonged|128|1|l+b|1|

Prolonged|prolonged|1024|1|l+b|1|

Prolonged|prolongeed|1024|1024|l+b|1|


12 Feb 2017 11:49:32  INFO LvgAnnotator - apply LVG processing to get
canonical form

12 Feb 2017 11:49:32  INFO LvgAnnotator - canonicalForm == null:
third|third|1|1|l+b|1|

third|third|2|1|l+b|1|

third|third|128|1|l+b|1|

third|third|1024|1|l+b|1|


12 Feb 2017 11:49:32  INFO LvgAnnotator - apply LVG processing to get
canonical form

12 Feb 2017 11:49:32  INFO LvgAnnotator - canonicalForm == null:
inhibitors|inhibitor|128|512|l+b|1|

inhibitors|inhibitor|1024|1024|l+b|1|

inhibitors|inhibitors|1|1|l+b|1|

inhibitors|inhibitors|2|1|l+b|1|

inhibitors|inhibitors|128|1|l+b|1|

inhibitors|inhibitors|1024|1|l+b|1|


12 Feb 2017 11:49:32  INFO LvgAnnotator - apply LVG processing to get
canonical form

12 Feb 2017 11:49:32  INFO LvgAnnotator - canonicalForm == null:
these|these|1|1|l+b|1|

these|these|2|1|l+b|1|

these|these|128|1|l+b|1|

these|these|1024|1|l+b|1|


12 Feb 2017 11:49:32  INFO LvgAnnotator - apply LVG processing to get
canonical form

12 Feb 2017 11:49:32  INFO LvgAnnotator - canonicalForm == null:
pre-specified|pre-specifi|1024|1024|l+b|1|

pre-specified|pre-specifie|1024|1024|l+b|1|

pre-specified|pre-specified|1|1|l+b|1|

pre-specified|pre-specified|2|1|l+b|1|

pre-specified|pre-specified|128|1|l+b|1|

pre-specified|pre-specified|1024|1|l+b|1|

pre-specified|pre-specifieed|1024|1024|l+b|1|

pre-specified|pre-specify|1024|1024|l+b|1|


12 Feb 2017 11:49:32  INFO LvgAnnotator - apply LVG processing to get
canonical form

12 Feb 2017 11:49:32  INFO LvgAnnotator - canonicalForm == null:
profile.|profile.|1|1|l+b|1|

profile.|profile.|2|1|l+b|1|

profile.|profile.|128|1|l+b|1|

profile.|profile.|1024|1|l+b|1|


12 Feb 2017 11:49:32  INFO LvgAnnotator - apply LVG processing to get
canonical form

12 Feb 2017 11:49:32  INFO LvgAnnotator - canonicalForm == null:
course|course|1|1|l+b|1|

course|course|2|1|l+b|1|

course|course|128|1|l+b|1|

course|course|1024|1|l+b|1|


12 Feb 2017 11:49:32  INFO LvgAnnotator - apply LVG processing to get
canonical form

12 Feb 2017 11:49:32  INFO LvgAnnotator - canonicalForm == null:
remained|remain|1024|1024|l+b|1|

remained|remaine|1024|1024|l+b|1|

remained|remained|1|1|l+b|1|

remained|remained|2|1|l+b|1|

remained|remained|128|1|l+b|1|

remained|remained|1024|1|l+b|1|

remained|remaineed|1024|1024|l+b|1|


On Sun, Feb 12, 2017 at 8:05 AM, Marshall Schor <ms...@schor.com> wrote:

> Hi,
>
> Thanks for posting the release and the cause of the NullPointerException.
>
> The release looks to be a not-yet-released version of the development
> currently
> being done for the next version of cTakes.  I looked at the current "trunk"
> version for that module in SVN.
>
> I can't be sure (because you are running with a -SNAPSHOT which gets
> replaced
> all the time as development occurs on the Trunk), but if the code in SVN
> matches
> what you're running, then the problem is on this line:
>
> String[] output = out.split("\\|");
>
> Getting a NullPointerException happens if "out" is null.
>
> "out" is set in the previous line:
>
> String out = lvgCmd.MutateToString(word);
>
> I don't know about cTakes code, so you should best take up this analysis
> further
> with them, to try and see why the MutateToString returned a null result.
> Please ask your question on the cTakes mailing list.  At this point UIMA
> is only
> reporting the error that occurred there.
>
> -Marshall
>
>
> On 2/11/2017 12:58 AM, shahid ashraf wrote:
>
> ctakes.version>3.2.3-SNAPSHOT</ctakes.version>
>
>
> On Sat, Feb 11, 2017 at 4:24 AM, Marshall Schor <msa@schor.com
> <ma...@schor.com>> wrote:
>
> Thanks!
>
> It says the NullPointerException occurred in
>
> org.apache.ctakes.lvg.ae <http://org.apache.ctakes.lvg.ae>.
> LvgAnnotator.setCanonicalForm(LvgAnnotator.java:365)
>
> In the current version of cTakes, this is a blank line :-)
>
> So, can you tell me the exact version of cTakes you are running?
> -Marshall
>



-- 
with Regards
Shahid Ashraf

Re: CAS Pool

Posted by Marshall Schor <ms...@schor.com>.
Hi,

Thanks for posting the release and the cause of the NullPointerException.

The release looks to be a not-yet-released version of the development currently
being done for the next version of cTakes.  I looked at the current "trunk"
version for that module in SVN.

I can't be sure (because you are running with a -SNAPSHOT which gets replaced
all the time as development occurs on the Trunk), but if the code in SVN matches
what you're running, then the problem is on this line:

String[] output = out.split("\\|"); 

Getting a NullPointerException happens if "out" is null.

"out" is set in the previous line:

String out = lvgCmd.MutateToString(word);

I don't know about cTakes code, so you should best take up this analysis further
with them, to try and see why the MutateToString returned a null result.
Please ask your question on the cTakes mailing list.  At this point UIMA is only
reporting the error that occurred there.

-Marshall


On 2/11/2017 12:58 AM, shahid ashraf wrote:

ctakes.version>3.2.3-SNAPSHOT</ctakes.version>


On Sat, Feb 11, 2017 at 4:24 AM, Marshall Schor <msa@schor.com
<ma...@schor.com>> wrote:

Thanks!

It says the NullPointerException occurred in

org.apache.ctakes.lvg.ae <http://org.apache.ctakes.lvg.ae>.
LvgAnnotator.setCanonicalForm(LvgAnnotator.java:365)

In the current version of cTakes, this is a blank line :-)

So, can you tell me the exact version of cTakes you are running?
-Marshall

Re: CAS Pool

Posted by shahid ashraf <sh...@trialx.com>.
Hi

Here is the full stack trace

11 Feb 2017 01:42:51  INFO AbstractJCasTermAnnotator - Finished processing

11 Feb 2017 01:42:53  INFO SentenceDetector - Starting processing.

11 Feb 2017 01:42:53  INFO SentenceDetector - Starting processing.

11 Feb 2017 01:42:53  INFO TokenizerAnnotatorPTB - process(JCas) in
org.apache.ctakes.core.ae.TokenizerAnnotatorPTB

11 Feb 2017 01:42:54  INFO TokenizerAnnotatorPTB - process(JCas) in
org.apache.ctakes.core.ae.TokenizerAnnotatorPTB

11 Feb 2017 01:42:54  INFO LvgAnnotator - process(JCas)

11 Feb 2017 01:42:54  INFO LvgAnnotator - process(JCas)

Feb 11, 2017 1:42:54 AM
org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl
callAnalysisComponentProcess(430)

SEVERE: Exception occurred

org.apache.uima.analysis_engine.AnalysisEngineProcessException

at org.apache.ctakes.lvg.ae.LvgAnnotator.process(LvgAnnotator.java:310)

at org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(
JCasAnnotator_ImplBase.java:48)

at
org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(
PrimitiveAnalysisEngine_impl.java:396)

at
org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(
PrimitiveAnalysisEngine_impl.java:314)

at
org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.processUntilNextOutputCas(
ASB_impl.java:570)

at
org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.<init>(
ASB_impl.java:412)

at org.apache.uima.analysis_engine.asb.impl.ASB_impl.process(
ASB_impl.java:344)

at
org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.processAndOutputNewCASes(
AggregateAnalysisEngine_impl.java:265)

at org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(
AnalysisEngineImplBase.java:269)

at
org.apache.uima.analysis_engine.impl.MultiprocessingAnalysisEngine_impl.process(
MultiprocessingAnalysisEngine_impl.java:199)

at org.apache.ctakes.web.client.servlet.DemoServlet.analyzeDocument(
DemoServlet.java:122)

at org.apache.ctakes.web.client.servlet.DemoServlet.doPost(
DemoServlet.java:160)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)

at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)

at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501
)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(
ScopedHandler.java:137)

at org.eclipse.jetty.security.SecurityHandler.handle(
SecurityHandler.java:557)

at org.eclipse.jetty.server.session.SessionHandler.doHandle(
SessionHandler.java:231)

at org.eclipse.jetty.server.handler.ContextHandler.doHandle(
ContextHandler.java:1086)

at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)

at org.eclipse.jetty.server.session.SessionHandler.doScope(
SessionHandler.java:193)

at org.eclipse.jetty.server.handler.ContextHandler.doScope(
ContextHandler.java:1020)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(
ScopedHandler.java:135)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
HandlerWrapper.java:116)

at org.eclipse.jetty.server.Server.handle(Server.java:370)

at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(
AbstractHttpConnection.java:494)

at org.eclipse.jetty.server.AbstractHttpConnection.content(
AbstractHttpConnection.java:982)

at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(
AbstractHttpConnection.java:1043)

at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)

at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)

at org.eclipse.jetty.server.AsyncHttpConnection.handle(
AsyncHttpConnection.java:82)

at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(
SelectChannelEndPoint.java:667)

at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(
SelectChannelEndPoint.java:52)

at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
QueuedThreadPool.java:608)

at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(
QueuedThreadPool.java:543)

at java.lang.Thread.run(Thread.java:745)

Caused by: org.apache.uima.analysis_engine.AnalysisEngineProcessException

at org.apache.ctakes.lvg.ae.LvgAnnotator.setCanonicalForm(
LvgAnnotator.java:372)

at org.apache.ctakes.lvg.ae.LvgAnnotator.annotateRange(LvgAnnotator.java:342
)

at org.apache.ctakes.lvg.ae.LvgAnnotator.process(LvgAnnotator.java:307)

... 36 more

Caused by: java.lang.NullPointerException

at org.apache.ctakes.lvg.ae.LvgAnnotator.setCanonicalForm(
LvgAnnotator.java:365)

... 38 more


Feb 11, 2017 1:42:54 AM
org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl
processAndOutputNewCASes(273)

SEVERE: Exception occurred

org.apache.uima.analysis_engine.AnalysisEngineProcessException

at org.apache.ctakes.lvg.ae.LvgAnnotator.process(LvgAnnotator.java:310)

at org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(
JCasAnnotator_ImplBase.java:48)

at
org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(
PrimitiveAnalysisEngine_impl.java:396)

at
org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(
PrimitiveAnalysisEngine_impl.java:314)

at
org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.processUntilNextOutputCas(
ASB_impl.java:570)

at
org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.<init>(
ASB_impl.java:412)

at org.apache.uima.analysis_engine.asb.impl.ASB_impl.process(
ASB_impl.java:344)

at
org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.processAndOutputNewCASes(
AggregateAnalysisEngine_impl.java:265)

at org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(
AnalysisEngineImplBase.java:269)

at
org.apache.uima.analysis_engine.impl.MultiprocessingAnalysisEngine_impl.process(
MultiprocessingAnalysisEngine_impl.java:199)

at org.apache.ctakes.web.client.servlet.DemoServlet.analyzeDocument(
DemoServlet.java:122)

at org.apache.ctakes.web.client.servlet.DemoServlet.doPost(
DemoServlet.java:160)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)

at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)

at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501
)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(
ScopedHandler.java:137)

at org.eclipse.jetty.security.SecurityHandler.handle(
SecurityHandler.java:557)

at org.eclipse.jetty.server.session.SessionHandler.doHandle(
SessionHandler.java:231)

at org.eclipse.jetty.server.handler.ContextHandler.doHandle(
ContextHandler.java:1086)

at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)

at org.eclipse.jetty.server.session.SessionHandler.doScope(
SessionHandler.java:193)

at org.eclipse.jetty.server.handler.ContextHandler.doScope(
ContextHandler.java:1020)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(
ScopedHandler.java:135)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
HandlerWrapper.java:116)

at org.eclipse.jetty.server.Server.handle(Server.java:370)

at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(
AbstractHttpConnection.java:494)

at org.eclipse.jetty.server.AbstractHttpConnection.content(
AbstractHttpConnection.java:982)

at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(
AbstractHttpConnection.java:1043)

at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)

at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)

at org.eclipse.jetty.server.AsyncHttpConnection.handle(
AsyncHttpConnection.java:82)

at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(
SelectChannelEndPoint.java:667)

at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(
SelectChannelEndPoint.java:52)

at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
QueuedThreadPool.java:608)

at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(
QueuedThreadPool.java:543)

at java.lang.Thread.run(Thread.java:745)

Caused by: org.apache.uima.analysis_engine.AnalysisEngineProcessException

at org.apache.ctakes.lvg.ae.LvgAnnotator.setCanonicalForm(
LvgAnnotator.java:372)

at org.apache.ctakes.lvg.ae.LvgAnnotator.annotateRange(LvgAnnotator.java:342
)

at org.apache.ctakes.lvg.ae.LvgAnnotator.process(LvgAnnotator.java:307)

... 36 more

Caused by: java.lang.NullPointerException

at org.apache.ctakes.lvg.ae.LvgAnnotator.setCanonicalForm(
LvgAnnotator.java:365)

... 38 more


org.apache.uima.analysis_engine.AnalysisEngineProcessException

at org.apache.ctakes.lvg.ae.LvgAnnotator.process(LvgAnnotator.java:310)

at org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(
JCasAnnotator_ImplBase.java:48)

at
org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(
PrimitiveAnalysisEngine_impl.java:396)

at
org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(
PrimitiveAnalysisEngine_impl.java:314)

at
org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.processUntilNextOutputCas(
ASB_impl.java:570)

at
org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.<init>(
ASB_impl.java:412)

at org.apache.uima.analysis_engine.asb.impl.ASB_impl.process(
ASB_impl.java:344)

at
org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.processAndOutputNewCASes(
AggregateAnalysisEngine_impl.java:265)

at org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(
AnalysisEngineImplBase.java:269)

at
org.apache.uima.analysis_engine.impl.MultiprocessingAnalysisEngine_impl.process(
MultiprocessingAnalysisEngine_impl.java:199)

at org.apache.ctakes.web.client.servlet.DemoServlet.analyzeDocument(
DemoServlet.java:122)

at org.apache.ctakes.web.client.servlet.DemoServlet.doPost(
DemoServlet.java:160)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)

at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)

at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501
)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(
ScopedHandler.java:137)

at org.eclipse.jetty.security.SecurityHandler.handle(
SecurityHandler.java:557)

at org.eclipse.jetty.server.session.SessionHandler.doHandle(
SessionHandler.java:231)

at org.eclipse.jetty.server.handler.ContextHandler.doHandle(
ContextHandler.java:1086)

at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)

at org.eclipse.jetty.server.session.SessionHandler.doScope(
SessionHandler.java:193)

at org.eclipse.jetty.server.handler.ContextHandler.doScope(
ContextHandler.java:1020)

at org.eclipse.jetty.server.handler.ScopedHandler.handle(
ScopedHandler.java:135)

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
HandlerWrapper.java:116)

at org.eclipse.jetty.server.Server.handle(Server.java:370)

at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(
AbstractHttpConnection.java:494)

at org.eclipse.jetty.server.AbstractHttpConnection.content(
AbstractHttpConnection.java:982)

at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(
AbstractHttpConnection.java:1043)

at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)

at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)

at org.eclipse.jetty.server.AsyncHttpConnection.handle(
AsyncHttpConnection.java:82)

at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(
SelectChannelEndPoint.java:667)

at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(
SelectChannelEndPoint.java:52)

at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
QueuedThreadPool.java:608)

at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(
QueuedThreadPool.java:543)

at java.lang.Thread.run(Thread.java:745)

Caused by: org.apache.uima.analysis_engine.AnalysisEngineProcessException

at org.apache.ctakes.lvg.ae.LvgAnnotator.setCanonicalForm(
LvgAnnotator.java:372)

at org.apache.ctakes.lvg.ae.LvgAnnotator.annotateRange(LvgAnnotator.java:342
)

at org.apache.ctakes.lvg.ae.LvgAnnotator.process(LvgAnnotator.java:307)

... 36 more

Caused by: java.lang.NullPointerException

at org.apache.ctakes.lvg.ae.LvgAnnotator.setCanonicalForm(
LvgAnnotator.java:365)

... 38 more

On Sat, Feb 11, 2017 at 12:44 AM, Marshall Schor <ms...@schor.com> wrote:

> Hi Shahid,
>
> Thanks for replying.  I'm still not seeing the part of the stack trace that
> happens *after* the line saying"Caused by: java.lang.NullPointerException"
>
> That would identify (assuming that you can find it) where exactly in the
> code
> the NullPointerException occurred.
> The stack traces you supplied just show the wrappers wrapping this, and
> are not
> helpful to understand where the Null Pointer Exception itself occurred.
>
> I'm hoping there are some stack trace lines you can share *following* the
> NullPointerException message.
>
> -Marshall
>
> On 2/10/2017 12:17 PM, shahid ashraf wrote:
> > Hi
> >
> > The Full stack trace is below, it only happens when there are more then
> one
> > thread:
> >
> > Feb 10, 2017 8:44:06 PM
> > org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl
> > callAnalysisComponentProcess(430)
> >
> > SEVERE: Exception occurred
> >
> > org.apache.uima.analysis_engine.AnalysisEngineProcessException
> >
> > at org.apache.ctakes.lvg.ae.LvgAnnotator.process(LvgAnnotator.java:310)
> >
> > at
> > org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(
> JCasAnnotator_ImplBase.java:48)
> >
> > at
> > org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.
> callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:396)
> >
> > at
> > org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.
> processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:314)
> >
> > at
> > org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.
> processUntilNextOutputCas(ASB_impl.java:570)
> >
> > at
> > org.apache.uima.analysis_engine.asb.impl.ASB_impl$
> AggregateCasIterator.<init>(ASB_impl.java:412)
> >
> > at
> > org.apache.uima.analysis_engine.asb.impl.ASB_impl.
> process(ASB_impl.java:344)
> >
> > at
> > org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.
> processAndOutputNewCASes(AggregateAnalysisEngine_impl.java:265)
> >
> > at
> > org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(
> AnalysisEngineImplBase.java:269)
> >
> > at
> > org.apache.uima.analysis_engine.impl.MultiprocessingAnalysisEngine_
> impl.process(MultiprocessingAnalysisEngine_impl.java:199)
> >
> > at
> > org.apache.ctakes.web.client.servlet.DemoServlet.doPost(
> DemoServlet.java:135)
> >
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
> >
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
> >
> > at org.eclipse.jetty.servlet.ServletHolder.handle(
> ServletHolder.java:684)
> >
> > at
> > org.eclipse.jetty.servlet.ServletHandler.doHandle(
> ServletHandler.java:501)
> >
> > at
> > org.eclipse.jetty.server.handler.ScopedHandler.handle(
> ScopedHandler.java:137)
> >
> > at
> > org.eclipse.jetty.security.SecurityHandler.handle(
> SecurityHandler.java:557)
> >
> > at
> > org.eclipse.jetty.server.session.SessionHandler.
> doHandle(SessionHandler.java:231)
> >
> > at
> > org.eclipse.jetty.server.handler.ContextHandler.
> doHandle(ContextHandler.java:1086)
> >
> > at org.eclipse.jetty.servlet.ServletHandler.doScope(
> ServletHandler.java:428)
> >
> > at
> > org.eclipse.jetty.server.session.SessionHandler.
> doScope(SessionHandler.java:193)
> >
> > at
> > org.eclipse.jetty.server.handler.ContextHandler.
> doScope(ContextHandler.java:1020)
> >
> > at
> > org.eclipse.jetty.server.handler.ScopedHandler.handle(
> ScopedHandler.java:135)
> >
> > at
> > org.eclipse.jetty.server.handler.HandlerWrapper.handle(
> HandlerWrapper.java:116)
> >
> > at org.eclipse.jetty.server.Server.handle(Server.java:370)
> >
> > at
> > org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(
> AbstractHttpConnection.java:494)
> >
> > at
> > org.eclipse.jetty.server.AbstractHttpConnection.content(
> AbstractHttpConnection.java:982)
> >
> > at
> > org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(
> AbstractHttpConnection.java:1043)
> >
> > at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
> >
> > at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
> >
> > at
> > org.eclipse.jetty.server.AsyncHttpConnection.handle(
> AsyncHttpConnection.java:82)
> >
> > at
> > org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(
> SelectChannelEndPoint.java:667)
> >
> > at
> > org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(
> SelectChannelEndPoint.java:52)
> >
> > at
> > org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
> QueuedThreadPool.java:608)
> >
> > at
> > org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(
> QueuedThreadPool.java:543)
> >
> > at java.lang.Thread.run(Thread.java:745)
> >
> > Caused by: org.apache.uima.analysis_engine.
> AnalysisEngineProcessException
> >
> > at
> > org.apache.ctakes.lvg.ae.LvgAnnotator.setCanonicalForm(
> LvgAnnotator.java:372)
> >
> > at
> > org.apache.ctakes.lvg.ae.LvgAnnotator.annotateRange(
> LvgAnnotator.java:342)
> >
> > at org.apache.ctakes.lvg.ae.LvgAnnotator.process(LvgAnnotator.java:307)
> >
> > ... 35 more
> > Caused by: java.lang.NullPointerException
> >
> >
> > On Fri, Feb 10, 2017 at 10:22 PM, Marshall Schor <ms...@schor.com> wrote:
> >
> >> Hi,
> >>
> >> This exception is being thrown from CTakes, I think.  UIMA is "wrapping"
> >> this
> >> exception, and even CTakes is wrapping it.
> >>
> >> Can you post the full stack trace?  I'm looking for the lines that would
> >> follow
> >> something like:
> >> "Caused by: java.lang.NullPointerException" which would indicate the
> >> actual
> >> cause, I hope.
> >>
> >> Also, this is just a wild guess, but could you check to be sure you've
> set
> >> up
> >> the CAS for CTakes to process according to what it requires (I'm not
> >> familiar
> >> with CTakes requirements)?
> >>
> >> -Marshall
> >>
> >>
> >> On 2/10/2017 11:09 AM, shahid ashraf wrote:
> >>> Anything on the previous mail and
> >>>
> >>> *Also i tried the setting up  Cas Pool based on descriptor file using
> >> below
> >>> code... when i increase the number of threads from 1 i get following
> >> errors*
> >>> public class MyApplication {
> >>>   private CasPool mCasPool;
> >>>
> >>>   private AnalysisEngine mAnalysisEngine;
> >>>
> >>>   public MyApplication()
> >>>   {
> >>>     //get Resource Specifier from XML file
> >>>     XMLInputSource in = new XMLInputSource("MyDescriptor.xml");
> >>>     ResourceSpecifier specifier =
> >>>       UIMAFramework.getXMLParser().parseResourceSpecifier(in);
> >>>
> >>>     //Create multithreadable AE that will
> >>>     //Accept 3 simultaneous requests
> >>>     //The 3rd parameter specifies a timeout.
> >>>     //When the number of simultaneous requests exceeds 3,
> >>>     // additional requests will wait for other requests to finish.
> >>>     // This parameter determines the maximum number of milliseconds
> >>>     // that a new request should wait before throwing an
> >>>     // - a value of 0 will cause them to wait forever.
> >>>     mAnalysisEngine = UIMAFramework.produceAnalysisEngine(
> >> specifier,3,0);
> >>>     //create CAS pool with 3 CAS instances
> >>>     mCasPool = new CasPool(3, mAnalysisEngine);
> >>>   }
> >>>
> >>>   // Notice this is no longer "synchronized"
> >>>   public void analyzeDocument(String aDoc) {
> >>>     //check out a CAS instance (argument 0 means no timeout)
> >>>     CAS cas = mCasPool.getCas(0);
> >>>     try {
> >>>       //analyze a document
> >>>       cas.setDocumentText(aDoc);
> >>>       mAnalysisEngine.process(cas);
> >>>       doSomethingWithResults(cas);
> >>>     } finally {
> >>>       //MAKE SURE we release the CAS instance
> >>>       mCasPool.releaseCas(cas);
> >>>     }
> >>>   }
> >>>   ...
> >>> }
> >>>
> >>> eb 10, 2017 8:44:06 PM
> >>> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl
> >>> callAnalysisComponentProcess(430)
> >>>
> >>> SEVERE: Exception occurred
> >>>
> >>> org.apache.uima.analysis_engine.AnalysisEngineProcessException
> >>>
> >>>       at org.apache.ctakes.lvg.ae.LvgAnnotator.process(
> >> LvgAnnotator.java:310)
> >>>       at org.apache.uima.analysis_component.JCasAnnotator_
> >> ImplBase.process(JCasAnnotator_ImplBase.java:48)
> >>>       at org.apache.uima.analysis_engine.impl.
> >> PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(
> >> PrimitiveAnalysisEngine_impl.java:396)
> >>>       at org.apache.uima.analysis_engine.impl.
> >> PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(
> >> PrimitiveAnalysisEngine_impl.java:314)
> >>>       at org.apache.uima.analysis_engine.asb.impl.ASB_impl$
> >> AggregateCasIterator.processUntilNextOutputCas(ASB_impl.java:570)
> >>>       at org.apache.uima.analysis_engine.asb.impl.ASB_impl$
> >> AggregateCasIterator.<init>(ASB_impl.java:412)
> >>>       at org.apache.uima.analysis_engine.asb.impl.ASB_impl.
> >> process(ASB_impl.java:344)
> >>>       at org.apache.uima.analysis_engine.impl.
> >> AggregateAnalysisEngine_impl.processAndOutputNewCASes(
> >> AggregateAnalysisEngine_impl.java:265)aused
> >>> by: org.apache.uima.analysis_engine.AnalysisEngineProcessException
> >>>
> >>> at
> >>> org.apache.ctakes.lvg.ae.LvgAnnotator.setCanonicalForm(
> >> LvgAnnotator.java:372)
> >>> at
> >>> org.apache.ctakes.lvg.ae.LvgAnnotator.annotateRange(
> >> LvgAnnotator.java:342)
> >>> at org.apache.ctakes.lvg.ae.LvgAnnotator.process(
> LvgAnnotator.java:307)
> >>>
> >>> ... 35 more
> >>> Caused by: java.lang.NullPointerException
> >>>
> >>> Feb 10, 2017 8:44:06 PM
> >>> org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl
> >>> processAndOutputNewCASes(273)
> >>>
> >>> SEVERE: Exception occurred
> >>>
> >>> org.apache.uima.analysis_engine.AnalysisEngineProcessException
> >>>
> >>>       at org.apache.ctakes.lvg.ae.LvgAnnotator.process(
> >> LvgAnnotator.java:310)
> >>>       at org.apache.uima.analysis_component.JCasAnnotator_
> >> ImplBase.process(JCasAnnotator_ImplBase.java:48)
> >>>       at org.apache.uima.analysis_engine.impl.
> >> PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(
> >> PrimitiveAnalysisEngine_impl.java:396)
> >>>       at org.apache.uima.analysis_engine.impl.
> >> PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(
> >> PrimitiveAnalysisEngine_impl.java:314)
> >>>       at org.apache.uima.analysis_engine.asb.impl.ASB_impl$
> >> AggregateCasIterator.processUntilNextOutputCas(ASB_impl.java:570)
> >>>       at org.apache.uima.analysis_engine.asb.impl.ASB_impl$
> >> AggregateCasIterator.<init>(ASB_impl.java:412)
> >>>       at org.apache.uima.analysis_engine.asb.impl.ASB_impl.
> >> process(ASB_impl.java:344)
> >>>       at org.apache.uima.analysis_engine.impl.
> >> AggregateAnalysisEngine_impl.processAndOutputNewCASes(
> >> AggregateAnalysisEngine_impl.java:265)
> >>>       at
> >>>
> >>>
> >>>
> >>> On Fri, Feb 10, 2017 at 12:12 AM, shahid ashraf <sh...@trialx.com>
> >> wrote:
> >>>> Hi Folks
> >>>>
> >>>> This is my first mail to the mailing list. I have just started looking
> >>>> into the uima architecture. Currently i am trying few things in
> ctakes.
> >> I
> >>>> need to use the JCAS pool for multithreading. https://uima.
> >>>> apache.org/d/uimaj-current/tutorials_and_users_guides.
> >>>> html#ugr.tug.applications.multi_threaded
> >>>> I need to know the equivalent of the following while using
> programmable
> >>>> bluider AE(org.apache.uima.fit.factory.AggregateBuilder;)
> >>>>
> >>>> mAnalysisEngine = UIMAFramework.produceAnalysisEngine(specifier,3,0);
> >>>>
> >>>> Currently i am building aggregate AE like this ... in which i need to
> >> set
> >>>> the property/field to 3 like in above.
> >>>>
> >>>> *In other words the questions is how to use the cas object pool for
> >>>> multiprocessing iusing programmable interface(AggregrateBuilder)
> >> instead of
> >>>> descriptor file approach.*
> >>>>
> >>>> --
> >>>> with Regards
> >>>> Shahid Ashraf
> >>>>
> >>>
> >>
> >
>
>


-- 
with Regards
Shahid Ashraf

Re: CAS Pool

Posted by Marshall Schor <ms...@schor.com>.
Hi Shahid,

Thanks for replying.  I'm still not seeing the part of the stack trace that
happens *after* the line saying"Caused by: java.lang.NullPointerException"

That would identify (assuming that you can find it) where exactly in the code
the NullPointerException occurred. 
The stack traces you supplied just show the wrappers wrapping this, and are not
helpful to understand where the Null Pointer Exception itself occurred.

I'm hoping there are some stack trace lines you can share *following* the
NullPointerException message.

-Marshall

On 2/10/2017 12:17 PM, shahid ashraf wrote:
> Hi
>
> The Full stack trace is below, it only happens when there are more then one
> thread:
>
> Feb 10, 2017 8:44:06 PM
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl
> callAnalysisComponentProcess(430)
>
> SEVERE: Exception occurred
>
> org.apache.uima.analysis_engine.AnalysisEngineProcessException
>
> at org.apache.ctakes.lvg.ae.LvgAnnotator.process(LvgAnnotator.java:310)
>
> at
> org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(JCasAnnotator_ImplBase.java:48)
>
> at
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:396)
>
> at
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:314)
>
> at
> org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.processUntilNextOutputCas(ASB_impl.java:570)
>
> at
> org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.<init>(ASB_impl.java:412)
>
> at
> org.apache.uima.analysis_engine.asb.impl.ASB_impl.process(ASB_impl.java:344)
>
> at
> org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.processAndOutputNewCASes(AggregateAnalysisEngine_impl.java:265)
>
> at
> org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(AnalysisEngineImplBase.java:269)
>
> at
> org.apache.uima.analysis_engine.impl.MultiprocessingAnalysisEngine_impl.process(MultiprocessingAnalysisEngine_impl.java:199)
>
> at
> org.apache.ctakes.web.client.servlet.DemoServlet.doPost(DemoServlet.java:135)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
>
> at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
>
> at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
>
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
>
> at
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
>
> at
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
>
> at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
>
> at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
>
> at
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
>
> at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
>
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
>
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
>
> at org.eclipse.jetty.server.Server.handle(Server.java:370)
>
> at
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
>
> at
> org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982)
>
> at
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043)
>
> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
>
> at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
>
> at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
>
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)
>
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
>
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
>
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
>
> at java.lang.Thread.run(Thread.java:745)
>
> Caused by: org.apache.uima.analysis_engine.AnalysisEngineProcessException
>
> at
> org.apache.ctakes.lvg.ae.LvgAnnotator.setCanonicalForm(LvgAnnotator.java:372)
>
> at
> org.apache.ctakes.lvg.ae.LvgAnnotator.annotateRange(LvgAnnotator.java:342)
>
> at org.apache.ctakes.lvg.ae.LvgAnnotator.process(LvgAnnotator.java:307)
>
> ... 35 more
> Caused by: java.lang.NullPointerException
>
>
> On Fri, Feb 10, 2017 at 10:22 PM, Marshall Schor <ms...@schor.com> wrote:
>
>> Hi,
>>
>> This exception is being thrown from CTakes, I think.  UIMA is "wrapping"
>> this
>> exception, and even CTakes is wrapping it.
>>
>> Can you post the full stack trace?  I'm looking for the lines that would
>> follow
>> something like:
>> "Caused by: java.lang.NullPointerException" which would indicate the
>> actual
>> cause, I hope.
>>
>> Also, this is just a wild guess, but could you check to be sure you've set
>> up
>> the CAS for CTakes to process according to what it requires (I'm not
>> familiar
>> with CTakes requirements)?
>>
>> -Marshall
>>
>>
>> On 2/10/2017 11:09 AM, shahid ashraf wrote:
>>> Anything on the previous mail and
>>>
>>> *Also i tried the setting up  Cas Pool based on descriptor file using
>> below
>>> code... when i increase the number of threads from 1 i get following
>> errors*
>>> public class MyApplication {
>>>   private CasPool mCasPool;
>>>
>>>   private AnalysisEngine mAnalysisEngine;
>>>
>>>   public MyApplication()
>>>   {
>>>     //get Resource Specifier from XML file
>>>     XMLInputSource in = new XMLInputSource("MyDescriptor.xml");
>>>     ResourceSpecifier specifier =
>>>       UIMAFramework.getXMLParser().parseResourceSpecifier(in);
>>>
>>>     //Create multithreadable AE that will
>>>     //Accept 3 simultaneous requests
>>>     //The 3rd parameter specifies a timeout.
>>>     //When the number of simultaneous requests exceeds 3,
>>>     // additional requests will wait for other requests to finish.
>>>     // This parameter determines the maximum number of milliseconds
>>>     // that a new request should wait before throwing an
>>>     // - a value of 0 will cause them to wait forever.
>>>     mAnalysisEngine = UIMAFramework.produceAnalysisEngine(
>> specifier,3,0);
>>>     //create CAS pool with 3 CAS instances
>>>     mCasPool = new CasPool(3, mAnalysisEngine);
>>>   }
>>>
>>>   // Notice this is no longer "synchronized"
>>>   public void analyzeDocument(String aDoc) {
>>>     //check out a CAS instance (argument 0 means no timeout)
>>>     CAS cas = mCasPool.getCas(0);
>>>     try {
>>>       //analyze a document
>>>       cas.setDocumentText(aDoc);
>>>       mAnalysisEngine.process(cas);
>>>       doSomethingWithResults(cas);
>>>     } finally {
>>>       //MAKE SURE we release the CAS instance
>>>       mCasPool.releaseCas(cas);
>>>     }
>>>   }
>>>   ...
>>> }
>>>
>>> eb 10, 2017 8:44:06 PM
>>> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl
>>> callAnalysisComponentProcess(430)
>>>
>>> SEVERE: Exception occurred
>>>
>>> org.apache.uima.analysis_engine.AnalysisEngineProcessException
>>>
>>>       at org.apache.ctakes.lvg.ae.LvgAnnotator.process(
>> LvgAnnotator.java:310)
>>>       at org.apache.uima.analysis_component.JCasAnnotator_
>> ImplBase.process(JCasAnnotator_ImplBase.java:48)
>>>       at org.apache.uima.analysis_engine.impl.
>> PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(
>> PrimitiveAnalysisEngine_impl.java:396)
>>>       at org.apache.uima.analysis_engine.impl.
>> PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(
>> PrimitiveAnalysisEngine_impl.java:314)
>>>       at org.apache.uima.analysis_engine.asb.impl.ASB_impl$
>> AggregateCasIterator.processUntilNextOutputCas(ASB_impl.java:570)
>>>       at org.apache.uima.analysis_engine.asb.impl.ASB_impl$
>> AggregateCasIterator.<init>(ASB_impl.java:412)
>>>       at org.apache.uima.analysis_engine.asb.impl.ASB_impl.
>> process(ASB_impl.java:344)
>>>       at org.apache.uima.analysis_engine.impl.
>> AggregateAnalysisEngine_impl.processAndOutputNewCASes(
>> AggregateAnalysisEngine_impl.java:265)aused
>>> by: org.apache.uima.analysis_engine.AnalysisEngineProcessException
>>>
>>> at
>>> org.apache.ctakes.lvg.ae.LvgAnnotator.setCanonicalForm(
>> LvgAnnotator.java:372)
>>> at
>>> org.apache.ctakes.lvg.ae.LvgAnnotator.annotateRange(
>> LvgAnnotator.java:342)
>>> at org.apache.ctakes.lvg.ae.LvgAnnotator.process(LvgAnnotator.java:307)
>>>
>>> ... 35 more
>>> Caused by: java.lang.NullPointerException
>>>
>>> Feb 10, 2017 8:44:06 PM
>>> org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl
>>> processAndOutputNewCASes(273)
>>>
>>> SEVERE: Exception occurred
>>>
>>> org.apache.uima.analysis_engine.AnalysisEngineProcessException
>>>
>>>       at org.apache.ctakes.lvg.ae.LvgAnnotator.process(
>> LvgAnnotator.java:310)
>>>       at org.apache.uima.analysis_component.JCasAnnotator_
>> ImplBase.process(JCasAnnotator_ImplBase.java:48)
>>>       at org.apache.uima.analysis_engine.impl.
>> PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(
>> PrimitiveAnalysisEngine_impl.java:396)
>>>       at org.apache.uima.analysis_engine.impl.
>> PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(
>> PrimitiveAnalysisEngine_impl.java:314)
>>>       at org.apache.uima.analysis_engine.asb.impl.ASB_impl$
>> AggregateCasIterator.processUntilNextOutputCas(ASB_impl.java:570)
>>>       at org.apache.uima.analysis_engine.asb.impl.ASB_impl$
>> AggregateCasIterator.<init>(ASB_impl.java:412)
>>>       at org.apache.uima.analysis_engine.asb.impl.ASB_impl.
>> process(ASB_impl.java:344)
>>>       at org.apache.uima.analysis_engine.impl.
>> AggregateAnalysisEngine_impl.processAndOutputNewCASes(
>> AggregateAnalysisEngine_impl.java:265)
>>>       at
>>>
>>>
>>>
>>> On Fri, Feb 10, 2017 at 12:12 AM, shahid ashraf <sh...@trialx.com>
>> wrote:
>>>> Hi Folks
>>>>
>>>> This is my first mail to the mailing list. I have just started looking
>>>> into the uima architecture. Currently i am trying few things in ctakes.
>> I
>>>> need to use the JCAS pool for multithreading. https://uima.
>>>> apache.org/d/uimaj-current/tutorials_and_users_guides.
>>>> html#ugr.tug.applications.multi_threaded
>>>> I need to know the equivalent of the following while using programmable
>>>> bluider AE(org.apache.uima.fit.factory.AggregateBuilder;)
>>>>
>>>> mAnalysisEngine = UIMAFramework.produceAnalysisEngine(specifier,3,0);
>>>>
>>>> Currently i am building aggregate AE like this ... in which i need to
>> set
>>>> the property/field to 3 like in above.
>>>>
>>>> *In other words the questions is how to use the cas object pool for
>>>> multiprocessing iusing programmable interface(AggregrateBuilder)
>> instead of
>>>> descriptor file approach.*
>>>>
>>>> --
>>>> with Regards
>>>> Shahid Ashraf
>>>>
>>>
>>
>


Re: CAS Pool

Posted by shahid ashraf <sh...@trialx.com>.
Hi

The Full stack trace is below, it only happens when there are more then one
thread:

Feb 10, 2017 8:44:06 PM
org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl
callAnalysisComponentProcess(430)

SEVERE: Exception occurred

org.apache.uima.analysis_engine.AnalysisEngineProcessException

at org.apache.ctakes.lvg.ae.LvgAnnotator.process(LvgAnnotator.java:310)

at
org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(JCasAnnotator_ImplBase.java:48)

at
org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:396)

at
org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:314)

at
org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.processUntilNextOutputCas(ASB_impl.java:570)

at
org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.<init>(ASB_impl.java:412)

at
org.apache.uima.analysis_engine.asb.impl.ASB_impl.process(ASB_impl.java:344)

at
org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.processAndOutputNewCASes(AggregateAnalysisEngine_impl.java:265)

at
org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(AnalysisEngineImplBase.java:269)

at
org.apache.uima.analysis_engine.impl.MultiprocessingAnalysisEngine_impl.process(MultiprocessingAnalysisEngine_impl.java:199)

at
org.apache.ctakes.web.client.servlet.DemoServlet.doPost(DemoServlet.java:135)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)

at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)

at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)

at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)

at
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)

at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)

at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)

at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)

at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)

at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)

at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)

at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)

at org.eclipse.jetty.server.Server.handle(Server.java:370)

at
org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)

at
org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982)

at
org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043)

at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)

at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)

at
org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)

at
org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:667)

at
org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)

at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)

at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)

at java.lang.Thread.run(Thread.java:745)

Caused by: org.apache.uima.analysis_engine.AnalysisEngineProcessException

at
org.apache.ctakes.lvg.ae.LvgAnnotator.setCanonicalForm(LvgAnnotator.java:372)

at
org.apache.ctakes.lvg.ae.LvgAnnotator.annotateRange(LvgAnnotator.java:342)

at org.apache.ctakes.lvg.ae.LvgAnnotator.process(LvgAnnotator.java:307)

... 35 more
Caused by: java.lang.NullPointerException


On Fri, Feb 10, 2017 at 10:22 PM, Marshall Schor <ms...@schor.com> wrote:

> Hi,
>
> This exception is being thrown from CTakes, I think.  UIMA is "wrapping"
> this
> exception, and even CTakes is wrapping it.
>
> Can you post the full stack trace?  I'm looking for the lines that would
> follow
> something like:
> "Caused by: java.lang.NullPointerException" which would indicate the
> actual
> cause, I hope.
>
> Also, this is just a wild guess, but could you check to be sure you've set
> up
> the CAS for CTakes to process according to what it requires (I'm not
> familiar
> with CTakes requirements)?
>
> -Marshall
>
>
> On 2/10/2017 11:09 AM, shahid ashraf wrote:
> > Anything on the previous mail and
> >
> > *Also i tried the setting up  Cas Pool based on descriptor file using
> below
> > code... when i increase the number of threads from 1 i get following
> errors*
> >
> > public class MyApplication {
> >   private CasPool mCasPool;
> >
> >   private AnalysisEngine mAnalysisEngine;
> >
> >   public MyApplication()
> >   {
> >     //get Resource Specifier from XML file
> >     XMLInputSource in = new XMLInputSource("MyDescriptor.xml");
> >     ResourceSpecifier specifier =
> >       UIMAFramework.getXMLParser().parseResourceSpecifier(in);
> >
> >     //Create multithreadable AE that will
> >     //Accept 3 simultaneous requests
> >     //The 3rd parameter specifies a timeout.
> >     //When the number of simultaneous requests exceeds 3,
> >     // additional requests will wait for other requests to finish.
> >     // This parameter determines the maximum number of milliseconds
> >     // that a new request should wait before throwing an
> >     // - a value of 0 will cause them to wait forever.
> >     mAnalysisEngine = UIMAFramework.produceAnalysisEngine(
> specifier,3,0);
> >
> >     //create CAS pool with 3 CAS instances
> >     mCasPool = new CasPool(3, mAnalysisEngine);
> >   }
> >
> >   // Notice this is no longer "synchronized"
> >   public void analyzeDocument(String aDoc) {
> >     //check out a CAS instance (argument 0 means no timeout)
> >     CAS cas = mCasPool.getCas(0);
> >     try {
> >       //analyze a document
> >       cas.setDocumentText(aDoc);
> >       mAnalysisEngine.process(cas);
> >       doSomethingWithResults(cas);
> >     } finally {
> >       //MAKE SURE we release the CAS instance
> >       mCasPool.releaseCas(cas);
> >     }
> >   }
> >   ...
> > }
> >
> > eb 10, 2017 8:44:06 PM
> > org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl
> > callAnalysisComponentProcess(430)
> >
> > SEVERE: Exception occurred
> >
> > org.apache.uima.analysis_engine.AnalysisEngineProcessException
> >
> >       at org.apache.ctakes.lvg.ae.LvgAnnotator.process(
> LvgAnnotator.java:310)
> >
> >       at org.apache.uima.analysis_component.JCasAnnotator_
> ImplBase.process(JCasAnnotator_ImplBase.java:48)
> >
> >       at org.apache.uima.analysis_engine.impl.
> PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(
> PrimitiveAnalysisEngine_impl.java:396)
> >
> >       at org.apache.uima.analysis_engine.impl.
> PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(
> PrimitiveAnalysisEngine_impl.java:314)
> >
> >       at org.apache.uima.analysis_engine.asb.impl.ASB_impl$
> AggregateCasIterator.processUntilNextOutputCas(ASB_impl.java:570)
> >
> >       at org.apache.uima.analysis_engine.asb.impl.ASB_impl$
> AggregateCasIterator.<init>(ASB_impl.java:412)
> >
> >       at org.apache.uima.analysis_engine.asb.impl.ASB_impl.
> process(ASB_impl.java:344)
> >       at org.apache.uima.analysis_engine.impl.
> AggregateAnalysisEngine_impl.processAndOutputNewCASes(
> AggregateAnalysisEngine_impl.java:265)aused
> > by: org.apache.uima.analysis_engine.AnalysisEngineProcessException
> >
> > at
> > org.apache.ctakes.lvg.ae.LvgAnnotator.setCanonicalForm(
> LvgAnnotator.java:372)
> >
> > at
> > org.apache.ctakes.lvg.ae.LvgAnnotator.annotateRange(
> LvgAnnotator.java:342)
> >
> > at org.apache.ctakes.lvg.ae.LvgAnnotator.process(LvgAnnotator.java:307)
> >
> > ... 35 more
> > Caused by: java.lang.NullPointerException
> >
> > Feb 10, 2017 8:44:06 PM
> > org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl
> > processAndOutputNewCASes(273)
> >
> > SEVERE: Exception occurred
> >
> > org.apache.uima.analysis_engine.AnalysisEngineProcessException
> >
> >       at org.apache.ctakes.lvg.ae.LvgAnnotator.process(
> LvgAnnotator.java:310)
> >
> >       at org.apache.uima.analysis_component.JCasAnnotator_
> ImplBase.process(JCasAnnotator_ImplBase.java:48)
> >
> >       at org.apache.uima.analysis_engine.impl.
> PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(
> PrimitiveAnalysisEngine_impl.java:396)
> >
> >       at org.apache.uima.analysis_engine.impl.
> PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(
> PrimitiveAnalysisEngine_impl.java:314)
> >
> >       at org.apache.uima.analysis_engine.asb.impl.ASB_impl$
> AggregateCasIterator.processUntilNextOutputCas(ASB_impl.java:570)
> >
> >       at org.apache.uima.analysis_engine.asb.impl.ASB_impl$
> AggregateCasIterator.<init>(ASB_impl.java:412)
> >
> >       at org.apache.uima.analysis_engine.asb.impl.ASB_impl.
> process(ASB_impl.java:344)
> >
> >       at org.apache.uima.analysis_engine.impl.
> AggregateAnalysisEngine_impl.processAndOutputNewCASes(
> AggregateAnalysisEngine_impl.java:265)
> >       at
> >
> >
> >
> > On Fri, Feb 10, 2017 at 12:12 AM, shahid ashraf <sh...@trialx.com>
> wrote:
> >
> >> Hi Folks
> >>
> >> This is my first mail to the mailing list. I have just started looking
> >> into the uima architecture. Currently i am trying few things in ctakes.
> I
> >> need to use the JCAS pool for multithreading. https://uima.
> >> apache.org/d/uimaj-current/tutorials_and_users_guides.
> >> html#ugr.tug.applications.multi_threaded
> >> I need to know the equivalent of the following while using programmable
> >> bluider AE(org.apache.uima.fit.factory.AggregateBuilder;)
> >>
> >> mAnalysisEngine = UIMAFramework.produceAnalysisEngine(specifier,3,0);
> >>
> >> Currently i am building aggregate AE like this ... in which i need to
> set
> >> the property/field to 3 like in above.
> >>
> >> *In other words the questions is how to use the cas object pool for
> >> multiprocessing iusing programmable interface(AggregrateBuilder)
> instead of
> >> descriptor file approach.*
> >>
> >> --
> >> with Regards
> >> Shahid Ashraf
> >>
> >
> >
>
>


-- 
with Regards
Shahid Ashraf

Re: CAS Pool

Posted by Marshall Schor <ms...@schor.com>.
Hi,

This exception is being thrown from CTakes, I think.  UIMA is "wrapping" this
exception, and even CTakes is wrapping it.

Can you post the full stack trace?  I'm looking for the lines that would follow
something like:
"Caused by: java.lang.NullPointerException" which would indicate the actual
cause, I hope.

Also, this is just a wild guess, but could you check to be sure you've set up
the CAS for CTakes to process according to what it requires (I'm not familiar
with CTakes requirements)?

-Marshall


On 2/10/2017 11:09 AM, shahid ashraf wrote:
> Anything on the previous mail and
>
> *Also i tried the setting up  Cas Pool based on descriptor file using below
> code... when i increase the number of threads from 1 i get following errors*
>
> public class MyApplication {
>   private CasPool mCasPool;
>
>   private AnalysisEngine mAnalysisEngine;
>
>   public MyApplication()
>   {
>     //get Resource Specifier from XML file
>     XMLInputSource in = new XMLInputSource("MyDescriptor.xml");
>     ResourceSpecifier specifier =
>       UIMAFramework.getXMLParser().parseResourceSpecifier(in);
>
>     //Create multithreadable AE that will
>     //Accept 3 simultaneous requests
>     //The 3rd parameter specifies a timeout.
>     //When the number of simultaneous requests exceeds 3,
>     // additional requests will wait for other requests to finish.
>     // This parameter determines the maximum number of milliseconds
>     // that a new request should wait before throwing an
>     // - a value of 0 will cause them to wait forever.
>     mAnalysisEngine = UIMAFramework.produceAnalysisEngine(specifier,3,0);
>
>     //create CAS pool with 3 CAS instances
>     mCasPool = new CasPool(3, mAnalysisEngine);
>   }
>
>   // Notice this is no longer "synchronized"
>   public void analyzeDocument(String aDoc) {
>     //check out a CAS instance (argument 0 means no timeout)
>     CAS cas = mCasPool.getCas(0);
>     try {
>       //analyze a document
>       cas.setDocumentText(aDoc);
>       mAnalysisEngine.process(cas);
>       doSomethingWithResults(cas);
>     } finally {
>       //MAKE SURE we release the CAS instance
>       mCasPool.releaseCas(cas);
>     }
>   }
>   ...
> }
>
> eb 10, 2017 8:44:06 PM
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl
> callAnalysisComponentProcess(430)
>
> SEVERE: Exception occurred
>
> org.apache.uima.analysis_engine.AnalysisEngineProcessException
>
> 	at org.apache.ctakes.lvg.ae.LvgAnnotator.process(LvgAnnotator.java:310)
>
> 	at org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(JCasAnnotator_ImplBase.java:48)
>
> 	at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:396)
>
> 	at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:314)
>
> 	at org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.processUntilNextOutputCas(ASB_impl.java:570)
>
> 	at org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.<init>(ASB_impl.java:412)
>
> 	at org.apache.uima.analysis_engine.asb.impl.ASB_impl.process(ASB_impl.java:344)
> 	at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.processAndOutputNewCASes(AggregateAnalysisEngine_impl.java:265)aused
> by: org.apache.uima.analysis_engine.AnalysisEngineProcessException
>
> at
> org.apache.ctakes.lvg.ae.LvgAnnotator.setCanonicalForm(LvgAnnotator.java:372)
>
> at
> org.apache.ctakes.lvg.ae.LvgAnnotator.annotateRange(LvgAnnotator.java:342)
>
> at org.apache.ctakes.lvg.ae.LvgAnnotator.process(LvgAnnotator.java:307)
>
> ... 35 more
> Caused by: java.lang.NullPointerException
>
> Feb 10, 2017 8:44:06 PM
> org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl
> processAndOutputNewCASes(273)
>
> SEVERE: Exception occurred
>
> org.apache.uima.analysis_engine.AnalysisEngineProcessException
>
> 	at org.apache.ctakes.lvg.ae.LvgAnnotator.process(LvgAnnotator.java:310)
>
> 	at org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(JCasAnnotator_ImplBase.java:48)
>
> 	at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:396)
>
> 	at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:314)
>
> 	at org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.processUntilNextOutputCas(ASB_impl.java:570)
>
> 	at org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.<init>(ASB_impl.java:412)
>
> 	at org.apache.uima.analysis_engine.asb.impl.ASB_impl.process(ASB_impl.java:344)
>
> 	at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.processAndOutputNewCASes(AggregateAnalysisEngine_impl.java:265)
> 	at
>
>
>
> On Fri, Feb 10, 2017 at 12:12 AM, shahid ashraf <sh...@trialx.com> wrote:
>
>> Hi Folks
>>
>> This is my first mail to the mailing list. I have just started looking
>> into the uima architecture. Currently i am trying few things in ctakes. I
>> need to use the JCAS pool for multithreading. https://uima.
>> apache.org/d/uimaj-current/tutorials_and_users_guides.
>> html#ugr.tug.applications.multi_threaded
>> I need to know the equivalent of the following while using programmable
>> bluider AE(org.apache.uima.fit.factory.AggregateBuilder;)
>>
>> mAnalysisEngine = UIMAFramework.produceAnalysisEngine(specifier,3,0);
>>
>> Currently i am building aggregate AE like this ... in which i need to set
>> the property/field to 3 like in above.
>>
>> *In other words the questions is how to use the cas object pool for
>> multiprocessing iusing programmable interface(AggregrateBuilder) instead of
>> descriptor file approach.*
>>
>> --
>> with Regards
>> Shahid Ashraf
>>
>
>


Re: CAS Pool

Posted by shahid ashraf <sh...@trialx.com>.
Anything on the previous mail and

*Also i tried the setting up  Cas Pool based on descriptor file using below
code... when i increase the number of threads from 1 i get following errors*

public class MyApplication {
  private CasPool mCasPool;

  private AnalysisEngine mAnalysisEngine;

  public MyApplication()
  {
    //get Resource Specifier from XML file
    XMLInputSource in = new XMLInputSource("MyDescriptor.xml");
    ResourceSpecifier specifier =
      UIMAFramework.getXMLParser().parseResourceSpecifier(in);

    //Create multithreadable AE that will
    //Accept 3 simultaneous requests
    //The 3rd parameter specifies a timeout.
    //When the number of simultaneous requests exceeds 3,
    // additional requests will wait for other requests to finish.
    // This parameter determines the maximum number of milliseconds
    // that a new request should wait before throwing an
    // - a value of 0 will cause them to wait forever.
    mAnalysisEngine = UIMAFramework.produceAnalysisEngine(specifier,3,0);

    //create CAS pool with 3 CAS instances
    mCasPool = new CasPool(3, mAnalysisEngine);
  }

  // Notice this is no longer "synchronized"
  public void analyzeDocument(String aDoc) {
    //check out a CAS instance (argument 0 means no timeout)
    CAS cas = mCasPool.getCas(0);
    try {
      //analyze a document
      cas.setDocumentText(aDoc);
      mAnalysisEngine.process(cas);
      doSomethingWithResults(cas);
    } finally {
      //MAKE SURE we release the CAS instance
      mCasPool.releaseCas(cas);
    }
  }
  ...
}

eb 10, 2017 8:44:06 PM
org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl
callAnalysisComponentProcess(430)

SEVERE: Exception occurred

org.apache.uima.analysis_engine.AnalysisEngineProcessException

	at org.apache.ctakes.lvg.ae.LvgAnnotator.process(LvgAnnotator.java:310)

	at org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(JCasAnnotator_ImplBase.java:48)

	at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:396)

	at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:314)

	at org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.processUntilNextOutputCas(ASB_impl.java:570)

	at org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.<init>(ASB_impl.java:412)

	at org.apache.uima.analysis_engine.asb.impl.ASB_impl.process(ASB_impl.java:344)
	at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.processAndOutputNewCASes(AggregateAnalysisEngine_impl.java:265)aused
by: org.apache.uima.analysis_engine.AnalysisEngineProcessException

at
org.apache.ctakes.lvg.ae.LvgAnnotator.setCanonicalForm(LvgAnnotator.java:372)

at
org.apache.ctakes.lvg.ae.LvgAnnotator.annotateRange(LvgAnnotator.java:342)

at org.apache.ctakes.lvg.ae.LvgAnnotator.process(LvgAnnotator.java:307)

... 35 more
Caused by: java.lang.NullPointerException

Feb 10, 2017 8:44:06 PM
org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl
processAndOutputNewCASes(273)

SEVERE: Exception occurred

org.apache.uima.analysis_engine.AnalysisEngineProcessException

	at org.apache.ctakes.lvg.ae.LvgAnnotator.process(LvgAnnotator.java:310)

	at org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(JCasAnnotator_ImplBase.java:48)

	at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:396)

	at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:314)

	at org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.processUntilNextOutputCas(ASB_impl.java:570)

	at org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.<init>(ASB_impl.java:412)

	at org.apache.uima.analysis_engine.asb.impl.ASB_impl.process(ASB_impl.java:344)

	at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.processAndOutputNewCASes(AggregateAnalysisEngine_impl.java:265)
	at



On Fri, Feb 10, 2017 at 12:12 AM, shahid ashraf <sh...@trialx.com> wrote:

>
> Hi Folks
>
> This is my first mail to the mailing list. I have just started looking
> into the uima architecture. Currently i am trying few things in ctakes. I
> need to use the JCAS pool for multithreading. https://uima.
> apache.org/d/uimaj-current/tutorials_and_users_guides.
> html#ugr.tug.applications.multi_threaded
> I need to know the equivalent of the following while using programmable
> bluider AE(org.apache.uima.fit.factory.AggregateBuilder;)
>
> mAnalysisEngine = UIMAFramework.produceAnalysisEngine(specifier,3,0);
>
> Currently i am building aggregate AE like this ... in which i need to set
> the property/field to 3 like in above.
>
> *In other words the questions is how to use the cas object pool for
> multiprocessing iusing programmable interface(AggregrateBuilder) instead of
> descriptor file approach.*
>
> --
> with Regards
> Shahid Ashraf
>



-- 
with Regards
Shahid Ashraf