Hi, I'm not an expert in this part of UIMA, but here are some things to check. If I recall correctly, the sample "run" code you are referring to has, on line 17 approx, the code ... new XMLInputSource(instPear.getComponentPearDescPath())
Can you verify what valueinstPear.getComponentPearDescPath() is returning? It should be a path to a file on your disk, and that file should look like: <?xml version="1.0" encoding="UTF-8"?> <pearSpecifier xmlns="http://uima.apache.org/resourceSpecifier"> <pearPath> --- here would be a path to a directory where the pear was installed in your environment </pearPath> </pearSpecifier> And then, if that looks ok, at that spot, there should be some directories and a top level .xml file whose name ends with _pear. One of the top level directories is called "metadata", and it should have an setenv.txt file, which should have a line CLASSPATH=.... If that looks ok, see if the value of the CLASSPATH looks right - that's where Java is trying to load the class org.apache.uima.annotator.WhitespaceTokenizer and returning no-such-class found error message. -Marshall On 6/7/2013 11:49 AM, harshal patni wrote: > Hi, > I created a PEAR file for whitespace tokenizer. I installed the pear > using the Java code given in the link below (Pear API). It successfully > installed. Now when I run this using the code on the same page, it throws > an error given below. I made sure the whitespacetokenizer libraries are > present in the lib folder. What's interesting is that I dont get any errors > when I install. It seems to find the jars and loads them onto the > classpath. but when I run it fails. > > > *LINK * - > http://uima.apache.org/d/uimaj-2.3.1/references.html#ugr.ref.pear.installing_pear_using_API > > > > > *ERROR* > ////////////////////////////////////////////////////////////////////////////////////////////////////////////// > > Jun 7, 2013 8:42:02 AM PackageInstaller installPackage > > INFO: Package installer message: [InstallationController]: extracting > /Users/h/Desktop/whitespacetokenizer.pear > > [InstallationController]: 47160 bytes extracted > > > Jun 7, 2013 8:42:02 AM PackageInstaller installPackage > > INFO: Package installer message: [InstallationProcessor]: start processing > InsD file - /Users/h/Desktop/temp/WhiteSpaceTokenizer/metadata/install.xml > > > Jun 7, 2013 8:42:02 AM PackageInstaller installPackage > > INFO: Package installer message: [InstallationController]: the > metadata/setenv.txt file contains required environment variables for this > component > > [InstallationController]: component WhiteSpaceTokenizer installation > completed. > > > Jun 7, 2013 8:42:02 AM WhitespaceTokenizer initialize > > INFO: "Whitespace tokenizer successfully initialized" > > Jun 7, 2013 8:42:03 AM PackageInstaller installPackage > > INFO: Installation verification of component WhiteSpaceTokenizer > successfully completed. > > org.apache.uima.resource.ResourceInitializationException: Error > initializing > "org.apache.uima.analysis_engine.impl.PearAnalysisEngineWrapper" from > descriptor > file:/Users/h/Desktop/temp/WhiteSpaceTokenizer/WhiteSpaceTokenizer_pear.xml. > > at org.apache.uima.util.SimpleResourceFactory.produceResource( > SimpleResourceFactory.java:144) > > at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource( > CompositeResourceFactory_impl.java:62) > > at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:269) > > at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:314) > > at org.apache.uima.UIMAFramework.produceAnalysisEngine( > UIMAFramework.java:425) > > at com.zynx.galen.uima.execute.PearExecuter.execute(PearExecuter.java:43) > > at com.zynx.galen.uima.execute.PearExecuter.<init>(PearExecuter.java:17) > > at com.zynx.galen.uima.execute.PearExecuter.main(PearExecuter.java:58) > > Caused by: org.apache.uima.resource.ResourceInitializationException: > Annotator class "org.apache.uima.annotator.WhitespaceTokenizer" was not > found. (Descriptor: > file:/Users/h/Desktop/temp/WhiteSpaceTokenizer/desc/WhitespaceTokenizer.xml) > > at > org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initializeAnalysisComponent( > PrimitiveAnalysisEngine_impl.java:207) > > at > org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initialize( > PrimitiveAnalysisEngine_impl.java:156) > > at org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource( > AnalysisEngineFactory_impl.java:94) > > at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource( > CompositeResourceFactory_impl.java:62) > > at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:269) > > at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:314) > > at org.apache.uima.UIMAFramework.produceAnalysisEngine( > UIMAFramework.java:425) > > at > org.apache.uima.analysis_engine.impl.PearAnalysisEngineWrapper.initialize( > PearAnalysisEngineWrapper.java:269) > > at org.apache.uima.util.SimpleResourceFactory.produceResource( > SimpleResourceFactory.java:123) > > ... 7 more > > Caused by: java.lang.ClassNotFoundException: > org.apache.uima.annotator.WhitespaceTokenizer > > at java.net.URLClassLoader$1.run(URLClassLoader.java:202) > > at java.security.AccessController.doPrivileged(Native Method) > > at java.net.URLClassLoader.findClass(URLClassLoader.java:190) > > at java.lang.ClassLoader.loadClass(ClassLoader.java:306) > > at org.apache.uima.internal.util.UIMAClassLoader.loadClass( > UIMAClassLoader.java:151) > > at java.lang.ClassLoader.loadClass(ClassLoader.java:247) > > at > org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.initializeAnalysisComponent( > PrimitiveAnalysisEngine_impl.java:201) > > ... 15 more > > > > > Harshal >
