Uploaded image for project: 'UIMA'
  1. UIMA
  2. UIMA-6243

JCas returns Annotation when asked for a specific subtype

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.10.4SDK, 3.1.1SDK
    • 2.11.0SDK, 3.2.0SDK
    • UIMA
    • None

    Description

      In a specific classloader topology, a fully initialized JCas with theoretic access to the JCas wrappers of a given type will not return that type but instead returns an instance of Annotation. This leads to an exception like this:

      org.apache.uima.analysis_engine.AnalysisEngineProcessException: Annotator processing failed.    
      	at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:427)
      	at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.innerCall(PrimitiveAnalysisEngine_impl.java:329)
      	at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(PrimitiveAnalysisEngine_impl.java:321)
      	at org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(AnalysisEngineImplBase.java:269)
      	at org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(AnalysisEngineImplBase.java:284)
      	at org.apache.uima.cas.test.JCasClassLoaderTest.thatTypeSystemCanComeFromItsOwnClassLoader(JCasClassLoaderTest.java:126)
      	... snip ...
      Caused by: java.lang.ClassCastException: org.apache.uima.jcas.tcas.Annotation cannot be cast to org.apache.uima.cas.test.Token
      	at java.util.Iterator.forEachRemaining(Iterator.java:116)
      	at org.apache.uima.cas.test.JCasClassLoaderTest$FetchTheTokenAnnotator.process(JCasClassLoaderTest.java:166)
      	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:411)
      	... 28 more
      

      Looks like this is a UIMAv2 issue only. When running the test against the UIMAv3 master (commit 0211057ad), I do not get any ClassCastException.

      Attachments

        Activity

          People

            rec Richard Eckart de Castilho
            rec Richard Eckart de Castilho
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: