ConcurrentModificationException in CasCopier.copyCas()
------------------------------------------------------

                 Key: UIMA-1195
                 URL: https://issues.apache.org/jira/browse/UIMA-1195
             Project: UIMA
          Issue Type: Bug
          Components: Core Java Framework
            Reporter: Aaron Kaplan
            Priority: Minor


I get a ConcurrentModificationException in the last line of the following 
snippet:

public class MovingImageMerger extends JCasMultiplier_ImplBase{
        public void process(JCas jcas) throws AnalysisEngineProcessException {
                        if (resultJCas != null) throw new 
AnalysisEngineProcessException();
                        resultJCas = getEmptyJCas();
                        CasCopier.copyCas(jcas.getCas(), resultJCas.getCas(), 
true);

Here is the stack trace:

Caused by: java.util.ConcurrentModificationException
        at 
org.apache.uima.cas.impl.FSIndexRepositoryImpl$PointerIterator.checkConcurrentModification(FSIndexRepositoryImpl.java:264)
        at 
org.apache.uima.cas.impl.FSIndexRepositoryImpl$PointerIterator.checkConcurrentModificationAll(FSIndexRepositoryImpl.java:275)
        at 
org.apache.uima.cas.impl.FSIndexRepositoryImpl$PointerIterator.moveToNext(FSIndexRepositoryImpl.java:311)
        at 
org.apache.uima.cas.impl.FSIndexRepositoryImpl$PointerIterator.inc(FSIndexRepositoryImpl.java:541)
        at 
org.apache.uima.cas.impl.FSIteratorWrapper.moveToNext(FSIteratorWrapper.java:67)
        at 
org.apache.uima.cas.impl.FSIteratorImplBase.next(FSIteratorImplBase.java:48)
        at org.apache.uima.util.CasCopier.copyCasView(CasCopier.java:140)
        at org.apache.uima.util.CasCopier.copyCas(CasCopier.java:101)
        at 
eu.sapir.contentmanagement.video.MovingImageMerger.process(MovingImageMerger.java:55)
        at 
org.apache.uima.analysis_component.JCasMultiplier_ImplBase.process(JCasMultiplier_ImplBase.java:58)
        at 
org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:375)
        ... 22 more

A hint for constructing a test case: while debugging, I noticed that the last 
feature structure to be copied before the error was of a type that had 
erroneously been defined as a subtype of Annotation.  It's not a textual 
annotation, and its begin and end fields are left at 0.  After I changed the 
definition to make the type a subtype of TOP, the 
ConcurrentModificationException went away.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to