This is for fixing this bug in JON3.1.1 once a branch is available.
Pushed commits to release/jon3.1.x branch to provide better error reporting when agent is unreachable. commit hash: 65db439bacb2 commit hash: b02bb857d8
JON 3.1.1 ER1 build is available. Moving to ON_QA. https://brewweb.devel.redhat.com/buildinfo?buildID=226942
Tested on JON 3.1.1 ER1. Verifired for creating and deleting child resource. Failed for manual import. Scenario: 1- the agent is down 2- import some resource from discovery queue result: GUI message: You have successfully imported the selected Resources. server log: 2012-08-03 17:19:29,095 ERROR [org.rhq.enterprise.communications.command.client.ClientCommandSenderTask] {ClientCommandSenderTask.send-failed}Failed to send command [Command: type=[remotepojo]; cmd-in-response=[false]; config=[{rhq.send-throttle=true}]; params=[{invocation=NameBasedInvocation[synchronizeInventory], targetInterfaceName=org.rhq.core.clientapi.agent.discovery.DiscoveryAgentService}]]. Cause: org.jboss.remoting.CannotConnectException:Can not get connection to server. Problem establishing socket connection for InvokerLocator [socket://localhost:16163/?backlog=200&clientMaxPoolSize=304&enableTcpNoDelay=true&maxPoolSize=303&numAcceptThreads=1&rhq.communications.connector.rhqtype=agent&socketTimeout=60000] -> java.net.ConnectException:Connection refused. Cause: org.jboss.remoting.CannotConnectException: Can not get connection to server. Problem establishing socket connection for InvokerLocator [socket://localhost:16163/?backlog=200&clientMaxPoolSize=304&enableTcpNoDelay=true&maxPoolSize=303&numAcceptThreads=1&rhq.communications.connector.rhqtype=agent&socketTimeout=60000] expected result: the same behaviour as for creating/removing children. No error stack trace, notify user that agent is unreachable.
When you import resources from the discovery job, a Quartz job gets scheduled to notify the agent of the inventory status changes. That quartz job runs asynchronously in the background. The error message listed in comment 4 comes from that Quartz job. There currently is no way to report errors that happen in a background task to the web client. This is a great use case for using something like Errai where we want to push a notification from the server to the client. I am going to move this back to ON_QA and suggest that the notification for error on manual import from discovery queue be logged as a separate feature request.
I have created bug 848167 as a RFE to add support for sending notifications to the UI for things that happen out of band.
Bulk closing of old issues in VERIFIED state.