9 Feb 14:41
java.lang.NullPointerException when running fast client
Hello!
My UIMA AS client is using UimaAsynchronousEngine for sending messages to
a UIMA pipeline. If the process of sending is fast (with 100 ms delay or
without any delay) the attached exception(java.lang.NullPointerException)
is thrown. Please advice. Thank you.
Regards,
Florin
My code is:
//constructor
Client() {
cas = CasCreationUtils.createCas(uimaTypeDescriptors);
}
//main method
main() {
Client client = new Client();
for (int i = 0; i < 100000; i++) {
System.out.println("Sending message #"+i);
client.sendToUIMA("Test message:"+i);
Thread.sleep(100);
}
}
public void sendToUIMA(String msg) throws Exception {
JCas jcas = cas.getJCas();
jcas.reset();
jcas.setDocumentText(msg);
uimaEEEngine.sendCAS(jcas.getCas());
(Continue reading)
RSS Feed