Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
raghu298 opened this issue Jul 28, 2022 · 3 comments
Assignees
Labels
🦟 Bug Something isn't working
Milestone

Comments

@raghu298
Copy link

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

@reckart
Copy link
Member

reckart commented Jul 28, 2022

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

@raghu298
Copy link
Author

raghu298 commented Jul 28, 2022 via email

@reckart reckart self-assigned this Aug 15, 2022
@reckart reckart added the 🦟 Bug Something isn't working label Aug 15, 2022
@reckart reckart changed the title Missing UIMA type, JCas Class name: org.apache.uima.jcas.tcas.Annotation, index: 21, jcasRegisteredTypes size: 95 Using builtin annotation classes before creating a CAS can break type system management Aug 15, 2022
@reckart
Copy link
Member

reckart commented Aug 15, 2022

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 reckart added this to the 3.3.1 milestone Aug 15, 2022
reckart added a commit that referenced this issue Aug 15, 2022
…n break type system management

- Try fixing the case if a JCCI was created with a bad type ID because the type ID had not been set yet
reckart added a commit to ClearTK/cleartk that referenced this issue Aug 31, 2022
- Workaround apache/uima-uimaj#234 by explicitly creating a dummy CAS before the test
- Add Apache SNAPSHOT repo
- Add slf4j-simple dependency for basic logging in timeml test
@reckart reckart modified the milestones: 3.3.1, 3.3.2 Oct 17, 2022
reckart added a commit to apache/uima-uimafit that referenced this issue Nov 11, 2022
- Avoid UIMA bug when using Managed(J)Cas - apache/uima-uimaj#234 - by initializing a dummy CAS in a static block.
@reckart reckart modified the milestones: 3.3.2, 3.4.1 Feb 7, 2023
@reckart reckart modified the milestones: 3.4.1, 3.4.2 Feb 17, 2023
@reckart reckart modified the milestones: 3.4.2, 3.4.3 Jun 29, 2023
reckart added a commit that referenced this issue Sep 23, 2024
No issue. Set version to 3.5.0-SNAPSHOT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🦟 Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants