David, here is another uima-as snapshot for you to test https://repository.apache.org/content/repositories/snapshots/org/apache/uima/uima-as/2.9.0-SNAPSHOT/uima-as-2.9.0-20160923.152659-5.tar.gz
I have not tested the fix. All I did was to modify quiesceAndStop() and terminate() to catch SocketException and log a message. This code no longer dumps a stack trace nor re-throws an exception. Let me know if this addresses the problem and I will close the JIRA -jerry On Fri, Sep 23, 2016 at 10:24 AM, Jaroslaw Cwiklik <uim...@gmail.com> wrote: > David, so there is progress. :) > > I am not familiar with UimacppServiceController code but a quick glance at > the source > suggests that this code communicates with a C++ process via a socket: > > > if (socket != null) { > // System.out.println("UimacppServiceManagement::quiesceAndStop() > // Sending QUIESCEANDSTOP"); > writer.write("QUIESCEANDSTOP"); > writer.flush(); > BufferedReader in = new BufferedReader(new InputStreamReader(socket. > getInputStream())); > > It tells the C++ to quiesce and exit which apparently it does very > quickly. It looks like > > writer.write("QUIESCEANDSTOP"); > > succeeded, but the code fails here > > BufferedReader in = new BufferedReader(new InputStreamReader(socket. > getInputStream())); > which means that the C++ socket is dead (process exited) > > It seems that the code should tolerate such condition and not "scream" > Exception :) > > I think a try catch should be added around this code and on > SocketException we should just log some informative > message like "Remote process socket closed - It may have terminated" or > something similar to that. > > So this does not seem like a critical error although this should be > cleaned up. > > -jerry > > On Fri, Sep 23, 2016 at 9:41 AM, David Fox <david....@humedica.com> wrote: > >> I was able to install that, and I’m not getting the NullPointerException. >> The example annotator still runs successfully, but now I get >> ------------------------------------------------------------ >> --------------- >> >> Attempting to deploy descriptors/Deploy_MeetingAnnotator.xml ... >> Waiting for Uima C++ service to connect... >> Waiting for Uima C++ service to connect... >> Waiting for Uima C++ service to report init status... >> deployCppService.cpp91 Start receiving messages >> >> Startinging GetMetaData instance >> >> Starting Annotator instance 0 >> >> deployCppService.cpp UIMA C++ Service MeetingAnnotator at >> tcp://localhost:61616 Ready to process... >> >> Uima C++ service at MeetingAnnotator Ready to process... >> UIMA AS Service Initialization Complete >> ........Completed 8 documents; 17165 characters >> Time Elapsed : 3705 ms >> 0 8 apr_socket_recv command=SHUTDOWN >> >> deployCppService.cpp Shutdown started. >> >> Stopping GetMetaData instance >> >> Stopping Annotator instance 0 >> >> deployCppService.cpp Shutdown done. >> >> UimacppServiceManagement service reports shutdown DONE >> UimacppShutdownHook sending quiesce message >> java.net.SocketException: Socket is closed >> at java.net.Socket.getInputStream(Socket.java:903) >> at >> org.apache.uima.aae.controller.UimacppServiceManagement.quie >> sceAndStop(Uima >> cppServiceManagement.java:88) >> at >> org.apache.uima.aae.controller.UimacppServiceManagement.quie >> sceAndShutdown( >> UimacppServiceManagement.java:397) >> at >> org.apache.uima.aae.controller.UimacppShutdownHook.run(Uimac >> ppServiceContro >> ller.java:1105) >> UimacppShutdownHook destroy C++ process >> >> ――――― >> >> I’ve attached the uima.log >> >> On 9/22/16, 3:54 PM, "Jaroslaw Cwiklik" <uim...@gmail.com> wrote: >> >> >David, I've deployed uima-as 2.9.0-SNAPSHOT here: >> > >> >https://urldefense.proofpoint.com/v2/url?u=https-3A__ >> repository.apache.org >> >_content_repositories_snapshots_org_apache_uima_uima-2Das_ >> 2.9.0-2DSNAPSHOT >> >_&d=DQIFaQ&c=3XrKki35ZWuh8X2qbeRISQ&r=BYS7q6K6Famz8NiMJzvOg >> YA-WQSvBt9z6TEb >> >aT3nnNM&m=NnQy2jfAk4Dyg-uijgdjHHbg6pxfdvwDkCn3166fVc8&s= >> y7GSTfzyEzhkYgFGy1 >> >vLLmDJ82il_hzMP7Y4LQjuBPg&e= >> > >> >there is a binary tarball (tar.gz) in there. >> > >> >This is a trunk level uima-as code for the upcoming 2.9.0 uima-as >> release. >> >It has not been thoroughly >> >tested or vetted yet. It has some fixes and improvements since 2.8.1. It >> >includes a new AMQ broker >> >version 5.14.0. It also has a fix for the problem you've reported. >> > >> >-jerry >> > >> > >> >On Thu, Sep 22, 2016 at 3:15 PM, Jaroslaw Cwiklik <uim...@gmail.com> >> >wrote: >> > >> >> Another possibility is to deploy a snapshot in a public maven repo. >> >> Hopefully you can get the binary tarball >> >> onto your machines somehow. I will to do that know and let you know >> >>where >> >> to get this. >> >> >> >> -jerry >> >> >> >> On Thu, Sep 22, 2016 at 3:01 PM, David Fox <david....@humedica.com> >> >>wrote: >> >> >> >>> Building from svn on our linux machines is a bit tricky, because they >> >>>are >> >>> cut off from the internet by a firewall, and maven install wants >> >>>internet >> >>> access to download dependencies. It looks like there are workarounds >> >>>for >> >>> that >> >>> >> >>>(https://urldefense.proofpoint.com/v2/url?u=http-3A__ >> stackoverflow.com_q >> >>>uestions_7233328_how-2Ddo-2Di-2Dconfigu&d=DQIFaQ&c=3XrKki >> 35ZWuh8X2qbeRIS >> >>>Q&r=BYS7q6K6Famz8NiMJzvOgYA-WQSvBt9z6TEbaT3nnNM&m=NnQy2jf >> Ak4Dyg-uijgdjHH >> >>>bg6pxfdvwDkCn3166fVc8&s=sk4NjHKmY1SCj4WAEH0A59C50xulbEthh1b5K5egbv0&e= >> >>> re-maven-for-of >> >>> fline-development >> >>> >> >>><https://urldefense.proofpoint.com/v2/url?u=http-3A__ >> stackoverflow.com_q >> >>>uestions_7233328_how-2Ddo-2Di-2Dconfigure-2Dmaven-2Dfor-2 >> Doffline-2Ddeve >> >>>lopment&d=DQIFaQ&c=3XrKki35ZWuh8X2qbeRISQ&r=BYS7q6K6Famz8 >> NiMJzvOgYA-WQSv >> >>>Bt9z6TEbaT3nnNM&m=NnQy2jfAk4Dyg-uijgdjHHbg6pxfdvwDkCn3166 >> fVc8&s=pMHCokJs >> >>>jTNk_XvWxddISyww6QBt65VZmeVGKLTLK94&e= > >> >>> suggests Artifactory), but it may take a day or two >> >>> before I can get everything set up. >> >>> >> >>> I could build it on my dev machine (OS X), but with the binary >> >>>install, I >> >>> wasn’t able to get the sample UIMA C++ code to build on Mac OS X. (My >> >>> eventual plan is to get linux on my dev machine via virtual box, but >> >>>that >> >>> means more software to install…) >> >>> >> >>> So anyway, I’ll try to get this working so I can build from svn before >> >>>the >> >>> fix, reproduce the problem, and then update and verify the fix. >> >>> >> >>> Thanks, >> >>> David >> >>> >> >>> On 9/22/16, 1:23 PM, "Jaroslaw Cwiklik" <uim...@gmail.com> wrote: >> >>> >> >>> >I think I see the bug. Do you know how to build uima-as from svn? >> >>> > >> >>> >https://urldefense.proofpoint.com/v2/url?u=https-3A__uima. >> >>> apache.org_build >> >>> >ing-2Duima.html&d=DQIFaQ&c=3XrKki35ZWuh8X2qbeRISQ&r=BYS7q6K >> >>> 6Famz8NiMJzvOgY >> >>> >A-WQSvBt9z6TEbaT3nnNM&m=9Hf7csP-1jIlxx_vgB3QA47yh0w3i1- >> >>> XbVER8KQmhT8&s=Gin5 >> >>> >am-lATmbl6WQFmZrKwjxKa3tiL1qz1ykFh0cdWI&e= >> >>> > >> >>> >I will fix this shortly in the svn trunk. The next release of uima-as >> >>> >(2.9.0) is in the >> >>> >works. I will get a release candidate out hopefully next week. >> >>> > >> >>> >-jerry >> >>> > >> >>> >On Thu, Sep 22, 2016 at 12:08 PM, David Fox <david....@humedica.com> >> >>> >wrote: >> >>> > >> >>> >> Thanks for the quick response >> >>> >> >> >>> >> Yes, it occurs every time, at the same line in RunRemoteAsyncAE and >> >>> >> org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngine_ >> >>> >> impl.undeploy(BaseUIMAAsynchronousEngine_impl.java:964) >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> On 9/22/16, 11:15 AM, "Jaroslaw Cwiklik" <uim...@gmail.com> wrote: >> >>> >> >> >>> >> >This warning >> >>> >> > >> >>> >> >WARN Transport - Transport Connection to: >> >>>tcp:// >> >>> >> >127.0.0.1:56261 failed: java.io.EOFException >> >>> >> > >> >>> >> >is from brokers log or console I suspect. It just means that the >> >>> broker >> >>> >> >lost a connection to a client. Looks like the client >> >>> >> >went away without closing a connection. This is probably a >> >>>side-effect >> >>> >>of >> >>> >> >NPE. >> >>> >> > >> >>> >> >Is the NPE repeatable? Does it happen each time you run this test? >> >>> >>Looking >> >>> >> >for a hint if there is a race >> >>> >> >condition in the UIMA-AS code. >> >>> >> > >> >>> >> > >> >>> >> > >> >>> >> >On Thu, Sep 22, 2016 at 10:54 AM, David Fox >> >>><david....@humedica.com> >> >>> >> >wrote: >> >>> >> > >> >>> >> >> I¹m using the UIMA C++ framework 2.4.0 (32-bit) on linux (CentOS >> >>> >>6.5), >> >>> >> >>and >> >>> >> >> following the instructions >> >>> >> >>https://urldefense.proofpoint.com/v2/url?u=https- >> >>> >> 3A__uima.apache.org_d_&d >> >>> >> >>=DQIFaQ&c=3XrKki35ZWuh8X2qbeRISQ&r=BYS7q6K6Famz8NiMJzvOgYA- >> >>> >> WQSvBt9z6TEbaT >> >>> >> >>3nnNM&m=dFZSJENJkyCDLeCQuBn89fBrTrsdKh4RIWwwPV7r0o8&s= >> CaIoLZ_7Je- >> >>> >> TYsr0ZIP >> >>> >> >>xs98mHRestzC4RtgVSp7kJaY&e= >> >>> >> >> uimacpp-2.4.0/docs/overview_and_setup.html. I¹ve successfully >> >>> built >> >>> >> >> DaveDetector and run it with the standalone C++ pipeline >> >>>(runAECpp) >> >>> >>and >> >>> >> >> within a Java pipeline via JNI. I¹ve now installed UIMA AS >> >>>2.8.1 so >> >>> >>I >> >>> >> >>can >> >>> >> >> follow the instructions under 2.3 Testing Interoperability with >> >>>UIMA >> >>> >>AS >> >>> >> >> >> >>> >> >> >> >>> >> >> cd $UIMACPP_HOME/examples/tutorial >> >>> >> >> runRemoteAsyncAE.sh tcp://localhost:61616 MeetingAnnotator \ >> >>> >> >> -d descriptors/Deploy_MeetingAnnotator.xml >> >>> >> >> >> >>> >> >> >> >>> >> >> I get a NullPointerException and a transport warning about a >> >>> >> >> java.io.EOFException >> >>> >> >> >> >>> >> >> >> >>> >> >> runRemoteAsyncAE.sh tcp://localhost:61616 MeetingAnnotator -d >> >>> >> >> descriptors/Deploy_MeetingAnnotator.xml -o `pwd`/out >> >>> >> >> >> >>> >> >> Attempting to deploy descriptors/Deploy_MeetingAnnotator.xml >> ... >> >>> >> >> >> >>> >> >> Waiting for Uima C++ service to connect... >> >>> >> >> >> >>> >> >> Waiting for Uima C++ service to connect... >> >>> >> >> >> >>> >> >> Waiting for Uima C++ service to report init status... >> >>> >> >> >> >>> >> >> deployCppService.cpp91 Start receiving messages >> >>> >> >> >> >>> >> >> >> >>> >> >> Startinging GetMetaData instance >> >>> >> >> >> >>> >> >> >> >>> >> >> Starting Annotator instance 0 >> >>> >> >> >> >>> >> >> >> >>> >> >> deployCppService.cpp UIMA C++ Service MeetingAnnotator at >> >>> >> >> tcp://localhost:61616 Ready to process... >> >>> >> >> >> >>> >> >> >> >>> >> >> Uima C++ service at MeetingAnnotator Ready to process... >> >>> >> >> >> >>> >> >> UIMA AS Service Initialization Complete >> >>> >> >> >> >>> >> >> .Completed 1 documents >> >>> >> >> >> >>> >> >> Time Elapsed : 2184 ms >> >>> >> >> >> >>> >> >> java.lang.NullPointerException >> >>> >> >> >> >>> >> >> at >> >>> >> >>org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngine_ >> >>> >> >> impl.undeploy(BaseUIMAAsynchronousEngine_impl.java:964) >> >>> >> >> >> >>> >> >> at >> >>> >> >>org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngine_ >> >>> >> >> impl.undeploy(BaseUIMAAsynchronousEngine_impl.java:906) >> >>> >> >> >> >>> >> >> at org.apache.uima.examples.as.RunRemoteAsyncAE.run( >> >>> >> >> RunRemoteAsyncAE.java:260) >> >>> >> >> >> >>> >> >> at org.apache.uima.examples.as.RunRemoteAsyncAE.main( >> >>> >> >> RunRemoteAsyncAE.java:314) >> >>> >> >> >> >>> >> >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native >> >>> >>Method) >> >>> >> >> >> >>> >> >> at sun.reflect.NativeMethodAccessorImpl.invoke( >> >>> >> >> NativeMethodAccessorImpl.java:62) >> >>> >> >> >> >>> >> >> at sun.reflect.DelegatingMethodAccessorImpl.invoke( >> >>> >> >> DelegatingMethodAccessorImpl.java:43) >> >>> >> >> >> >>> >> >> at java.lang.reflect.Method.invoke(Method.java:497) >> >>> >> >> >> >>> >> >> at org.apache.uima.bootstrap.UimaBootstrap.main( >> >>> >> >> UimaBootstrap.java:87) >> >>> >> >> >> >>> >> >> WARN Transport - Transport Connection to: >> >>> >>tcp:// >> >>> >> >> 127.0.0.1:56221 failed: java.io.EOFException >> >>> >> >> >> >>> >> >> I'm >> >>> >> >> I can also run with a collection reader: >> >>> >> >> >> >>> >> >> >> >>> >> >> runRemoteAsyncAE.sh tcp://localhost:61616 MeetingAnnotator -d >> >>> >> >> descriptors/Deploy_MeetingAnnotator.xml -o `pwd`/out -c >> >>> >> >> /misc/NLP/dfox/scratch/uima/apache-uima-as-2.8.1/examples/ >> >>> >> >> descriptors/collection_reader/FileSystemCollectionReader.min >> e.xml >> >>> >> >> >> >>> >> >> (where the modified collection reader points to >> >>> >> >>$UIMA_HOME/examples/data) >> >>> >> >> in which case I get ³Completed 8 documents², and xmi output for >> >>>each >> >>> >>in >> >>> >> >>the >> >>> >> >> out/ directory, but still get the same exception and warning. >> >>>Based >> >>> >>on >> >>> >> >> that (plus looking at the RunRemoteAsyncAE java source), it >> looks >> >>> >>like >> >>> >> >>my >> >>> >> >> analysis engine is running fine, but then hitting some problem >> >>>when >> >>> >> >> RunRemoteAsyncAE tries to undeploy the C++ annotator. >> >>> >> >> >> >>> >> >> I¹m trying to figure out if this is something I should worry >> >>>about >> >>> >> >> (especially if it reflects a problem with running UIMA C++ 2.4 >> >>>and >> >>> >>UIMA >> >>> >> >>AS >> >>> >> >> 2.8.1), or if it is normal or harmless. >> >>> >> >> >> >>> >> >> When I run the similar test with one of the Java-only UIMA AS >> >>> >>samples: >> >>> >> >> >> >>> >> >> >> >>> >> >> runRemoteAsyncAE.sh tcp://localhost:61616 >> >>>MeetingDetectorTaeQueue -d >> >>> >> >> deploy/as/Deploy_MeetingDetectorTAE.xml -c >> >>> >> >>descriptors/collection_reader/ >> >>> >> >> FileSystemCollectionReader.mine.xml >> >>> >> >> >> >>> >> >> I still get the transport warning >> >>> >> >> >> >>> >> >> >> >>> >> >> WARN Transport - Transport Connection to: >> >>> >>tcp:// >> >>> >> >> 127.0.0.1:56261 failed: java.io.EOFException >> >>> >> >> >> >>> >> >> but not the NullPointerException >> >>> >> >> >> >>> >> >> Thanks, >> >>> >> >> David >> >>> >> >> >> >>> >> >> >> >>> >> >> >> >>> >> >> >> >>> >> >> >> >>> >> >> >> >>> >> >> >>> >> >> >>> >> >>> >> >> >> >> >