Hi,

The code that throws the not-committed yet exception checks two type systems -
the one passed in (which has been committed), and the one associated with the 
CAS.

  - This implies that the existing Type System in the CAS being deserialized
into is missing a committed type system.

Form 6 needs two type systems because it is designed to perform a kind of
mapping/filtering - the two type systems don't need to be the same, and form 6
will silently ignore types and features of types where they're missing.

There are variants of CasIOUtils which replace the CAS type system before
deserialization.  The JavaDocs for CasIOUtils say:
For COMPRESSED_FILTERED_TS

  * it uses the embedded TS for decoding
  * it uses the external TSI to replace the CAS's existing type system and index
definition if CasLoadMode == REINIT.

Maybe the test is expecting the CAS's existing type system & index def to be
replaced, but didn't specify REINIT?

Or, of course, there might be a bug.

What was the CasLoadMode for this test, and can you confirm the receiving CAS
did not have a committed type system?

-Marshall


On 10/11/2017 6:20 PM, Richard Eckart de Castilho wrote:
> On 11.10.2017, at 16:01, Marshall Schor <m...@schor.com> wrote:
>> fixed in trunk.  Thanks for testing :-)
>>
>> On 10/11/2017 9:50 AM, Marshall Schor wrote:
>>> I think I found the cause: a faulty implementation of load(asInputStream, 
>>> aCAS,
>>> typeSystem).
>>>
>>> Looking at the code, the 3rd argument is not used!  It looks like something
>>> happened when migrating from V2 -> V3 code base, because it's OK in the v2 
>>> code
>>> base.  Maybe I can blame the cat (she sometimes jumps up onto my desk, 
>>> landing
>>> on my keyboard, and randomly pressing keys...) :-)
>>>
>>> Apologies, and thank goodness for testing...
> Now I'm seeing a new exception in the units tests using the three-argument 
> signature:
>
> org.apache.uima.cas.CASRuntimeException: Type Systems must be committed 
> before calling this method.
>       at 
> org.apache.uima.cas.impl.CasTypeSystemMapper.<init>(CasTypeSystemMapper.java:101)
>       at 
> org.apache.uima.cas.impl.TypeSystemImpl.lambda$0(TypeSystemImpl.java:1853)
>       at java.util.Map.computeIfAbsent(Map.java:957)
>       at 
> org.apache.uima.cas.impl.TypeSystemImpl.getTypeSystemMapperInner(TypeSystemImpl.java:1852)
>       at 
> org.apache.uima.cas.impl.TypeSystemImpl.getTypeSystemMapper(TypeSystemImpl.java:1841)
>       at 
> org.apache.uima.cas.impl.BinaryCasSerDes6.<init>(BinaryCasSerDes6.java:545)
>       at 
> org.apache.uima.cas.impl.BinaryCasSerDes6.<init>(BinaryCasSerDes6.java:639)
>       at 
> org.apache.uima.cas.impl.BinaryCasSerDes.reinit(BinaryCasSerDes.java:593)
>       at org.apache.uima.util.CasIOUtils.load(CasIOUtils.java:382)
>       at org.apache.uima.util.CasIOUtils.load(CasIOUtils.java:344)
>       at 
> de.tudarmstadt.ukp.dkpro.core.io.bincas.BinaryCasReader.getNext(BinaryCasReader.java:194)
>       at 
> de.tudarmstadt.ukp.dkpro.core.io.bincas.BinaryCasWriterReaderTest.read(BinaryCasWriterReaderTest.java:561)
>       at 
> de.tudarmstadt.ukp.dkpro.core.io.bincas.BinaryCasWriterReaderTest.test6Lenient(BinaryCasWriterReaderTest.java:164)
>         ...
>
> Mind, I actually do explicitly call typeSystem.commit() on the type system 
> passed as the third argument before passing it.
>
> Any immediate ideas?
>
> Best,
>
> -- Richard
>
>
>
>

Reply via email to