ctakes-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Liu, Ying" <L...@advisory.com>
Subject RE: errors when run BagOfCUIsGenerator.java
Date Wed, 16 Apr 2014 17:57:40 GMT
Sorry bother the email list. The problem is caused by my VPN connection. I connected to VPN
and it didn't allow me to access any other website. So, my UMLS username and password didn't
get through. 

Thanks,
Ying


________________________________________
From: Finan, Sean [Sean.Finan@childrens.harvard.edu]
Sent: Wednesday, April 16, 2014 10:30 AM
To: dev@ctakes.apache.org
Subject: RE: errors when run BagOfCUIsGenerator.java

Try to open  https://uts-ws.nlm.nih.gov
If that works then try https://uts-ws.nlm.nih.gov/restful/isValidctakes.umlsuser and see if
you get a message like
"This XML file does not appear to have any style information associated with it. The document
tree is shown below."


If that works and you are comfortable with the code, try with
umlsaddr : https://uts-ws.nlm.nih.gov/restful/isValidctakes.umlsuser
vendor : NLM-6515182895


   /**
    * @param umlsaddr -
    * @param vendor   -
    * @param username -
    * @param password -
    * @return true if the server at umlsaddr approves of the vendor, user, password combination
    */
   public static boolean isValidUMLSUser( final String umlsaddr, final String vendor,
                                          final String username, final String password ) {
      String data;
      try {
         data = URLEncoder.encode( "licenseCode", "UTF-8" ) + "=" + URLEncoder.encode( vendor,
"UTF-8" );
         data += "&" + URLEncoder.encode( "user", "UTF-8" ) + "=" + URLEncoder.encode(
username, "UTF-8" );
         data += "&" + URLEncoder.encode( "password", "UTF-8" ) + "=" + URLEncoder.encode(
password, "UTF-8" );
      } catch ( UnsupportedEncodingException unseE ) {
         LOGGER.error( "Could not encode URL for " + username + " with vendor license " +
vendor );
         return false;
      }
      try {
         final URL url = new URL( umlsaddr );
         final URLConnection connection = url.openConnection();
         connection.setDoOutput( true );
         final OutputStreamWriter writer = new OutputStreamWriter( connection.getOutputStream()
);
         writer.write( data );
         writer.flush();
         boolean result = false;
         final BufferedReader reader = new BufferedReader( new InputStreamReader( connection.getInputStream()
) );
         String line;
         while ( (line = reader.readLine()) != null ) {
            final String trimline = line.trim();
            if ( trimline.isEmpty() ) {
               break;
            }
            result = trimline.equalsIgnoreCase( "<Result>true</Result>" );
         }
         writer.close();
         reader.close();
         return result;
      } catch ( IOException ioE ) {
         LOGGER.error( ioE.getMessage() );
         return false;
      }
   }



-----Original Message-----
From: Chen, Pei [mailto:Pei.Chen@childrens.harvard.edu]
Sent: Wednesday, April 16, 2014 1:25 PM
To: dev@ctakes.apache.org
Subject: RE: errors when run BagOfCUIsGenerator.java

Ying,
Are you behind a proxy or firewall?
If you're trying to use the umls resources, it attempts to make a call to their umls service
to validate your credentials.
--Pei

> -----Original Message-----
> From: Liu, Ying [mailto:LiuY@advisory.com]
> Sent: Wednesday, April 16, 2014 1:13 PM
> To: dev@ctakes.apache.org
> Subject: errors when run BagOfCUIsGenerator.java
>
> It failed when run BagOfCUIsGenerator.java. The followings are the
> error information. Thanks for your help.
> Ying
>
>
>
> Exception in thread "main"
> org.apache.uima.resource.ResourceInitializationException:
> Initialization of annotator class
> "org.apache.ctakes.dictionary.lookup.ae.UmlsDictionaryLookupAnnotator"
> failed.  (Descriptor:
> file:/C:/Users/Ying/workspacectakes/ctakes/ctakes-
> dictionary-
> lookup/desc/analysis_engine/DictionaryLookupAnnotatorUMLS.xml)
>     at
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.init
> ialize
> AnalysisComponent(PrimitiveAnalysisEngine_impl.java:252)
>     at
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.init
> ialize
> (PrimitiveAnalysisEngine_impl.java:156)
>     at
> org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(Analys
> i
> sEngineFactory_impl.java:94)
>     at
> org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(C
> ompositeResourceFactory_impl.java:62)
>     at
> org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:
> 269)
>     at
> org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework
> .java:387)
>     at
> org.apache.uima.analysis_engine.asb.impl.ASB_impl.setup(ASB_impl.java:
> 25
> 4)
>     at
> org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.init
> AS
> B(AggregateAnalysisEngine_impl.java:431)
>     at
> org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.init
> ializ
> eAggregateAnalysisEngine(AggregateAnalysisEngine_impl.java:375)
>     at
> org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.init
> ializ
> e(AggregateAnalysisEngine_impl.java:185)
>     at
> org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(Analys
> i
> sEngineFactory_impl.java:94)
>     at
> org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(C
> ompositeResourceFactory_impl.java:62)
>     at
> org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:
> 269)
>     at
> org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework
> .java:354)
>     at
> org.uimafit.factory.AnalysisEngineFactory.createAnalysisEngineFromPath
> (An
> alysisEngineFactory.java:147)
>     at
> org.apache.ctakes.clinicalpipeline.runtime.BagOfAnnotationsGenerator.<
> init
> >(BagOfAnnotationsGenerator.java:42)
>     at
> org.apache.ctakes.clinicalpipeline.runtime.BagOfAnnotationsGenerator.<
> init
> >(BagOfAnnotationsGenerator.java:36)
>     at
> org.apache.ctakes.clinicalpipeline.runtime.BagOfCUIsGenerator.<init>(B
> agOf
> CUIsGenerator.java:16)
>     at
> org.apache.ctakes.clinicalpipeline.runtime.BagOfCUIsGenerator.main(Bag
> Of
> CUIsGenerator.java:49)
> Caused by: org.apache.uima.resource.ResourceInitializationException
>     at
> org.apache.ctakes.dictionary.lookup.ae.UmlsDictionaryLookupAnnotator.i
> niti
> alize(UmlsDictionaryLookupAnnotator.java:79)
>     at
> org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.init
> ialize
> AnalysisComponent(PrimitiveAnalysisEngine_impl.java:250)
>     ... 18 more
> Caused by: java.net.ConnectException: Connection timed out: connect
>     at java.net.DualStackPlainSocketImpl.connect0(Native Method)
>     at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
>     at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
>     at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
>     at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
>     at java.net.PlainSocketImpl.connect(Unknown Source)
>     at java.net.SocksSocketImpl.connect(Unknown Source)
>     at java.net.Socket.connect(Unknown Source)
>     at sun.security.ssl.SSLSocketImpl.connect(Unknown Source)
>     at sun.security.ssl.BaseSSLSocketImpl.connect(Unknown Source)
>     at sun.net.NetworkClient.doConnect(Unknown Source)
>     at sun.net.www.http.HttpClient.openServer(Unknown Source)
>     at sun.net.www.http.HttpClient.openServer(Unknown Source)
>     at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
>     at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
>     at
> sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNew
> HttpClient(Unknown Source)
>     at
> sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown
> Source)
>     at
> sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(
> Unknown Source)
>     at
> sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknow
> n Source)
>     at
> sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Un
> known Source)
>     at
> org.apache.ctakes.dictionary.lookup.ae.UmlsDictionaryLookupAnnotator.i
> sV
> alidUMLSUser(UmlsDictionaryLookupAnnotator.java:93)
>     at
> org.apache.ctakes.dictionary.lookup.ae.UmlsDictionaryLookupAnnotator.i
> niti
> alize(UmlsDictionaryLookupAnnotator.java:70)
>     ... 19 more
>
>
>



Mime
View raw message