Hi Tom,

first, let me offer my commiseration regarding the ytex failure.  I think that 
at some point I will write the community for objections and then make it a 
separate build from (primary) ctakes.  I think that your solution of removing 
ytex from the main project on your system is absolutely the correct thing to do 
since you don't want it anyway.

After that, I have only guesses as to what might be going on.  I haven't 
personally had any of the build problems that you are facing.

One thing that I didn't make clear:  You only need to build the 
ctakes-dockhand.jar, not all of ctakes.   But the errors you see are still 
troublesome (especially in docker).

>  [ERROR] Failed to execute goal on project dockhand-rest: Could not resolve 
> dependencies for project org.apache.ctakes:dockhand-rest:war:4.0.1-SNAPSHOT: 
> The following artifacts could not be resolved: 
> org.apache.ctakes:ctakes-tiny-rest:jar:4.0.1-SNAPSHOT, 
> org.apache.ctakes:ctakes-utils:jar:4.0.1-SNAPSHOT, 
> org.apache.ctakes:ctakes-relation-extractor:jar:4.0.1-SNAPSHOT, 
> org.apache.ctakes:ctakes-chunker:jar:4.0.1-SNAPSHOT, 
> org.apache.ctakes:ctakes-dictionary-lookup-fast:jar:4.0.1-SNAPSHOT, 
> org.apache.ctakes:ctakes-constituency-parser:jar:4.0.1-SNAPSHOT, 
> org.apache.ctakes:ctakes-dependency-parser:jar:4.0.1-SNAPSHOT, 
> org.apache.ctakes:ctakes-context-tokenizer:jar:4.0.1-SNAPSHOT: Could not find 
> artifact org.apache.ctakes:ctakes-tiny-rest:jar:4.0.1-SNAPSHOT -> [Help 1]

I don't understand the above error at all.  All of those artifacts do exist.  I 
use them on a (practically) daily basis. Is it possible that you don't have a 
port open or that your docker machine is behind a firewall of some sort?

There is one question that I have for you about the error 

>ERROR] 
>/Users/thomas/projects/ctakes/trunk/ctakes-tiny-rest/src/main/java/org/apache/ctakes/rest/service/TinyController.java:[28,23]
> error: cannot find symbol
[ERROR]   symbol:   class PostConstruct
[ERROR]   location: package javax.annotation

What version of java are you using?  ctakes requires version 8.  
javax.annotation -should- be standard in java 8.  You can try running "javac 
-version".

Sean


________________________________________
From: Thomas W Loehfelm <twloehf...@ucdavis.edu.INVALID>
Sent: Tuesday, June 30, 2020 7:06 PM
To: dev@ctakes.apache.org
Subject: Re: ctakes-tiny-rest - any guidance on running? [EXTERNAL]

* External Email - Caution *


Thank you for the direction, Sean. I ran in to build issues, some addressed on 
prior threads (YTEX related), some that I couldn’t find references to in the 
mailing list archives. I am still stuck not able to complete the docker build 
due to an unresolved dependency. Including the info below in case it is helpful 
to anyone, and in case anyone can help with what (hopefully!) is the final 
error.



Working through Dev install 
guide<https://urldefense.proofpoint.com/v2/url?u=https-3A__cwiki.apache.org_confluence_display_CTAKES_cTAKES-2B4.0-2BDeveloper-2BInstall-2BGuide&d=DwIGaQ&c=qS4goWBT7poplM69zy_3xhKwEW14JZMSdioCoppxeFU&r=fs67GvlGZstTpyIisCYNYmQCP6r0bcpKGd4f7d4gTao&m=pUTbexmiZnykTq7rQgTwZdj0cSAzpWfjzJzMSmD_07c&s=V7soEGQAN0_YigZAyAX_xHg6I72rT0_sx5ggS9ojp2A&e=
 >:

  1.  I get a FAILURE on building cTAKES YTEX

…

[INFO] ctakes-examples-res ................................ SUCCESS [  0.363 s]

[INFO] ctakes-examples .................................... SUCCESS [  1.311 s]

[INFO] Apache cTAKES Resources ctakes-ytex-res ............ SUCCESS [  0.308 s]

[INFO] Apache cTAKES YTEX ................................. FAILURE [  0.717 s]

[INFO] Apache cTAKES YTEX UIMA ............................ SKIPPED

[INFO] Apache cTAKES Tiny Rest Service .................... SKIPPED

[INFO] Apache cTAKES Distribution ......................... SKIPPED

[INFO] Apache cTAKES Regression-test ...................... SKIPPED

[INFO] Apache cTAKES template filler ...................... SKIPPED

[INFO] Apache cTAKES Dockhand ............................. SKIPPED



…

Caused by: java.lang.ClassNotFoundException: 
javax.activation.MimeTypeParseException

                at 
org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)

                at 
org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)

                at 
org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)

                at 
org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)

                ... 51 more

     *   From this 
thread<https://urldefense.proofpoint.com/v2/url?u=http-3A__mail-2Darchives.apache.org_mod-5Fmbox_ctakes-2Ddev_201907.mbox_-253cCALfEtMvGzE9TppFCuLTNdgqzSU5ew5RVkVjUgq19WF3pwNTyRQ-40mail.gmail.com-253e&d=DwIGaQ&c=qS4goWBT7poplM69zy_3xhKwEW14JZMSdioCoppxeFU&r=fs67GvlGZstTpyIisCYNYmQCP6r0bcpKGd4f7d4gTao&m=pUTbexmiZnykTq7rQgTwZdj0cSAzpWfjzJzMSmD_07c&s=1UdlzWnTMDEq7f2ix9ZemrMBvsS4TAo2Kl0i7jOLq_g&e=
 > I tried:

                                                               i.       mvn 
clean install -Dmaven.test.skip=true

           *   I get the same FAILURE and stack trace
     *   From your comment in that same thread (“Wouldn't it be better to 
remove [YTEX]  dependency from the cTAKES core pom.xml…”) I thought I’d try 
removing all references to YTEX from {ctakes_trunk}/pom.xml:

                                                               i.      Comment 
out lines 201-204, 789-807, and 1023

     *   Rerun mvn clean install -Dmaven.test.skip=true

                                                               i.      
Immediate ERROR due to YTEX dependencies in 
ctakes/trunk/ctakes-distribution/pom.xml

     *   Remove references to YTEX from ctakes-distribution/pom.xml

                                                               i.      Comment 
out lines 123-130

     *   Rerun mvn clean install -Dmaven.test.skip=true
  1.  Now I get a FAILURE on cTAKES Tiny Rest Service:

…

[INFO] ctakes-examples-res ................................ SUCCESS [  0.231 s]

[INFO] ctakes-examples .................................... SUCCESS [  0.680 s]

[INFO] Apache cTAKES Tiny Rest Service .................... FAILURE [  0.275 s]

[INFO] Apache cTAKES Distribution ......................... SKIPPED

[INFO] Apache cTAKES Regression-test ...................... SKIPPED

[INFO] Apache cTAKES template filler ...................... SKIPPED

[INFO] Apache cTAKES Dockhand ............................. SKIPPED



                [ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-compiler-plugin:2.4:compile (default-compile) on 
project ctakes-tiny-rest: Compilation failure: Compilation failure:

[ERROR] 
/Users/thomas/projects/ctakes/trunk/ctakes-tiny-rest/src/main/java/org/apache/ctakes/rest/service/TinyController.java:[28,23]
 error: cannot find symbol

[ERROR]   symbol:   class PostConstruct

[ERROR]   location: package javax.annotation

[ERROR] 
/Users/thomas/projects/ctakes/trunk/ctakes-tiny-rest/src/main/java/org/apache/ctakes/rest/service/TinyController.java:[43,4]
 error: cannot find symbol

  1.  I added the following dependency to ctakes/trunk/ctakes-tiny-rest/pom.xml:

<dependency>

<groupId>javax.annotation</groupId>

<artifactId>javax.annotation-api</artifactId>

<version>1.3.2</version>

</dependency>

  1.  …and commented out the <scope>provided</scope> attribute of the 
<groupId>javax.servlet</groupId> dependency in the same file
     *   I did this first, before adding the javax.annotation-api dependency 
mentioned above, and build still failed. I forgot to revert it before applying 
adding that dependency, so don’t know if it helped or not.



  1.  [INFO] 
------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

  1.  I then went through the steps you outlined:
     *   Run the ctakes-dockhand jar
     *   Choose: Rest Server Docker Bundle
     *   Add description
     *   Select pipeline features: [Multiple Sections, Prose Sentences, Tokens, 
Entities, Attributes, Locations, Severities]
     *   Select pipeline outputs: [FHIR, Text, Properties, XMI, CUI List]
     *   Finish -> Add Save To location
     *   cd {save-to location}/repos
     *   docker build -t dockhandtest .

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  3.076 s

[INFO] Finished at: 2020-06-30T22:54:45Z

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal on project dockhand-rest: Could not resolve 
dependencies for project org.apache.ctakes:dockhand-rest:war:4.0.1-SNAPSHOT: 
The following artifacts could not be resolved: 
org.apache.ctakes:ctakes-tiny-rest:jar:4.0.1-SNAPSHOT, 
org.apache.ctakes:ctakes-utils:jar:4.0.1-SNAPSHOT, 
org.apache.ctakes:ctakes-relation-extractor:jar:4.0.1-SNAPSHOT, 
org.apache.ctakes:ctakes-chunker:jar:4.0.1-SNAPSHOT, 
org.apache.ctakes:ctakes-dictionary-lookup-fast:jar:4.0.1-SNAPSHOT, 
org.apache.ctakes:ctakes-constituency-parser:jar:4.0.1-SNAPSHOT, 
org.apache.ctakes:ctakes-dependency-parser:jar:4.0.1-SNAPSHOT, 
org.apache.ctakes:ctakes-context-tokenizer:jar:4.0.1-SNAPSHOT: Could not find 
artifact org.apache.ctakes:ctakes-tiny-rest:jar:4.0.1-SNAPSHOT -> [Help 1]

  1.  From {save-to location}/repos
     *   Edit pom.xml – change ctakes.version from 4.0.1-SNAPSHOT to 4.0.1 
(same error) then to 4.0.0:

<properties>

<ctakes.version>4.0.0</ctakes.version>

</properties>

     *   Rerun docker build -t dockhandtest .: error message improved – only 
one missing dependency now:

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  43.040 s

[INFO] Finished at: 2020-06-30T23:00:38Z

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal on project dockhand-rest: Could not resolve 
dependencies for project org.apache.ctakes:dockhand-rest:war:4.0.1-SNAPSHOT: 
Could not find artifact org.apache.ctakes:ctakes-tiny-rest:jar:4.0.0 in central 
(https://urldefense.proofpoint.com/v2/url?u=https-3A__repo.maven.apache.org_maven2&d=DwIGaQ&c=qS4goWBT7poplM69zy_3xhKwEW14JZMSdioCoppxeFU&r=fs67GvlGZstTpyIisCYNYmQCP6r0bcpKGd4f7d4gTao&m=pUTbexmiZnykTq7rQgTwZdj0cSAzpWfjzJzMSmD_07c&s=pcCpMxdVbxWvYPBx912AgjRUbL5FuLW8RCXHafDNpuM&e=
 ) -> [Help 1]



  1.  And this is where I am stuck. I understand that ctakes-tiny-rest:jar must 
not exist in 4.0.0 or 4.0.1 repositories, but am not sure how to get beyond 
this point.





On 6/26/20, 2:33 PM, "Finan, Sean" <sean.fi...@childrens.harvard.edu> wrote:



    Hi Tom,



    Tiny Rest is not really a standalone deal, but utilization is pretty simple 
once you know what it is for.



    What you can try is:



    Create the jar for ctakes-dockhand using "mvn package".  You can put that 
jar file anywhere, even a system that doesn't have ctakes.



    Run that jar in a graphical environment (ms windows, gnome, etc.).  
Double-click should start it.



    ctakes-dockhand is an installation tool that looks pretty much like any 
"wizard" style installer.  Make selections on each screen, click next, etc.



    Your selection on the first panel should be "docker rest" - or "rest 
docker" or something like that.  I can't remember.



    Then give it some description, create the pipeline that you want, etc.



    After you finish the last panel and click "Finish" a small number of files 
will be created in your chosen directory.   *Note, the tool will not exit by 
iteself.



    If you are familiar with docker, you can use the Dockerfile that is in that 
directory to create an image of a ctakes rest service.



    The docker image contains everything you need and when you run it will 
start a rest service.



    I haven't tried it, but you should also be able to just maven package using 
the pom in that same output directory without docker.  It will create a war 
file.

    If you go without docker then you will need to have a web server (tomcat, 
etc.) and move the war file into the webapps directory or whatever is required 
for that server.



    There is a little demo page that you can launch on a browser.  Just http to 
the ip address (of a VM, docker VM, localhost) with the port 8080 and 
ctakes_tiny_rest.

    For instance:

    
https://urldefense.proofpoint.com/v2/url?u=http-3A__192.168.99.101-3A8080_ctakes-5Ftiny-5Frest&d=DwIGaQ&c=qS4goWBT7poplM69zy_3xhKwEW14JZMSdioCoppxeFU&r=fs67GvlGZstTpyIisCYNYmQCP6r0bcpKGd4f7d4gTao&m=pUTbexmiZnykTq7rQgTwZdj0cSAzpWfjzJzMSmD_07c&s=genox1Kxui9FMmo5ZeAVCeHiwiELuEeSO-y0RqpUYaM&e=



    You can curl or use some other rest client, but you should probably use the 
demo page just to see what it can do.



    To get different output formats you can send with "fhir", "umls", "cui", or 
"xmi".   "pretty" and "property" are works in progress.  The default is fhir 
json.



    Sean





    ________________________________________

    From: Thomas W Loehfelm <twloehf...@ucdavis.edu.INVALID>

    Sent: Friday, June 26, 2020 5:04 PM

    To: dev@ctakes.apache.org

    Subject: ctakes-tiny-rest - any guidance on running? [EXTERNAL]



    * External Email - Caution *





    I was very excited to find the ctakes-tiny-rest package in the svn repo, 
but have not been able to get it stood up.



    What I have tried:



      1.  Cloning the svn repo

      2.  mvn package

      3.  java -cp target/ctakes-tiny-rest-4.0.1-SNAPSHOT.jar 
org.apache.ctakes.rest.service.TinyController

         *   Error: Unable to initialize main class 
org.apache.ctakes.rest.service.TinyController



    Caused by: java.lang.NoClassDefFoundError: 
org/apache/uima/resource/ResourceInitializationException



    I am not very familiar with mvn or with the Spring framework so I suspect I 
am missing something fundamental.



    Is anyone making use of this component and can point me in the right 
direction?



    Thanks for your time and consideration!



    Tom



    Thomas Loehfelm, MD

    UC Davis Medical Center

    Abdominal Radiology

Reply via email to