uima-uimaj icon indicating copy to clipboard operation
uima-uimaj copied to clipboard

Using builtin annotation classes before creating a CAS can break type system management

Open raghu298 opened this issue 1 year ago • 3 comments

JCas jCas=UIMAFramework.produceAnalysisEngine(AnalysisEngineDescription desc, ResourceManagerFactory.newResourceManager(), null).newJCas(); Type annotationType = cas.getJCas().getCasType(org.apache.uima.jcas.tcas.Annotation.type);

Exception will be raised as Annotation is missing.

uima: 3.3.0 ruta-core: 3.2.0

raghu298 avatar Jul 28 '22 17:07 raghu298

Can you provide a runnable Java project (preferably a Maven Project) which allows reproducing your problem?

reckart avatar Jul 28 '22 17:07 reckart

Hi Team,

Appreciate your response.

Let me prepare and will send.

Its happening once migrating from uima v2 to uima v3.

Regards,

Raghunath...

On Thu, 28 Jul, 2022, 10:56 pm Richard Eckart de Castilho, < @.***> wrote:

Can you provide a runnable Java project (preferably a Maven Project) which allows reproducing your problem?

— Reply to this email directly, view it on GitHub https://github.com/apache/uima-uimaj/issues/234#issuecomment-1198433126, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEE3MWNJQKFI7X5PLJZCXJDVWK7DVANCNFSM546A7EHA . You are receiving this because you authored the thread.Message ID: @.***>

raghu298 avatar Jul 28 '22 17:07 raghu298

It seems this case can happen when annotation classes are used before a CAS / type-system is initialized. Due to the initialization order, it can happen that the JCCI for a built-in JCas class is set up before the classes static final typeIndexID field has been initialized. That means the JCCI records the JCas class with type ID 0.

reckart avatar Aug 15 '22 19:08 reckart