[ 
https://issues.apache.org/jira/browse/CTAKES-504?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Reed Villanueva updated CTAKES-504:
-----------------------------------
    Description: 
In 
_/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/resource/FileLocator.java_,
 the method _getFileSearchPaths_ makes certain implicit assumptions about where 
to look for resources if environment variable _CTAKES_HOME_ is not set. This 
can cause confusion about where resources should be placed in projects 
attempting to use ctakes library jars, since if they are not in these expected 
locations, the current errors may look like
{code:java}
Exception in thread "main" 06 Apr 2018 00:17:53 ERROR JdbcRareWordDictionary - 
Could not Connect to Dictionary sno_rx_16abTerms
org.apache.uima.resource.ResourceInitializationException: Initialization of 
annotator class 
"org.apache.ctakes.dictionary.lookup2.ae.DefaultJCasTermAnnotator" failed. 
(Descriptor: <unknown>){code}
Which does not inform that the problem is related to *where* the resources/ 
folder has been placed.

I propose adding an additional small bit of output text before the method 
returns, of the form:
{code:java}
LOGGER.info( String.format("Obtained search paths for resource %s:", location) 
);
for (String path : paths) {
  LOGGER.info(path);
}{code}
This way if the code is ever changed, this snippet will be seen by the changee, 
rather than relying on separate documentation keeping in sync with any changes 
in the future.

 

  was:
In 
_/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/resource/FileLocator.java_,
 the method _getFileSearchPaths_ makes certain implicit assumptions about where 
to look for resources if environment variable _CTAKES_HOME_ is not set. This 
can cause confusion about where resources should be placed in projects 
attempting to use ctakes library jars, since if they are not in these expected 
locations, the current errors may look like
{code:java}
Exception in thread "main" 06 Apr 2018 00:17:53 ERROR JdbcRareWordDictionary - 
Could not Connect to Dictionary sno_rx_16abTerms
org.apache.uima.resource.ResourceInitializationException: Initialization of 
annotator class 
"org.apache.ctakes.dictionary.lookup2.ae.DefaultJCasTermAnnotator" failed. 
(Descriptor: <unknown>){code}
Which does not inform that the problem is related to *where* the resources/ 
folder has been placed.

I propose adding an additional small bit of output text before the method 
returns, of the form:
{code:java}
LOGGER.info( String.format("Obtained search paths for resource %s:", location) 
);
for (String path : paths) {
  LOGGER.info(path);
}{code}
 

 


> Add visibility into implicitly expected resource paths in ctakes-core 
> FileLocator.class
> ---------------------------------------------------------------------------------------
>
>                 Key: CTAKES-504
>                 URL: https://issues.apache.org/jira/browse/CTAKES-504
>             Project: cTAKES
>          Issue Type: Improvement
>          Components: ctakes-core
>            Reporter: Reed Villanueva
>            Priority: Trivial
>              Labels: documentation, easyfix
>             Fix For: 4.0.1
>
>   Original Estimate: 5m
>  Remaining Estimate: 5m
>
> In 
> _/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/resource/FileLocator.java_,
>  the method _getFileSearchPaths_ makes certain implicit assumptions about 
> where to look for resources if environment variable _CTAKES_HOME_ is not set. 
> This can cause confusion about where resources should be placed in projects 
> attempting to use ctakes library jars, since if they are not in these 
> expected locations, the current errors may look like
> {code:java}
> Exception in thread "main" 06 Apr 2018 00:17:53 ERROR JdbcRareWordDictionary 
> - Could not Connect to Dictionary sno_rx_16abTerms
> org.apache.uima.resource.ResourceInitializationException: Initialization of 
> annotator class 
> "org.apache.ctakes.dictionary.lookup2.ae.DefaultJCasTermAnnotator" failed. 
> (Descriptor: <unknown>){code}
> Which does not inform that the problem is related to *where* the resources/ 
> folder has been placed.
> I propose adding an additional small bit of output text before the method 
> returns, of the form:
> {code:java}
> LOGGER.info( String.format("Obtained search paths for resource %s:", 
> location) );
> for (String path : paths) {
>   LOGGER.info(path);
> }{code}
> This way if the code is ever changed, this snippet will be seen by the 
> changee, rather than relying on separate documentation keeping in sync with 
> any changes in the future.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to