apache/uima-uimaj

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

Opened this issue · 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

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

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.