Hello,

I'm playing around with UIMAFit, trying the RoomNumberAnnotator but I'm
getting an error:

Nov 20, 2011 4:34:39 PM
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl
> callAnalysisComponentProcess(405)
> SEVERE: Exception occurred
> org.apache.uima.analysis_engine.AnalysisEngineProcessException: Annotator
> processing failed.
> at
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(
> PrimitiveAnalysisEngine_impl.java:391)
> at
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(
> PrimitiveAnalysisEngine_impl.java:295)
> at org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(
> AnalysisEngineImplBase.java:267)
> at org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(
> AnalysisEngineImplBase.java:280)
> at org.uimafit.RoomNumbersAEPipeline.main(RoomNumbersAEPipeline.java:28)
> Caused by: org.apache.uima.cas.CASRuntimeException: JCas type
> "org.uimafit.type.RoomNumber" used in Java code,  but was not declared in
> the XML type descriptor.
> at org.apache.uima.jcas.impl.JCasImpl.getType(JCasImpl.java:412)
> at org.apache.uima.jcas.cas.TOP.<init>(TOP.java:92)
> at org.apache.uima.jcas.cas.AnnotationBase.<init>(AnnotationBase.java:53)
> at org.apache.uima.jcas.tcas.Annotation.<init>(Annotation.java:54)
> at org.uimafit.type.RoomNumber.<init>(RoomNumber.java:61)
> at org.uimafit.ae.RoomNumbersAE.process(RoomNumbersAE.java:36)
> at org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(
> JCasAnnotator_ImplBase.java:48)
> at
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(
> PrimitiveAnalysisEngine_impl.java:377)
> ... 4 more
> Exception in thread "main"
> org.apache.uima.analysis_engine.AnalysisEngineProcessException: Annotator
> processing failed.
> at
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(
> PrimitiveAnalysisEngine_impl.java:391)
> at
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.processAndOutputNewCASes(
> PrimitiveAnalysisEngine_impl.java:295)
> at org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(
> AnalysisEngineImplBase.java:267)
> at org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.process(
> AnalysisEngineImplBase.java:280)
> at org.uimafit.RoomNumbersAEPipeline.main(RoomNumbersAEPipeline.java:28)
> Caused by: org.apache.uima.cas.CASRuntimeException: JCas type
> "org.uimafit.type.RoomNumber" used in Java code,  but was not declared in
> the XML type descriptor.
> at org.apache.uima.jcas.impl.JCasImpl.getType(JCasImpl.java:412)
> at org.apache.uima.jcas.cas.TOP.<init>(TOP.java:92)
> at org.apache.uima.jcas.cas.AnnotationBase.<init>(AnnotationBase.java:53)
> at org.apache.uima.jcas.tcas.Annotation.<init>(Annotation.java:54)
> at org.uimafit.type.RoomNumber.<init>(RoomNumber.java:61)
> at org.uimafit.ae.RoomNumbersAE.process(RoomNumbersAE.java:36)
> at org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(
> JCasAnnotator_ImplBase.java:48)
> at
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(
> PrimitiveAnalysisEngine_impl.java:377)
> ... 4 more


The *RoomNumber.xml* (places in src/main/resources/org/uimafit/type) looks
like this:

<?xml version="1.0" encoding="UTF-8"?>
> <typeSystemDescription xmlns="http://uima.apache.org/resourceSpecifier";>
>     <types>
>         <typeDescription>
>           <name>org.apache.uima.tutorial.RoomNumber</name>
>           <description/>
>           <supertypeName>uima.tcas.Annotation</supertypeName>
>           <features>
>             <featureDescription>
>               <name>building</name>
>               <description/>
>               <rangeTypeName>uima.cas.String</rangeTypeName>
>             </featureDescription>
>           </features>
>         </typeDescription>
>       </types>
> </typeSystemDescription>


Also the *RoomNumbersAE.xml* (placed in src/main/resources/org/uimafit)
looks like this:

<?xml version="1.0" encoding="UTF-8"?>
> <analysisEngineDescription xmlns="http://uima.apache.org/resourceSpecifier
> ">
>     <frameworkImplementation>org.apache.uima.java</frameworkImplementation
> >
>     <primitive>true</primitive>
>     <annotatorImplementationName>org.uimafit.ae.RoomNumbersAE</
> annotatorImplementationName>
>     <analysisEngineMetaData>
>         <name>org.uimafit.ae.RoomNumbersAE</name>
>         <description>Descriptor automatically generated by uimaFIT</
> description>
>         <version>unknown</version>
>         <vendor>org.uimafit.ae</vendor>
>         <configurationParameters/>
>         <configurationParameterSettings/>
>         <typeSystemDescription>
>             <imports>
>                 <import name="org.uimafit.type.RoomNumber"/>
>             </imports>
>         </typeSystemDescription>
>         <fsIndexCollection/>
>         <capabilities/>
>         <operationalProperties>
>             <modifiesCas>true</modifiesCas>
>             <multipleDeploymentAllowed>true</multipleDeploymentAllowed>
>             <outputsNewCASes>false</outputsNewCASes>
>         </operationalProperties>
>     </analysisEngineMetaData>
> </analysisEngineDescription>


Is there anything wrong with them?

Thanks!

On Fri, Nov 18, 2011 at 2:54 PM, Adei Mandaluniz <[email protected]>wrote:

> Thanks Richard,
>
> I'll give it a try! Obviously this would be for prototype and demo
> purposes...
>
> Regards,
> Adei
>
>
> On Fri, Nov 18, 2011 at 1:33 PM, Richard Eckart de Castilho <
> [email protected]> wrote:
>
>> Hello Adei,
>>
>> unless you need classpath separation (which is a feature of PEARs), I
>> would suggest you just create instances of your UIMA components in some
>> Spring bean and run them. I would suggest to try using uimaFIT for this,
>> e.g.:
>>
>>                TypeSystemDescription tsd =
>> TypeSystemDescriptionFactory.createTypeSystemDescriptionFromPath(
>>
>>  "src/test/resources/org/uimafit/type/AnalyzedText.xml");
>>
>>                 // Instantiate component
>>                AnalysisEngine ae =
>> AnalysisEngineFactory.createPrimitive(MyAnalysisEngine.class, tsd);
>>
>>                JCas jcas = ae.newJCas();
>>                jcas.setDocumenText("my text");
>>
>>                // Test that injection works
>>                ae.process(jcas);
>>
>>                for (MyAnnotation a : JCasUtil.select(jcas,
>> MyAnnotation.class)) {
>>                        ... do something with your analysis;
>>                }
>>
>> If you are interested in using UIMA within Spring, you might be
>> interested in the (experimental) uimafit-spring bridge. It provides
>>
>> 1) a way to inject Spring beans as UIMA external resources into UIMA
>> components
>> 2) a way to run the bean postprocessors of your Spring context on your
>> UIMA components so that the actual Spring annotations work, e.g. @Resource
>> or possible @Transactional etc.
>>
>>
>> http://code.google.com/p/uimafit/source/browse/trunk/uimaFIT-spring/src/test/java/org/uimafit/spring/SpringContextResourceManagerTest.java
>>
>> http://code.google.com/p/uimafit/source/browse/trunk/uimaFIT-spring/src/test/java/org/uimafit/spring/UimaFactoryInjectionTest.java
>>
>> Note that if you bind this tightly to your Spring context, you will not
>> be able to use UIMA's scale-out features. But for small systems or
>> prototypes, its can be very useful.
>>
>> Best,
>>
>> -- Richard
>>
>> Am 18.11.2011 um 11:15 schrieb Adei Mandaluniz:
>>
>> > Hi,
>> >
>> > I'm quite a newbie using UIMA and my question may be (I'm sure it is) a
>> > basic question.
>> >
>> > Here it go...
>> >
>> > I've created my own Annotator, what I want to do is integrate it with
>> > java-spring based application so I can post some text to the annotator
>> and
>> > get the annotations back.
>> > So the question is, how can I integrate it with another application? Do
>> I
>> > need to package it as something else than PEAR, or do I need to deploy
>> it
>> > on a server and call it as an external tool, if so, how?
>> >
>> > Thanks in advance!
>> > Adei
>> >
>> >
>> > This message should be regarded as confidential. If you have received
>> this email in error please notify the sender and destroy it immediately.
>> Statements of intent shall only become binding when confirmed in hard copy
>> by an authorised signatory.
>> >
>> > Zaizi Ltd is registered in England and Wales with the registration
>> number 6440931. The Registered Office is 203 Westbourne Studios, 242 Acklam
>> Road, London W10 5JJ, UK.
>>
>>
>> --
>> -------------------------------------------------------------------
>> Richard Eckart de Castilho
>> Technical Lead
>> Ubiquitous Knowledge Processing Lab
>> FB 20 Computer Science Department
>> Technische Universität Darmstadt
>> Hochschulstr. 10, D-64289 Darmstadt, Germany
>> phone [+49] (0)6151 16-7477, fax -5455, room S2/02/B117
>> [email protected]
>> www.ukp.tu-darmstadt.de
>> Web Research at TU Darmstadt (WeRC) www.werc.tu-darmstadt.de
>> -------------------------------------------------------------------
>>
>>
>>
>>
>>


This message should be regarded as confidential. If you have received this 
email in error please notify the sender and destroy it immediately. Statements 
of intent shall only become binding when confirmed in hard copy by an 
authorised signatory.

Zaizi Ltd is registered in England and Wales with the registration number 
6440931. The Registered Office is 203 Westbourne Studios, 242 Acklam Road, 
London W10 5JJ, UK.

Reply via email to