Hi,
I am trying to use UIMA as a Web Service and I have successfully
deployed UIMA analysis engine SOAP service using Axis and Tomcat but
when I tried to use Resource Specifier to call Deployed UIMA Web Service
, It gave an Exception as following :
org.apache.uima.resource.ResourceInitializationException: The Resource
Factory does not know how to create a resource of class
org.apache.uima.analysis_engine.AnalysisEngine from the given
ResourceSpecifier. (Descriptor: file:/media/.../rr.xml)
at
org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:261)
at
org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:326)
at
org.orkash.java_applications.RunWebService.main(RunWebService.java:23)
The Descriptor used to call UIMA Soap Service is given below (rr.xml):
<uriSpecifier>
<resourceType>AnalysisEngine</resourceType>
<uri>http://localhost:8080/axis/services/urn:PersonTitleAnnotator</uri>
<protocol>SOAP</protocol>
<timeout>60000</timeout>
</uriSpecifier>
And the Resource Specifier class contains this code to call Deployed
UIMA Soap Service :
File taeDescriptor = new File("/media/.../rr.xml");
File inputFile = new File("/home/user/38434924.txt");
XMLInputSource in = new XMLInputSource(taeDescriptor);
ResourceSpecifier specifier =
UIMAFramework.getXMLParser().parseResourceSpecifier(in);
// create Analysis Engine and jCAS
AnalysisEngine tae =
UIMAFramework.produceAnalysisEngine(specifier);
JCas jcas = tae.newJCas();
// read contents of file
FileInputStream fis = new FileInputStream(inputFile);
byte[] contents = new byte[(int) inputFile.length()];
fis.read(contents);
fis.close();
String document = new String(contents);
// send doc through jcas
jcas.setDocumentText(document);
tae.process(jcas);
Please Help me out with this.
Thanks in Advance.
--
Reshu Agarwal