[ https://issues.apache.org/jira/browse/UIMA-5554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16161938#comment-16161938 ]
Richard Eckart de Castilho commented on UIMA-5554: -------------------------------------------------- I still don't get it entirely because in my mental picture, the committing of the type systems is something that happens per CAS instance since every CAS instance can have a different type system. From how you describe it, it appears as if the "commit" is some kind of global action. In the call you have above, I somehow miss a reference to the CAS instance from which the type system is obtained... It looks a bit as if there is a leaking of type information between CAS instances, i.e. as if I instantiate a CAS with type X having feature x and another CAS with type X having feature y, then both CASes end up with a type X with both features. > Strange exception when trying to get JCas FS class through reflection > --------------------------------------------------------------------- > > Key: UIMA-5554 > URL: https://issues.apache.org/jira/browse/UIMA-5554 > Project: UIMA > Issue Type: Bug > Components: Core Java Framework > Affects Versions: 3.0.0SDK-beta > Reporter: Richard Eckart de Castilho > > I am trying to get a class object for a JCas FS type using reflection: > {noformat} > Class.forName(typeName); > {noformat} > However, it produces this strange error. > {noformat} > 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 > {noformat} > Is it considered harmful to try getting a class object for a JCas FS class? -- This message was sent by Atlassian JIRA (v6.4.14#64029)