uima-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Eckart de Castilho (JIRA)" <...@uima.apache.org>
Subject [jira] [Commented] (UIMA-5554) Strange exception when trying to get JCas FS class through reflection
Date Sun, 10 Sep 2017 13:45:02 GMT

    [ https://issues.apache.org/jira/browse/UIMA-5554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16160344#comment-16160344

Richard Eckart de Castilho commented on UIMA-5554:

I don't understand what "installed/committed" means. As far as I know, there was a concept
of committing the type system of a CAS instance in v2. But afaik this was per-CAS/classloader
and not globally. Also, it was possible to re-initialize a CAS with a new type system even
after one had already been committed. That concept seems still to be there in UIMAv3 and is
being used in CasIOUtils when CasLoadMode.REINIT is used. Afaik, in v2 it was possible to
have any number of type systems and different CASes initialized with different type systems
- and if different classloaders were used, even with different JCas classes.

Is there a new concept of "installing/committing" types in v3? 

Why are the types not simply "installed" when the JCas class is loaded and initialized?

> 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

View raw message