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-3253) TypeSystemDescription throws ClassCastException
Date Mon, 09 Sep 2013 10:55:52 GMT

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

Richard Eckart de Castilho commented on UIMA-3253:

The link you provided points to the documentation of the Collection Processing Engine (CPE).
You don't seem to be using a CPE in your code.

> TypeSystemDescription throws ClassCastException
> -----------------------------------------------
>                 Key: UIMA-3253
>                 URL: https://issues.apache.org/jira/browse/UIMA-3253
>             Project: UIMA
>          Issue Type: Bug
>          Components: uimaFIT
>            Reporter: alina
> Hi all!
> We have received a strange Exception from the Type system of uimafit maybe you can help
us to fix it.
> 1. First we loaded the type system from different xml-files like this:
> typeSystemDescription = TypeSystemDescriptionFactory.createTypeSystemDescriptionFromPath(
>                     "app/models/linguistic/descriptors/LexicalUnits.xml",
>                     "app/models/linguistic/descriptors/Punctuation.xml",
>                     "app/models/linguistic/descriptors/Word.xml",
>                     ...);
> 2. Then we created JCAS document 
> JCas jCas = JCasFactory.createJCas(typeSystemDescription);      
> 3. Then we loaded the pipeline through aggregator like this: 
> AggregateBuilder builder = new AggregateBuilder();
>         // create resource manager
>         SimpleNamedResourceManager resourceManager = new SimpleNamedResourceManager();
       resourceManager.setExtensionClassPath(Play.application().classloader(), "", true);
>         // build pipeline
>         builder.add(createPrimitiveDescription(LanguageAnnotator.class));
> 4. And then we wanted to iterate the annotations of the daugther type which was created
in one of the annotators:
> Collection<Word> col = JCasUtil.select(jCas, Word.class);
> (*) for (Word word: col){...}
> => In this place (* ) the system threw the ClassCastException, that Annotation.class
cannot be casted to Word.class.
> Inside any annotator the same lines don't throw any exception, this happens in the main
program only. 
> What could we do wrong?
> The problem may lay in the resource loading, since we use ResourceManager which loads
the classes for the types from the PLAY (Web framework) Class loader. Maybe we have to set
the ResourceManager also for JCas? 
> Maybe our problem is described in chapter 5.6.7 of the UIMA Tutorial but in this case
we also don't understand what to do.
> We use IntelliJ IDEA and MacOS.
> Thank you for your help.    

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message