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

Marshall Schor commented on UIMA-5097:
--------------------------------------

Its root cause seems to be that the test has not set up the initial view.  

The failure starts in line 366 of PrimitiveAnalysisEngine_impl, where it 
attempts to get the "starting view" for calling a component.  UIMA-3765 changed 
the behavior (which corresponds to why 2.6.0 works, and later versions don't).  
The new behavior says to always return what the  _InitialView maps to.  In this 
case the mapping was to "MyView" (which doesn't exist).

Line 366 for this case, throws the error "No SofaFs with name MyView found".

Unfortunately, the catch is wanting to reset the cas's current component info 
back to null, but the "view" variable has been set to null - there's a check 
for that that bypasses the reset.

Shouldn't be too hard to fix...  and I'll scan the code to see if there are 
other similar cases needing the same fix.

> Current component info on CAS not reset
> ---------------------------------------
>
>                 Key: UIMA-5097
>                 URL: https://issues.apache.org/jira/browse/UIMA-5097
>             Project: UIMA
>          Issue Type: Bug
>          Components: Core Java Framework
>            Reporter: Richard Eckart de Castilho
>         Attachments: UIMA5097SuiteTest.java
>
>
> uimaFIT tests re-use a single CAS which is stored in a thread-local variable 
> and reset that CAS between unit tests. Apparently there was some change which 
> causes the Sofa-mapping information - or more specifically the current 
> component info from which that mapping is obtained - to not be reset anymore. 
> The problem only appears when running all uimafit-core tests jointly in one 
> JVM, e.g. from Eclipse.
> Initial hypothesis which proved to be wrong: 
> There may be a bug that might be related to the UimaContextHolder not being 
> cleaned up probably (probably in case of some kind of failure).
> The problem appears when running the uimafit-core tests in Eclipse. Here all 
> tests run in the same JVM instance which allows "global" information like 
> thread locals to be carried over between unit tests.
> Then running all tests and when the `ViewCreatorAnnotatorTest` runs before 
> the `SimplePipelineTest`, then the deserialization of an XMI file fails 
> because `_InitialView` is still mapped to `myView` in the UIMA context. 
> Debugging yields that the UIMAContext in use for the SimplePipelineTest 
> apparently still belongs to the `ViewCreatorAnnotatorTest` because the 
> *mQualifiedContextName* is 
> `/org.apache.uima.fit.component.ViewCreatorAnnotatorTest$SofaAwareAnnotator/`
> This hypothesis was wrong: checked it by verifying that 
> UimaContextHolder.getContext() is null before and after each unit test.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to