An easy way of using JCas inside eclipse is to use the eclipse buddy policy to
enable the UIMA Runtime Plugin to load the classes from your plugin.

Thanks to Peter to pointing that out to me.

Jörn

On 09/22/2012 11:51 PM, Jörn Kottmann wrote:
Hello,

using JCas doesn't work here because the UIMA Runtime doesn't import your
JCas class.

To get things working you can do two things:
- Do not use JCas, you can do all operations with the CAS API
- Fix the imports in the UIMA Runtime OSGI Manifest and
  only use the modified bundle

HTH,
Jörn

On 09/20/2012 04:40 PM, Sergeant, Alan wrote:
Hi,
I am trying to extend the Cas editor with my own custom view as in the documentation in chapter 7.4. But I run into problems when using the JCas.

My code is as follows:

JCas jcas = cas.getJCas();

AnnotationIndex<Annotation> fsIndex = jcas.getAnnotationIndex(Proposition.type);
               FSIterator<Annotation> fsIter = fsIndex.iterator();

               while (fsIter.hasNext()) {
                      Proposition p = (Proposition)fsIter.next();
                      props.add(p);
               }

               return props;

The error is:

org.apache.uima.cas.CASRuntimeException: The JCAS cover class "com.sap.ta.research.argumentation.Proposition_Type" could not be loaded.
        at org.apache.uima.jcas.impl.JCasImpl.getType(JCasImpl.java:417)
at org.apache.uima.jcas.impl.JCasImpl.getCasType(JCasImpl.java:436) at org.apache.uima.jcas.impl.JCasImpl.getAnnotationIndex(JCasImpl.java:1531) at org.apache.uima.caseditor.editor.argumentation.ArgumentationZest.getPropositions(ArgumentationZest.java:194) at org.apache.uima.caseditor.editor.argumentation.ArgumentationZest.createControl(ArgumentationZest.java:142) at org.apache.uima.caseditor.editor.CasEditorViewPage.initializeAndShowPage(CasEditorViewPage.java:145) at org.apache.uima.caseditor.editor.CasEditorViewPage.setCASViewPage(CasEditorViewPage.java:184) at org.apache.uima.caseditor.editor.CasEditorView.createViewPage(CasEditorView.java:102) at org.apache.uima.caseditor.editor.CasEditorView.doCreatePage(CasEditorView.java:164)

Can anyone offer advice?

Alan



Reply via email to