Have you figured this one out? It looks like it's having trouble finding a class that maven should download? Maybe check your .m2/repository directory and see if it has the path org/springframework/spring-beans? Tim
On 04/22/2014 05:54 PM, Liu, Ying wrote: > I installed cTAKES on another computer and ran the same code. I think this > time is not because UMLS username/password. I couldn't figure out why. Thank > you for your help! > Ying > > > Exception in thread "main" java.lang.NoClassDefFoundError: > org/springframework/beans/TypeMismatchException > at > org.uimafit.factory.ResourceCreationSpecifierFactory.createResourceCreationSpecifier(ResourceCreationSpecifierFactory.java:72) > at > org.uimafit.factory.ResourceCreationSpecifierFactory.createResourceCreationSpecifier(ResourceCreationSpecifierFactory.java:96) > at > org.uimafit.factory.CollectionReaderFactory.createCollectionReaderFromPath(CollectionReaderFactory.java:75) > at > org.apache.ctakes.clinicalpipeline.runtime.BagOfAnnotationsGenerator.<init>(BagOfAnnotationsGenerator.java:40) > at > org.apache.ctakes.clinicalpipeline.runtime.BagOfAnnotationsGenerator.<init>(BagOfAnnotationsGenerator.java:36) > at > org.apache.ctakes.clinicalpipeline.runtime.BagOfCUIsGenerator.<init>(BagOfCUIsGenerator.java:16) > at > org.apache.ctakes.clinicalpipeline.runtime.BagOfCUIsGenerator.main(BagOfCUIsGenerator.java:49) > Caused by: java.lang.ClassNotFoundException: > org.springframework.beans.TypeMismatchException > at java.net.URLClassLoader$1.run(Unknown Source) > at java.net.URLClassLoader$1.run(Unknown Source) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(Unknown Source) > at java.lang.ClassLoader.loadClass(Unknown Source) > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) > at java.lang.ClassLoader.loadClass(Unknown Source) > ... 7 more > Caused by: java.util.zip.ZipException: invalid LOC header (bad signature) > at java.util.zip.ZipFile.read(Native Method) > at java.util.zip.ZipFile.access$1400(Unknown Source) > at java.util.zip.ZipFile$ZipFileInputStream.read(Unknown Source) > at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(Unknown Source) > at java.util.zip.InflaterInputStream.read(Unknown Source) > at java.util.jar.Manifest$FastInputStream.fill(Unknown Source) > at java.util.jar.Manifest$FastInputStream.readLine(Unknown Source) > at java.util.jar.Manifest$FastInputStream.readLine(Unknown Source) > at java.util.jar.Attributes.read(Unknown Source) > at java.util.jar.Manifest.read(Unknown Source) > at java.util.jar.Manifest.<init>(Unknown Source) > at java.util.jar.JarFile.getManifestFromReference(Unknown Source) > at java.util.jar.JarFile.getManifest(Unknown Source) > at sun.misc.URLClassPath$JarLoader$2.getManifest(Unknown Source) > at java.net.URLClassLoader.defineClass(Unknown Source) > at java.net.URLClassLoader.access$100(Unknown Source) > ... 14 more > > > > > > ________________________________________ > From: Liu, Ying [[email protected]] > Sent: Wednesday, April 16, 2014 10:57 AM > To: [email protected] > Subject: RE: errors when run BagOfCUIsGenerator.java > > 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 [[email protected]] > Sent: Wednesday, April 16, 2014 10:30 AM > To: [email protected] > 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:[email protected]] > Sent: Wednesday, April 16, 2014 1:25 PM > To: [email protected] > 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:[email protected]] >> Sent: Wednesday, April 16, 2014 1:13 PM >> To: [email protected] >> 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 >> >> >> > > > -- Tim Miller Instructor Boston Children's Hospital and Harvard Medical School [email protected] 617-919-1223
