tmills / ctakes-docker

Apache License 2.0
23 stars 18 forks source link

Fail to run CAS #29

Closed rashed0120 closed 5 years ago

rashed0120 commented 6 years ago

When i load the remoteNoDeid.xml file, i got a following error, Could you please help me to solve the problem?

org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngine_impl.(142): INFO: UIMA Version 2.9.0 UIMA-AS Version 2.9.0 org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngine_impl.notifyOnInitializationFailure: WARNING: Top Level Controller Initialization Exception. javax.jms.JMSException: Could not connect to broker URL: tcp://localhost:61616. Reason: java.net.ConnectException: Connection refused (Connection refused) at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:36) at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:374) at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:304) at org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:244) at org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngineCommon_impl$SharedConnection.create(BaseUIMAAsynchronousEngineCommon_impl.java:3134) at org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngine_impl.createAndInitializeAMQConnection(BaseUIMAAsynchronousEngine_impl.java:445) at org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngine_impl.createSharedConnection(BaseUIMAAsynchronousEngine_impl.java:508) at org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngine_impl.initialize(BaseUIMAAsynchronousEngine_impl.java:829) at org.apache.uima.aae.jms_adapter.JmsAnalysisEngineServiceStub.(JmsAnalysisEngineServiceStub.java:172) at org.apache.uima.aae.jms_adapter.JmsAnalysisEngineServiceAdapter.initialize(JmsAnalysisEngineServiceAdapter.java:47) at org.apache.uima.impl.CustomResourceFactory_impl.produceResource(CustomResourceFactory_impl.java:92) at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:62) at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:279) at org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:407) at org.apache.uima.analysis_engine.asb.impl.ASB_impl.setup(ASB_impl.java:256) at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initASB(AggregateAnalysisEngine_impl.java:429) at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initializeAggregateAnalysisEngine(AggregateAnalysisEngine_impl.java:373) at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initialize(AggregateAnalysisEngine_impl.java:186) 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:279) at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:331) at org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:448) at org.apache.uima.tools.cvd.MainFrame.setupAE(MainFrame.java:1486) at org.apache.uima.tools.cvd.MainFrame.loadAEDescriptor(MainFrame.java:476) at org.apache.uima.tools.cvd.control.AnnotatorOpenEventHandler.actionPerformed(AnnotatorOpenEventHandler.java:52) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.AbstractButton.doClick(AbstractButton.java:376) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:842) at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:886) at java.awt.Component.processMouseEvent(Component.java:6533) at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) at java.awt.Component.processEvent(Component.java:6298) at java.awt.Container.processEvent(Container.java:2238) at java.awt.Component.dispatchEventImpl(Component.java:4889) at java.awt.Container.dispatchEventImpl(Container.java:2296) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4897) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4534) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4475) at java.awt.Container.dispatchEventImpl(Container.java:2282) at java.awt.Window.dispatchEventImpl(Window.java:2746) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90) at java.awt.EventQueue$4.run(EventQueue.java:733) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.awt.EventQueue.dispatchEvent(EventQueue.java:730) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) Caused by: java.net.ConnectException: Connection refused (Connection refused) at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at org.apache.activemq.transport.tcp.TcpTransport.connect(TcpTransport.java:525) at org.apache.activemq.transport.tcp.TcpTransport.doStart(TcpTransport.java:488) at org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:55) at org.apache.activemq.transport.AbstractInactivityMonitor.start(AbstractInactivityMonitor.java:168) at org.apache.activemq.transport.InactivityMonitor.start(InactivityMonitor.java:52) at org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:64) at org.apache.activemq.transport.WireFormatNegotiator.start(WireFormatNegotiator.java:72) at org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:64) at org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:64) at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:354) ... 62 more

org.apache.uima.tools.cvd.MainFrame.handleException(526): SEVERE: Unexpected Exception thrown when initializing Custom Resource "org.apache.uima.aae.jms_adapter.JmsAnalysisEngineServiceAdapter" from descriptor "file:/home/subjectglance/ctakes-docker-master/desc/docker-fast-dictionary.xml". org.apache.uima.resource.ResourceInitializationException: Unexpected Exception thrown when initializing Custom Resource "org.apache.uima.aae.jms_adapter.JmsAnalysisEngineServiceAdapter" from descriptor "file:/home/subjectglance/ctakes-docker-master/desc/docker-fast-dictionary.xml". at org.apache.uima.impl.CustomResourceFactory_impl.produceResource(CustomResourceFactory_impl.java:94) at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:62) at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:279) at org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:407) at org.apache.uima.analysis_engine.asb.impl.ASB_impl.setup(ASB_impl.java:256) at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initASB(AggregateAnalysisEngine_impl.java:429) at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initializeAggregateAnalysisEngine(AggregateAnalysisEngine_impl.java:373) at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initialize(AggregateAnalysisEngine_impl.java:186) 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:279) at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:331) at org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:448) at org.apache.uima.tools.cvd.MainFrame.setupAE(MainFrame.java:1486) at org.apache.uima.tools.cvd.MainFrame.loadAEDescriptor(MainFrame.java:476) at org.apache.uima.tools.cvd.control.AnnotatorOpenEventHandler.actionPerformed(AnnotatorOpenEventHandler.java:52) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.AbstractButton.doClick(AbstractButton.java:376) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:842) at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:886) at java.awt.Component.processMouseEvent(Component.java:6533) at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) at java.awt.Component.processEvent(Component.java:6298) at java.awt.Container.processEvent(Container.java:2238) at java.awt.Component.dispatchEventImpl(Component.java:4889) at java.awt.Container.dispatchEventImpl(Container.java:2296) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4897) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4534) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4475) at java.awt.Container.dispatchEventImpl(Container.java:2282) at java.awt.Window.dispatchEventImpl(Window.java:2746) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90) at java.awt.EventQueue$4.run(EventQueue.java:733) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.awt.EventQueue.dispatchEvent(EventQueue.java:730) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) Caused by: org.apache.uima.resource.ResourceInitializationException at org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngine_impl.initialize(BaseUIMAAsynchronousEngine_impl.java:884) at org.apache.uima.aae.jms_adapter.JmsAnalysisEngineServiceStub.(JmsAnalysisEngineServiceStub.java:172) at org.apache.uima.aae.jms_adapter.JmsAnalysisEngineServiceAdapter.initialize(JmsAnalysisEngineServiceAdapter.java:47) at org.apache.uima.impl.CustomResourceFactory_impl.produceResource(CustomResourceFactory_impl.java:92) ... 53 more Caused by: javax.jms.JMSException: Could not connect to broker URL: tcp://localhost:61616. Reason: java.net.ConnectException: Connection refused (Connection refused) at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:36) at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:374) at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:304) at org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:244) at org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngineCommon_impl$SharedConnection.create(BaseUIMAAsynchronousEngineCommon_impl.java:3134) at org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngine_impl.createAndInitializeAMQConnection(BaseUIMAAsynchronousEngine_impl.java:445) at org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngine_impl.createSharedConnection(BaseUIMAAsynchronousEngine_impl.java:508) at org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngine_impl.initialize(BaseUIMAAsynchronousEngine_impl.java:829) ... 56 more Caused by: java.net.ConnectException: Connection refused (Connection refused) at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at org.apache.activemq.transport.tcp.TcpTransport.connect(TcpTransport.java:525) at org.apache.activemq.transport.tcp.TcpTransport.doStart(TcpTransport.java:488) at org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:55) at org.apache.activemq.transport.AbstractInactivityMonitor.start(AbstractInactivityMonitor.java:168) at org.apache.activemq.transport.InactivityMonitor.start(InactivityMonitor.java:52) at org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:64) at org.apache.activemq.transport.WireFormatNegotiator.start(WireFormatNegotiator.java:72) at org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:64) at org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:64) at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:354) ... 62 more

tmills commented 6 years ago

Checking it out. It's possible the de-id instructions are out of date, so I'll try to reproduce and fix if necessary. Thanks for reporting.

tmills commented 6 years ago

Can you tell me what OS you're running on?

tmills commented 6 years ago

@rashed0120 : I think I'm getting a similar error in my work's network, and the issue is that docker is creating the containers in a subnet with ip address 172..., which also happens to be how my work's wifi assigns ip addresses. So the broker host was set to my laptop's ip, which the pipeline container thought should be within its own subnet, and couldn't find it. I verified this on my home network, where my laptop was given an IP address in 192.168..*, and everything worked as expected based on the README.

One way to debug this is to run the pipeline container in interactive mode: docker run -v ~/ctakes-docker-clean/log:/log --env-file env_file.txt -it ctakes-as-pipeline and the exception I saw when it wasn't working was much more informative -- it said it couldn't connect to the activemq server. That is probably the root of the problem, that the networking issues can get complex when running them all on the same machine, and you just need to make sure the pipeline container has a route to the broker container.

rashed0120 commented 5 years ago

@tmills I am using Ubuntu in VM machine.

rashed0120 commented 5 years ago

@tmills after follow you instruction i got connection refused msg, like following :+1: Could not refresh JMS Connection for destination 'queue://myQueueName' - silently retrying in 5 ms. Cause: Could not connect to broker URL: tcp://192.168...........61616. Reason: java.net.ConnectException: Connection refused (Connection refused).

Any thoughts?

tmills commented 5 years ago

It's possible it can't even see that machine (that was my problem). If you run the pipeline container as so: docker run -v ~/ctakes-docker-clean/log:/log --env-file env_file.txt -it ctakes-as-pipeline sh it will open into a shell, and then try ping <broker ip address> to see if it's even visible from within the pipeline container.

rashed0120 commented 5 years ago

@tmills after ping the in the shell, i got msg: Press 'q'+'Enter' to quiesce and stop the service or 's'+'Enter' to stop it now. Note: selected option is not echoed on the console.

tmills commented 5 years ago

It looks like maybe you didn't get to the shell. When you run the command above (make sure to include the 'sh' at the end), it should dump you into a command line. What you're seeing is it's starting up the uima collection reader automatically.

rashed0120 commented 5 years ago

@tmills I checked if there is a server listening to port 61616. It is not listening, i don't know why it is not listening.

tmills commented 5 years ago

You can do the same trick with the broker container at startup to catch any error messages: docker run -v ~/ctakes-docker-clean/log:/log --env-file env_file.txt -it amq-image

rashed0120 commented 5 years ago

@tmills the IP address pinging, got transmitted and received the packet msg.

rashed0120 commented 5 years ago

@tmills Here is the log: INFO: Loading '/apache-activemq-5.14.5/bin/env' INFO: Using java '/usr/lib/jvm/java-1.8-openjdk/bin/java' INFO: Starting in foreground, this is just for debugging purposes (stop process by pressing CTRL+C) INFO: Creating pidfile /apache-activemq-5.14.5/data/activemq.pid Java Runtime: Oracle Corporation 1.8.0_171 /usr/lib/jvm/java-1.8-openjdk/jre Heap sizes: current=62976k free=58698k max=932352k JVM args: -Xms64M -Xmx1G -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=/apache-activemq-5.14.5/conf/login.config -Dcom.sun.management.jmxremote -Djava.awt.headless=true -Djava.io.tmpdir=/apache-activemq-5.14.5/tmp -Dactivemq.classpath=/apache-activemq-5.14.5/conf:/apache-activemq-5.14.5/../lib/: -Dactivemq.home=/apache-activemq-5.14.5 -Dactivemq.base=/apache-activemq-5.14.5 -Dactivemq.conf=/apache-activemq-5.14.5/conf -Dactivemq.data=/apache-activemq-5.14.5/data Extensions classpath: [/apache-activemq-5.14.5/lib,/apache-activemq-5.14.5/lib/camel,/apache-activemq-5.14.5/lib/optional,/apache-activemq-5.14.5/lib/web,/apache-activemq-5.14.5/lib/extra] ACTIVEMQ_HOME: /apache-activemq-5.14.5 ACTIVEMQ_BASE: /apache-activemq-5.14.5 ACTIVEMQ_CONF: /apache-activemq-5.14.5/conf ACTIVEMQ_DATA: /apache-activemq-5.14.5/data Loading message broker from: xbean:file:/apache-activemq-5.14.5/conf/activemq-nojournal.xml INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@271053e1: startup date []; root of context hierarchy INFO | Using Persistence Adapter: MemoryPersistenceAdapter INFO | JMX consoles can connect to service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi INFO | Apache ActiveMQ 5.14.5 (localhost, ID:3b46adefef31-59204-1530885676700-0:1) is starting INFO | Listening for connections at: tcp://3b46adefef31:61616 INFO | Connector openwire started WARN | ServletContext@o.e.j.s.ServletContextHandler@56cdfb3b{/,null,STARTING} has uncovered http methods for path: / INFO | Connector http started INFO | Apache ActiveMQ 5.14.5 (localhost, ID:3b46adefef31-59204-1530885676700-0:1) started INFO | For help or more information please see: http://activemq.apache.org

rashed0120 commented 5 years ago

@tmills i solved the problem, i found out there was problem in docker. Thank you very much for all of your help. Now it works

rashed0120 commented 5 years ago

@tmills Now question is , i have 3500 patients narratives, how can i pass all of the text in CTAKES and get results

tmills commented 5 years ago

Great! I'll close the issue after this. To use this infrastructure for processing notes you need to run a "collection reader". There are two examples in the project, one that reads from a database of a certain format (i2b2-reader) and another that reads plaintext files from a directory (file-reader). If either of those work for you, great, just follow the instructions in the Readme for "running via collection reader" and swap in whichever works for you. If neither collection reader works out of the box, you'll need to write your own, or maybe modify one of the existing to match your setup first.

rashed0120 commented 5 years ago

@tmills Hi , still i have issue with docker same as before. I don't know why it is occurred again again. Any help appreciated.