Hi, From my experience, Ruta is actually thread-safe and use of « strictImports » solves many of the type ambiguities between Ruta and DKPro. In a concurrent environment, you will certainly gain performance by using a JCasPool for creating your CASes
Best, — Hugues de Mazancourt > Le 6 juin 2017 à 15:13, Josep María Formentí Serra <[email protected]> a > écrit : > > Thanks Peter, > >> Could it be that you create the CAS differently in your concurrent >> setting? For example JCasFactory vs ae.newCAS()? > > CAS is created ever using JCasFactory, we revise if there are something > wrong in the reader. > >> Anyways, this exception in this situation (using DKPro Core) is really >> annoying. Did you try to activate strictImports? > > It's really annoying, we have a set of requests to test the web service. If > we execute the set of test with one thread all is ok, no exception, but > when we execute the same set with more than one thread, the exceptions > appears. > >> If this does not help, do you have a minimal reproducible example? > > No, I haven't, I'll check the code and if I don't find the solution, I'll > try to prepare a minimal example to reproduce the problem > > 2017-06-06 11:46 GMT+02:00 Peter Klügl <[email protected]>: > >> Hi, >> >> >> UIMA Ruta should be threadsafe. >> >> >> Could it be that you create the CAS differently in your concurrent >> setting? For example JCasFactory vs ae.newCAS()? >> >> The exception indicates that Ruta cannot resolve the mention "Document" >> correctly since it is an alias of uima.tcas.DocumentAnnotation and the >> short name of the DKPro type. This exception should also occur in a >> non-concurrent setting. >> >> Anyways, this exception in this situation (using DKPro Core) is really >> annoying. Did you try to activate strictImports? >> >> >> If this does not help, do you have a minimal reproducible example? >> >> >> >> Best, >> >> Peter >> >> >> Am 06.06.2017 um 11:03 schrieb Josep María Formentí Serra: >>> Hi all, >>> >>> We are building a web service using directly the RutaEngine, in the >>> inicialization the engine is built as: >>> >>> UIMAFramework.produceAnalysisEngine(AnalysisEngineFactory >>> >>> .createEngineDescription(createEngineDescription(RutaEngine.class, >>> RutaEngine.PARAM_RULES, >>> rule.getRule().getConditions())))); >>> >>> And then we call method *process *passing the *JCas*. >>> >>> All is ok but when we receive concurrent requests, starts to appears >> many >>> exceptions like these: >>> >>> Caused by: java.lang.IllegalArgumentException: Document is ambiguous, >> use >>> one of the following instead : uima.tcas.DocumentAnnotation >>> de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Document >>> at >>> org.apache.uima.ruta.RutaEnvironment.getType(RutaEnvironment.java:459) >>> ~[ruta-core-2.6.0.jar:2.6.0] >>> >>> Caused by: java.lang.NullPointerException: null >>> at java.util.ArrayList.addAll(ArrayList.java:577) ~[na:1.8.0_66] >>> at >>> org.apache.uima.ruta.condition.ImplicitCondition.eval( >> ImplicitCondition.java:70) >>> ~[ruta-core-2.6.0.jar:2.6.0] >>> >>> Is UIMA Ruta thread safe? we are doing something wrong? >>> >>> Thanks in advance, >>> JM >>> >> >> > > > -- > ------------------------------------------------------------------- --- -- > - - - > *Grupo AIA* - *www.aia.es <http://www.aia.es> * > Josep Mª Formentí Serra <[email protected]> > *[email protected] <[email protected]>*Dpto. Servicios Financieros y > Seguros > ESADECREAPOLIS, Sant Cugat, Barcelona > Telf.: +34 93 504 49 00 <+34%20935%2004%2049%2000> Fax.: +34 93 580 21 88 > <+34%20935%2080%2021%2088> > ------------------------------------------------------------------- --- -- > - - - > The information transmitted is intended only for the person or entity to > which it is addressed and may contain confidential and/or privileged > material. Any review, retransmission, dissemination or other use of, or > taking of any action in reliance upon, this information by persons or > entities other than the intended recipient is prohibited. If you received > this in error, please contact the sender and delete the material from any > computer.
