from agent.log:
2009-02-18 13:52:36,901 ERROR [InventoryManager.discovery-1] (org.rhq.plugins.ag
ent.AgentLauncherScriptDiscoveryComponent)- An error occurred while attempting to auto-discover the agent's launcher script
java.lang.NullPointerException
at org.rhq.plugins.agent.AgentServerComponent.getAgentBean(AgentServerComponent.java:93)
at org.rhq.plugins.agent.AgentLauncherScriptDiscoveryComponent.discoverResources(AgentLauncherScriptDiscoveryComponent.java:69)
This is because AgentServerComponent.getAgentBean() never checks if the returned EMS connection is valid or not. Unfortunately this method is used in a lot of places.

that should never fail - the MBean is internal to the agent itself - there is no remote connection involved. Need to look at this problem more closely - this is bad if this MBean could not be retrieved.

I saw we close this as "cannot replicate". No one has seen this in a long time AFAIK. This situation is possible because we always allow the component to start, even if the JMX connection fails to be made - you'd see this in the log file as a WARN level msg:
Unable to connect to JMX Server
But if this happens, you have more to worry about than a NPE because it means you can't connect to a LOCAL, INTRA-VM MBean. If that ever happens, something really really bad is happening that probably isn't recoverable.
That said, I know of no one reporting this since this one incident - so its possible the agent VM was in a bad state when this happened.
I would close this - if it ever happens again, we'd reopen and investigate for but now I would assume its an anomaly.