Hi Peter,

I thought that you could tell me where this temp dir is comming from. But as 
you did not I now suspect that it's related to the CPE. The CPE builder is 
materializing all descriptors into a temp dir. So the whole problem is most 
likely caused by some resources referenced in a descriptor but not copied in 
the temp dir.

Cheers,
Armin



-----Ursprüngliche Nachricht-----
Von: Peter Klügl [mailto:peter.klu...@averbis.com] 
Gesendet: Dienstag, 6. Oktober 2015 10:17
An: user@uima.apache.org
Betreff: Re: Ruta Maven Plugin

Hi Armin,

best switch to 2.3.1 as soon as possible. 2.3.0 was the first version of
the ruta-maven-plugin and the 2.3.1 release provides some important
bugfixes for it. I personally had some problems with two executions with
different configurations, but I don't think that this has something to
do with your problem.

If the switch to the newer version does not help, then can you give me
more information about the layout of your project, e.g, do you use packages?

I assume that the type system import of the generated analysis engine
descriptor refers to "file:/tmp/DateTypeSystem.xml". Is this a
reasonable location in your application, e.g., did you copy the
descriptor there? Is tmp a package name or has to something to do with
your working directory?

Best,

Peter

Am 06.10.2015 um 10:06 schrieb armin.weg...@bka.bund.de:
> Hi Peter,
>
> this helped a little bit, but it is still not running. I had to add the 
> resources section to the pom.
>
> ...
>       <build>
>               <resources>
>                       <resource>
>                               <directory>src/main/ruta</directory>
>                       </resource>
>                       <resource>
>                               <directory>src/main/resources</directory>
>                       </resource>
>                       <resource>
>                               
> <directory>${project.build.directory}/generated-sources/ruta/descriptor</directory>
>                       </resource>
>                       <resource>
>                               
> <directory>${project.build.directory}/generated-sources/ruta/resources</directory>
>                       </resource>
>               </resources>
>               <plugins>
>                       ...
>                       <plugin>
>                               <groupId>org.apache.uima</groupId>
>                               <artifactId>ruta-maven-plugin</artifactId>
>                               <version>2.3.0</version>
>                               <executions>
>                                       <execution>
>                                               <id>descriptors</id>
>                                               
> <phase>generate-resources</phase>
>                                               <goals>
>                                                       <goal>generate</goal>
>                                               </goals>
>                                               <configuration>
>                                               </configuration>
>                                       </execution>
>                                       <execution>
>                                               <id>twl</id>
>                                               
> <phase>generate-resources</phase>
>                                               <goals>
>                                                       <goal>twl</goal>
>                                               </goals>
>                                               <configuration>
>                                                       <inputFiles>
>                                                               
> <directory>${basedir}/src/main/resources/</directory>
>                                                               <includes>
>                                                                       
> <include>*.txt</include>
>                                                               </includes>
>                                                       </inputFiles>
>                                               </configuration>
>                                       </execution>
>                               </executions>
>                       </plugin>
>               </plugins>
>       </build>
> ...
>
> DateEngine.xml, DateTypeSystem.xml, and Date.ruta as well as the twl file are 
> generated and packaged in the jar file.
>
> But the CPE throws following exception:
>
> ...
> Caused by: org.apache.uima.resource.ResourceConfigurationException: 
> Initialization of CAS Processor with name "aggregate" failed.  
>       at 
> org.apache.uima.collection.impl.cpm.container.CPEFactory.produceIntegratedCasProcessor(CPEFactory.java:1102)
>       at 
> org.apache.uima.collection.impl.cpm.container.CPEFactory.getCasProcessors(CPEFactory.java:548)
>       at 
> org.apache.uima.collection.impl.cpm.BaseCPMImpl.init(BaseCPMImpl.java:253)
>       at 
> org.apache.uima.collection.impl.cpm.BaseCPMImpl.<init>(BaseCPMImpl.java:127)
>       at 
> org.apache.uima.collection.impl.CollectionProcessingEngine_impl.initialize(CollectionProcessingEngine_impl.java:73)
>       ... 5 more
> Caused by: org.apache.uima.resource.ResourceInitializationException: Import 
> failed.  Could not read from URL file:/tmp/DateTypeSystem.xml. (Descriptor: 
> file:/tmp/desc6822394770076871542.xml)
>       at 
> org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initialize(AggregateAnalysisEngine_impl.java:162)
>       at 
> org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(AnalysisEngineFactory_impl.java:94)
>       at 
> org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:62)
>       at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:279)
>       at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:331)
>       at 
> org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:448)
>       at 
> org.apache.uima.collection.impl.cpm.container.CPEFactory.produceIntegratedCasProcessor(CPEFactory.java:1086)
>       ... 9 more
> ...
>
> Do you have any suggestions?
>
> Regards,
> Armin
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Peter Klügl [mailto:peter.klu...@averbis.com] 
> Gesendet: Montag, 5. Oktober 2015 17:56
> An: user@uima.apache.org
> Betreff: Re: Ruta Maven Plugin
>
> Hi,
>
> there is no step-by-step description yet, only the part of the
> documentation here:
> https://uima.apache.org/d/ruta-current/tools.ruta.book.html#ugr.tools.ruta.maven
>
> There are some examples of maven configurations:
> https://svn.apache.org/repos/asf/uima/ruta/trunk/example-projects/ruta-maven-example
> https://svn.apache.org/repos/asf/uima/ruta/trunk/ruta-maven-plugin/src/it/multimodule
> https://svn.apache.org/repos/asf/uima/ruta/trunk/ruta-maven-plugin/src/it/importByName
>
> My best guess without knowing your maven configuration/pom is that the
> phase of the ruta-maven-plugin needs to be changed. Did you use:
>
> <id>descriptors</id>
> <phase>process-classes</phase>
> <goals>
> <goal>generate</goal>
> </goals>
>
> if yes, try:
>
> <id>descriptors</id>
> <phase>generate-resources</phase>
> <goals>
> <goal>generate</goal>
> </goals>
>
> If that solves the problem, then please accept my apologies... I will
> adapt the documentation. There was actually a reason why I used
> process-classes in the first place...
>
> Best,
>
> Peter
>
>
> Am 05.10.2015 um 17:20 schrieb armin.weg...@bka.bund.de:
>> Hi,
>>
>> how ist ruta-maven-plugin supposed to be used? Is there a detailed step by 
>> step description?
>>
>> I've created a new empty maven project, added a script in the source folder 
>> src/main/ruta and a text file containing a list of words to 
>> src/main/resources.
>> mvn package builds a ...Engine.xml and a ...TypeSystem.xml in 
>> target/generated-sources/ruta/descriptor and a ...twl file in 
>> target/ruta/resources. But none of them is packaged in the jar file.
>>
>> I intend to add that jar file as a maven dependency and create the analysis 
>> engine by AnalysisEngineFactory.createEngineDescription(<engine name>). Did 
>> I miss something?
>>
>> Regards,
>> Armin
>>

Attachment: pgp8n4tv4ohAZ.pgp
Description: PGP signature

Reply via email to