when installing a remote agent, if the check-for-used-port returns null, we through an NPE. We should not bomb out but keep going. Right now you just get an useless error message. This code: // try to see if we can figure out what the port will be that the agent will bind to // this will use awk to find a line in the agent config xml that matches this: // <entry key="rhq.communications.connector.bind-port" value="16163" /> // where we use " as the field separator and the port number will be the fourth field. String agentPortAwkCommand = "awk '-F\"' '/key.*=.*" + AgentInstallInfo.AGENT_PORT_PROP + "/ {print $4}' " + "'" + agentConfigXmlFilename + "'"; String portStr = executeCommand(agentPortAwkCommand, "Determine the agent's bind port", info); try { int port = Integer.parseInt(portStr.trim()); info.setAgentPort(port); } catch (NumberFormatException nfe) { info.setAgentPort(0); // indicate that we don't know it } Rather than just catch NumberFormatException, we should just catch Exception - that way, the NPE will get caught too - and we want to do the same thing - just indicate we don't know the port.
To master: commit 0a87c043f2088934f3b66488c87f14e7b83b9e17 Author: John Mazzitelli <mazz> Date: Fri Sep 5 12:21:50 2014 -0400 BZ 1138805 - NPE check To release/jon3.3.x: commit abe0958e98015fc7dfa12fc93a93d23f6c33bd03 Author: John Mazzitelli <mazz> Date: Fri Sep 5 12:21:50 2014 -0400 BZ 1138805 - NPE check (cherry picked from commit 0a87c043f2088934f3b66488c87f14e7b83b9e17)
Moving to ON_QA as available for test with the following brew build: https://brewweb.devel.redhat.com//buildinfo?buildID=385149
verified in JON 3.3 ER03 thank you