Richard,  The fix you suggested worked.. I added 
CasCreationUtils.createCas()(there is no newJCas()  method as mentioned below.. 
Im using 3.4.1) and this resolved when running the application..
However, when I run my unit test that fix does not work..

Any idea why it would work in the application but not in a unit test..

Thanks

Daniel Cosio
dcco...@gmail.com



> On Sep 4, 2024, at 10:42 AM, Richard Eckart de Castilho <r...@apache.org> 
> wrote:
> 
> Hi Daniel,
> 
> 
>> On 4. Sep 2024, at 16:35, Daniel Cosio <dcco...@gmail.com> wrote:
>> 
>> Im making progress on my 3.x upgrade. Im now running into this error.
>> 
>> JCas type “my class type" defined in CAS type system and used in Java code, 
>> but was not registered in JCasRegistry.
>> 
>> I’ve always had a META-INF/org.apache.uima.fit/types.txt file defining the 
>> class paths to the types.. The types are generated with the 3.x version of 
>> jcasgen-plugin.
>> 
>> Is there another step to get the type registered?
> 
> I suspect you hit this issue:
> 
> https://github.com/apache/uima-uimaj/issues/234
> 
> Try adding a dummy `CasCreationUtils.newJCas()` call when you initialize your 
> application before any UIMA code is called.
> 
> I'm afraid, I have not found a UIMA-side fix for this yet... also not looking 
> at the moment - quite complicated.
> 
> If it is not that issue, let me know.
> 
> Btw. there is also now an SPI-based mechanism to announce types and JCas 
> classes that can be used as an alternative to the `types.txt`.
> 
> https://nightlies.apache.org/uima/draft-guides/fit.html#_using_the_java_service_provide_interface
> https://nightlies.apache.org/uima/draft-guides/user.html#_uv3.spi
> 
> Cheers,
> 
> -- Richard
> 

Reply via email to