Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 6CBD3200BBE for ; Fri, 11 Nov 2016 13:05:21 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 6B45D160AF5; Fri, 11 Nov 2016 12:05:21 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3A855160AE4 for ; Fri, 11 Nov 2016 13:05:20 +0100 (CET) Received: (qmail 79371 invoked by uid 500); 11 Nov 2016 12:05:19 -0000 Mailing-List: contact user-help@uima.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@uima.apache.org Delivered-To: mailing list user@uima.apache.org Received: (qmail 79353 invoked by uid 99); 11 Nov 2016 12:05:19 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Nov 2016 12:05:19 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 898C7C7CEC for ; Fri, 11 Nov 2016 12:05:18 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.72 X-Spam-Level: X-Spam-Status: No, score=-1.72 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id XJtvVi9tRNiG for ; Fri, 11 Nov 2016 12:05:12 +0000 (UTC) Received: from mout.web.de (mout.web.de [212.227.17.11]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id AFABF5FC87 for ; Fri, 11 Nov 2016 12:05:11 +0000 (UTC) Received: from g236.tum.vpn.lrz.de ([129.187.100.236]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Ljaiq-1cgRCV3BtY-00bYGR for ; Fri, 11 Nov 2016 13:04:59 +0100 From: Ingo Glaser Content-Type: multipart/alternative; boundary="Apple-Mail=_19D46051-C71B-4505-859B-38423C3C9B3A" Message-Id: <753AB755-C9D2-461C-AE3C-4D5C883A4803@web.de> Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: Error after updating to UIMA Ruta 2.5 Date: Fri, 11 Nov 2016 13:04:59 +0100 References: <7C83DE27-BA41-4473-A5A1-57040458E378@web.de> To: user@uima.apache.org In-Reply-To: X-Mailer: Apple Mail (2.3124) X-Provags-ID: V03:K0:vUZ5kJAzHqHs6YYUEvVaVMbT7XAwhUPUOp9ICF1/wGrnnwOJ6Uv ShhI4CnSi91Ocn9VlwIQ2PV6WPRX9HZB2sJn1XA1Jr9BWNJpKaYMXqNLdlTlyUq6Ox2u9Dn wrE3Tu0YV6AIGR3UqfGWuEtS3LR/8tCfaVQxXYiJ0nFoPomT/sNR2G20P1XElmPiDz0WE8j 1V8ePoU2WjJ++SA5isXqg== X-UI-Out-Filterresults: notjunk:1;V01:K0:a56x7aj/m0k=:eRC0ee0EY+Twm3VgASZLUE kKY7YMzBMR8kf32BygInOTasVjqMz1BaaX3nRRdJuPninFOE3PFIiYItp6hQSnl3X9s4zNWsU ec7F4wSaBv0e2eh1UYMnp7Bv+V7Cpxtf16rSSI8efkcV3a2It2WYmyLxdV4kQtzJZE9WlKh9v 8hiKRAJC2Soy3s+Hp3SWsDJfd8rqBuzpOUJx7JVeC5TEBEipd8AQF23vtXWlUFDpgi/Ow9T3V ZHzXazapqyNRKV/3Y4SI6vlLozjMk4I6WYaHuvtImJp6aTRXcU+XICMdnJUIC18Sb2tGKgLmC QXe4ye8/sPm+aG9URRf/toR5awJFIeJEaKq263kYS2MHuAmPxbnaSQZfaivWyxPtowtJvMmW5 Ccl6emS+eFXXbDzep+K2OdTenDTQF2Vo3RfDB6Vp3jYxfAF7dZdVG5qN9sh8sEwrRAAVpfvmL L8pZ/SjfxBfcw+ngGjPoJFENdbMD9lwIxZHNkfGzCp7a9BKOBtdYwAC1Ca4ZrZBDNgTGkqMMk JVpB6A3uHQli74qXuqbkhNYvT4SukJLTm8AWaGq/iB9kfELyF+wLeoSFTNezZmPAPJkHylQzZ q/BwfzUShaLZANXrJRLZAgyctiDgxbLMkg8JFKcfO3d7OaKEOR61UjzwNf280UrfH50BYOY22 EvC0qh386jhaTU5QCjvsUFx6M/xV7pTNywiK99bPsbYNzWPz4Wed7oJqTwrjykLuZcCKR/7qn rs2w6ZBF9SJjqB1ZRZR2on/Qh9hI/ect7YM0O/rKTs/oxROfro8qyhzr/9yYP+cfIUim1PMYL DXMc39s archived-at: Fri, 11 Nov 2016 12:05:21 -0000 --Apple-Mail=_19D46051-C71B-4505-859B-38423C3C9B3A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Hi Peter, I figured that even when using version 2.5.0, importByLocation is = default for me. I did debug it as well as the import tags in the created = .xml files do have an attribute location.=20 When I was previously talking about the error, this happened during = executing one of my pipelines. Therefore I=92ve used some previously = created descriptors, they did work in version 2.3.0 though. These = descriptors are based on ruta scripts, which do not change anymore. = However, I=92ve also the option to create (or update) a ruta script = manually and then using the application in order to create the proper = descriptor in xml. The weird thing I=92ve just noticed is, when creating = the .xml descriptor from my ruta script, the (or an) error already = occurred when using version 2.3.0, however, the process of creating the = .xml descriptor did not abort. When using version 2.5.0 the creation = process does abort though. Either way, the pipeline with version 2.5.0 = does not work. When running my pipeline, either with the newly created = descriptors (where the error occurs during creation) or with the = existing ones, the process is aborted with the error from my first = message. The error I show you below, actually occurs when running my importer. = Hence I also add the importer. The previous error, as already mentioned = actually occurred when running my pipeline and thus using the fixed = created descriptor. So for now I think it makes more sense, to first = solve the problem with creating the descriptor from my ruta scripts. I = think afterwards I can solve the other issue as well, since they somehow = relate to each other. Below I=92d like to give you some more information, also according to = your request: The _APP_TypeSystem.xml is stored in the following path relative to the = project root /app/informationExtraction/appTypes/ Furthermore I do have a directory /app/rutaComponents with the following = content ./descriptor (Fixed descriptors) ./generatedComponents (Dynamic components) ./descriptor ./resources ./script ./resources ./script (Fixed scripts) ./scriptImporter (Importer for dynamic and new scripts) With the script importer, I can import scripts from = ./generatedComponents/script in order to create a descriptor in = ./generatedComponents/descriptor - Complete error: org.apache.uima.ruta.extensions.RutaParseRuntimeException: = org.apache.uima.ruta.extensions.RutaParseRuntimeException: = org.apache.uima.ruta.extensions.RutaParseRuntimeException: = org.apache.uima.ruta.extensions.RutaParseRuntimeException: = java.lang.RuntimeException: Cannot resolve imports in _APP_TypeSystem at = org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:39= 7) at = org.apache.uima.ruta.parser.RutaParser.file_input(RutaParser.java:733) at = org.apache.uima.ruta.descriptor.RutaDescriptorFactory.parseDescriptorInfor= mation(RutaDescriptorFactory.java:146) at = rutaComponents.scriptImporter.RutaComponentGenerator.generate(RutaComponen= tGenerator.java:79) at = controllers.RutaController.saveRutaFile(RutaController.java:91) at = Routes$$anonfun$routes$1$$anonfun$applyOrElse$82$$anonfun$apply$82.apply(r= outes_routing.scala:1494) at = Routes$$anonfun$routes$1$$anonfun$applyOrElse$82$$anonfun$apply$82.apply(r= outes_routing.scala:1494) at = play.core.Router$HandlerInvokerFactory$$anon$4.resultCall(Router.scala:264= ) at = play.core.Router$HandlerInvokerFactory$JavaActionInvokerFactory$$anon$15$$= anon$1.invocation(Router.scala:255) at play.core.j.JavaAction$$anon$1.call(JavaAction.scala:55) at play.GlobalSettings$1.call(GlobalSettings.java:67) at play.core.j.JavaAction$$anonfun$11.apply(JavaAction.scala:82) at play.core.j.JavaAction$$anonfun$11.apply(JavaAction.scala:82) at = scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Futur= e.scala:24) at = scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24= ) at = play.core.j.HttpExecutionContext$$anon$2.run(HttpExecutionContext.scala:40= ) at = play.api.libs.iteratee.Execution$trampoline$.execute(Execution.scala:46) at = play.core.j.HttpExecutionContext.execute(HttpExecutionContext.scala:32) at scala.concurrent.impl.Future$.apply(Future.scala:31) at scala.concurrent.Future$.apply(Future.scala:485) at play.core.j.JavaAction$class.apply(JavaAction.scala:82) at = play.core.Router$HandlerInvokerFactory$JavaActionInvokerFactory$$anon$15$$= anon$1.apply(Router.scala:252) at = play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4$$anonfun$apply$5.app= ly(Action.scala:130) at = play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4$$anonfun$apply$5.app= ly(Action.scala:130) at play.utils.Threads$.withContextClassLoader(Threads.scala:21) at = play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4.apply(Action.scala:1= 29) at = play.api.mvc.Action$$anonfun$apply$1$$anonfun$apply$4.apply(Action.scala:1= 28) at scala.Option.map(Option.scala:145) at play.api.mvc.Action$$anonfun$apply$1.apply(Action.scala:128) at play.api.mvc.Action$$anonfun$apply$1.apply(Action.scala:121) at = play.api.libs.iteratee.Iteratee$$anonfun$mapM$1.apply(Iteratee.scala:483) at = play.api.libs.iteratee.Iteratee$$anonfun$mapM$1.apply(Iteratee.scala:483) at = play.api.libs.iteratee.Iteratee$$anonfun$flatMapM$1.apply(Iteratee.scala:5= 19) at = play.api.libs.iteratee.Iteratee$$anonfun$flatMapM$1.apply(Iteratee.scala:5= 19) at = play.api.libs.iteratee.Iteratee$$anonfun$flatMap$1$$anonfun$apply$14.apply= (Iteratee.scala:496) at = play.api.libs.iteratee.Iteratee$$anonfun$flatMap$1$$anonfun$apply$14.apply= (Iteratee.scala:496) at = scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Futur= e.scala:24) at = scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24= ) at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:41) at = akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractD= ispatcher.scala:393) at = scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at = scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java= :1339) at = scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at = scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.ja= va:107) Caused by: org.apache.uima.ruta.extensions.RutaParseRuntimeException: = org.apache.uima.ruta.extensions.RutaParseRuntimeException: = org.apache.uima.ruta.extensions.RutaParseRuntimeException: = java.lang.RuntimeException: Cannot resolve imports in _APP_TypeSystem at = org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:39= 7) at = org.apache.uima.ruta.parser.RutaParser.globalStatements(RutaParser.java:89= 1) at = org.apache.uima.ruta.parser.RutaParser.file_input(RutaParser.java:714) ... 42 more Caused by: org.apache.uima.ruta.extensions.RutaParseRuntimeException: = org.apache.uima.ruta.extensions.RutaParseRuntimeException: = java.lang.RuntimeException: Cannot resolve imports in _APP_TypeSystem at = org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:39= 7) at = org.apache.uima.ruta.parser.RutaParser.globalStatement(RutaParser.java:929= ) at = org.apache.uima.ruta.parser.RutaParser.globalStatements(RutaParser.java:87= 0) ... 43 more Caused by: org.apache.uima.ruta.extensions.RutaParseRuntimeException: = java.lang.RuntimeException: Cannot resolve imports in _APP_TypeSystem at = org.apache.uima.ruta.parser.RutaParser.emitErrorMessage(RutaParser.java:39= 7) at = org.apache.uima.ruta.parser.RutaParser.importStatement(RutaParser.java:260= 9) at = org.apache.uima.ruta.parser.RutaParser.globalStatement(RutaParser.java:916= ) ... 44 more Caused by: java.lang.RuntimeException: Cannot resolve imports in = _APP_TypeSystem at = org.apache.uima.ruta.RutaEnvironment.importPackageFromTypeSystem(RutaEnvir= onment.java:594) at = org.apache.uima.ruta.parser.RutaParser.importPackage(RutaParser.java:548) at = org.apache.uima.ruta.parser.RutaParser.importStatement(RutaParser.java:256= 5) ... 45 more Caused by: org.apache.uima.util.InvalidXMLException: An import could not = be resolved. No file with name "_APP_TypeSystem.xml" was found in the = class path or data path. (Descriptor: ) at = org.apache.uima.resource.metadata.impl.Import_impl.findAbsoluteUrl(Import_= impl.java:122) at = org.apache.uima.resource.metadata.impl.TypeSystemDescription_impl.resolveI= mports(TypeSystemDescription_impl.java:230) at = org.apache.uima.resource.metadata.impl.TypeSystemDescription_impl.resolveI= mports(TypeSystemDescription_impl.java:210) at = org.apache.uima.ruta.RutaEnvironment.importPackageFromTypeSystem(RutaEnvir= onment.java:592) ... 47 more - This is the relevant code of the importer: public class RutaComponentGenerator { public static String GENERATED_COMPONENTS_PATH =3D "app" + = File.separator + "rutaComponents" + File.separator + = "generatedComponents" + File.separator; /** * The path where the script will be written **/ public static String SCRIPT_OUTPUT_PATH =3D = GENERATED_COMPONENTS_PATH + "script" + File.separator; /** * The path where the generated *TypeSystem.xml will be written **/ private File typeSystemOutputDirectory =3D new = File(GENERATED_COMPONENTS_PATH + "descriptor"); /** * The path where the generated *Engine.xml will be written **/ private File analysisEngineOutputDirectory =3D new = File(GENERATED_COMPONENTS_PATH + "descriptor"); // The paths where other relevant scripts descriptors, and resources = are private String[] scriptPaths =3D new String[]{"app" + File.separator = + "rutaComponents" + File.separator + "script", = GENERATED_COMPONENTS_PATH + "script"}; private String[] descriptorPaths =3D new String[]{"app" + = File.separator + "rutaComponents" + File.separator + "descriptor", = GENERATED_COMPONENTS_PATH + "descriptor", "app" + File.separator + = "informationExtraction" + File.separator + "lexiaTypes"}; private String[] resourcePaths =3D new String[]{"app" + = File.separator + "rutaComponents" + File.separator + "resources", = GENERATED_COMPONENTS_PATH + "resources"}; /** * Prepares Generates the XML files needed for the AnalysisEngine = and the TypeSystem of the new RUTA component * * @param scriptName The file name of the script for which the = RUTA-component shall be generated */ public void generate(String scriptName) { if (!typeSystemOutputDirectory.exists()) { typeSystemOutputDirectory.mkdirs(); } if (!analysisEngineOutputDirectory.exists()) { analysisEngineOutputDirectory.mkdirs(); } RutaDescriptorFactory factory =3D null; try { factory =3D new RutaDescriptorFactory("app" + File.separator = + "rutaComponents" + File.separator + "descriptor" + File.separator + = "BasicTypeSystem.xml", "app" + File.separator + "rutaComponents" + = File.separator + "descriptor" + File.separator + "BasicEngine.xml"); } catch (MalformedURLException e) { e.printStackTrace(); } RutaBuildOptions options =3D new RutaBuildOptions(); options.setEncoding("UTF-8"); options.setResolveImports(true); // ToDo: Ensure that Mercurial-controlled scripts can't be = rebuilt with this mechanism (for security reasons) // ToDo: Ensure that the filename is unique for all scripts File scriptToBuild =3D new File(SCRIPT_OUTPUT_PATH + scriptName = + ".ruta"); try { RutaDescriptorInformation descriptorInformation =3D = factory.parseDescriptorInformation(scriptToBuild, options); String packageString =3D ""; String engineOutput =3D new = File(analysisEngineOutputDirectory, packageString + = descriptorInformation.getScriptName() + = options.getAnalysisEngineSuffix() + ".xml").getAbsolutePath(); String typeSystemOutput =3D new = File(typeSystemOutputDirectory, packageString + = descriptorInformation.getScriptName() + options.getTypeSystemSuffix() + = ".xml").getAbsolutePath(); Pair = descriptions =3D factory.createDescriptions(engineOutput, = typeSystemOutput, descriptorInformation, options, scriptPaths, = descriptorPaths, resourcePaths); write(descriptions.getKey(), engineOutput); write(descriptions.getValue(), typeSystemOutput); } catch (RecognitionException re) { System.err.println("Failed to parse UIMA Ruta script file: " = + scriptToBuild.getAbsolutePath()); re.printStackTrace(); } catch (IOException ioe) { System.err.println("Failed to load UIMA Ruta script file: " = + scriptToBuild.getAbsolutePath()); ioe.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } } private void write(XMLizable desc, String aFilename) throws = SAXException, IOException { OutputStream os =3D null; try { File out =3D new File(aFilename); out.getParentFile().mkdirs(); os =3D new FileOutputStream(out); Logger.info("Debug info: Writing descriptor to: " + out); desc.toXML(os); } finally { IOUtils.closeQuietly(os); } } } - Again some sample imports I=92m using: // Import types IMPORT PACKAGE de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos FROM = _LEXIA_TypeSystem AS pos; I=92d really appreciate any help and thanks so much in advance! Best, Ingo > On 10 Nov 2016, at 16:33, Peter Kl=FCgl = wrote: >=20 > Hi, >=20 > this should work just like in 2.3.0. However, there are some changes > (and a bug concerning the datapath). >=20 > I assume that you use the ruta-maven-plugin to create the descriptors? > Did you use import-by-location before? I think the default changed to > import-by-name. >=20 > true >=20 > You can switch the import back to import-by-location in the plugin > configuration (set it to false), but I rather recommend to use > import-by-name in maven built projects. > In order to do this, you best place the type system descriptor in the > classpath. If you do not want to refer to the type system with = package, > place it directly in the classpath root, e.g., in src/main/resources. >=20 > In case of a DKPro Core type system, add the artifact as a dependency = if > not done yet and change your import to: >=20 > IMPORT PACKAGE de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos = FROM > desc.type.POS AS pos; >=20 > Then, you do not need to copy anything since the typesystem is = directly > loaded from the dependency (the jar in the m2 repo). >=20 > btw, there is an up-to-date example project for the integration of = DKPro > Core in Ruta scripts: > = https://github.com/pkluegl/ruta/tree/master/ruta-german-novel-with-dkpro >=20 > In case this did not solve your problem: How did you import the > typesystem before? > - Is the type system located in the root of the classpath? > - Did you specify descriptorPaths in the configuration parameters? > - Have you set the datapath? >=20 > Best, >=20 > Peter >=20 >=20 > Am 10.11.2016 um 15:57 schrieb Ingo Glaser: >> Hey guys, >>=20 >> I recently updated from Apache UIMA Ruta version 2.3.0 to 2.5.0. = However, after the upgrade, my application does not run anymore, due to = some error in the ruta scripts. I get the following error: >>=20 >> Caused by: org.apache.uima.util.InvalidXMLException: An import could = not be resolved. No file with name "_APP_TypeSystem.xml" was found in = the class path or data path. (Descriptor: ) >> at = org.apache.uima.resource.metadata.impl.Import_impl.findAbsoluteUrl(Import_= impl.java:115) >> at = org.apache.uima.resource.metadata.impl.TypeSystemDescription_impl.resolveI= mports(TypeSystemDescription_impl.java:228) >> at = org.apache.uima.resource.metadata.impl.TypeSystemDescription_impl.resolveI= mports(TypeSystemDescription_impl.java:208) >> at = org.apache.uima.ruta.RutaEnvironment.importPackageFromTypeSystem(RutaEnvir= onment.java:592) >> ... 67 more >> I assume that's because of the import within my ruta script. Do you = have any idea, if and how the way we import something in a script has = changed from version 2.3 to 2.5? >>=20 >> I do import like this: >>=20 >> IMPORT PACKAGE de.tudarmstadt.ukp.dkpro.core.api.lexmorph.type.pos = FROM _APP_TypeSystem AS pos; >>=20 >> Thanks already in advance for your help! >>=20 >>=20 >>=20 >>=20 >=20 --Apple-Mail=_19D46051-C71B-4505-859B-38423C3C9B3A--