Ok, then I don't see anything special that JCasCollectionReader_ImplBase does 
over CollectionReader_ImplBase other than calling cas.getJCas() before calling 
getNext().

I don't know the exact peculiarities involving the initialization of the JCas. 
Maybe
it needs to be done at a certain point in time, e.g. before creating any 
annotations,
such that calling it anywhere else than at the beginning or before getNext() 
doesn't 
work - which would b) and c). It may also explain a) if some seemingly 
redundant calls
to getJCas() in uimaFIT 2.0.0 have been removed for 2.1.0. It's been a while, I 
don't
remember. As I said, I've seen these problems largely with binary 
serialization, probably
because I use JCasFactory() everywhere anyway.

Cheers,

-- Richard

On 30.07.2015, at 15:09, [email protected] wrote:

> Hi Richard!
> 
> No, I don't use initialize() without args directly. I use 
> initialize(UimaContext context) and call super.initialize(context).
> 
> Best,
> Armin
> 
> -----Ursprüngliche Nachricht-----
> Von: Richard Eckart de Castilho [mailto:[email protected]] 
> Gesendet: Donnerstag, 30. Juli 2015 14:46
> An: [email protected]
> Betreff: Re: DKPro NamedEntity ClassCastException
> 
> On 30.07.2015, at 13:23, [email protected] wrote:
> 
>> Hello Richard and Peter!
>> 
>> The problem is solved but not really understood. 
>> 
>> a) Downgrading form uimaFIT 2.1.0 to uimaFIT 2.0.0 helped. So, it must be 
>> connected to 2.1.0 in some way.
>> 
>> b) Adding an annotator with cas.getJCas() or jcas.getCas().getJCas() in 
>> process() to the begin of the pipeline does nothing. 
>> 
>> c) Adding cas.getJCas() or jcas.getCas().getJCas() to the collection reader 
>> does nothing. 
>> 
>> d) Changing the collection reader from CasCollectionReader_ImplBase to 
>> JCasCollectionReader_ImplBase solved it. I don't use JCas often. I prefer 
>> the more flexible CAS.
> 
> Uhm - JCasCollectionReader_ImplBase does directly inherit from the UIMA 
> CollectionReader_ImplBase - nothing special.
> 
> Did you possibly override the initialize() method (the one with no args) 
> without calling super? 
> ... although don't wouldn't see why that would make a difference either.
> 
> Cheers,
> 
> -- Richard

Reply via email to