If you unpack the LVG resources onto your classpath, then LvgAnnotator
won't copy them to /tmp, it'll use them from where it found them
(see the top of LvgAnnotator.createAnnotatorDescription).  That's
what I'm doing -- unpacking it in advance so that you get
SOME.CLASSPATH.DIR\org\apache\ctakes\lvg\data\config\lvg.properties.

As far as I can tell, the resources need to be unpacked somewhere -- you can't
use them directly from a jar -- because it's forking an external
program to use them (see LvgCmdApiResourceImpl.load).

The LVG database handling code is a complete mess.
https://issues.apache.org/jira/browse/CTAKES-445 tracks one part of the
problem.  If you're using cTakes from trunk you may want to revert
commit 1810271, depending on which platforms you're running on.

HTH,

Ewan.

On Wed, Mar 28, 2018 at 12:12:46AM -0700, Michael Trepanier wrote:

> Hi All,
> I am attempting to package cTAKES in a jar while while avoiding it copying
> the lvg related files to /tmp/ as it does
> in 
> /ctakes/trunk/ctakes-lvg/src/main/java/org/apache/ctakes/lvg/ae/LvgAnnotator.java.
> Everything works up until cTAKES tries to path the lvg.properties file
> within the jar down to gov.nih.nlm.nls.lvg.Lib.SetConfiguration, where
> the code attempts to create a FileInputStream from a resource contained
> within a jar, which throws the below exception. 
> ** Configuration Error:
> jar:file:\D:\ctakes\ctakes-local\lib\ctakes-assembly-4.0.jar!\org\apache\ctakes\lvg\data\config\lvg.properties
> (The filename, directory name, or volume label syntax is incorrect)
> ** Error: problem of opening/reading config file:
> 'jar:file:\D:\ctakes\ctakes-local\lib\ctakes-assembly-4.0.jar!\org\apache\ctakes\lvg\data\config\lvg.properties'.
> Use -x option to specify the config file path.
> While I likely can't avoid the above scenario without changing cTAKES'
> dependencies, I was wondering two things:
> 1) If it would be possible to set the LVG_DIR to a non absolute path
> instead of AUTO_MODE and have it function properly?
> 2) Oddly enough, despite logging this error, cTAKES appears to be running
> fine locally. Should I not be concerned about these configuration errors
> as they don't seem to be impacting anything? Is there a downstream way I
> can check that the properties file is being correctly read? Or is cTAKES
> chugging through the default pipeline evidence enough that I need not
> worry?
> Best,
> Mike
> --
> MetiStream Logo - 500
> Mike Trepanier| Big Data Engineer | MetiStream, Inc. |
>  m...@metistream.com | 845 - 270 - 3129 (m) | www.metistream.com


Reply via email to