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

Strange exception when trying to get JCas FS class through reflection

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0SDK-beta
    • 3.0.0SDK-beta
    • Core Java Framework
    • None

    Description

      I am trying to get a class object for a JCas FS type using reflection:

      Class.forName(typeName);
      

      However, it produces this strange error.

      java.lang.ExceptionInInitializerError
      	at java.lang.Class.forName0(Native Method)
      	at java.lang.Class.forName(Class.java:264)
      ...
      Caused by: org.apache.uima.cas.CASRuntimeException: A JCas class field "sofa" is being initialized by non-framework (user) code before Type System Commit for a type system with a corresponding type. Either change the user load code to not do initialize, or to defer it until after the type system commit.
      	at org.apache.uima.cas.impl.TypeSystemImpl.getAdjustedFeatureOffset(TypeSystemImpl.java:2575)
      	at org.apache.uima.jcas.cas.AnnotationBase.<clinit>(AnnotationBase.java:71)
      	... 27 more
      

      Is it considered harmful to try getting a class object for a JCas FS class?

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: