Bug 1314782 - EAP plugin upgradeResource fails with NPE if hostXmlFile can't be located
EAP plugin upgradeResource fails with NPE if hostXmlFile can't be located
Status: CLOSED CURRENTRELEASE
Product: JBoss Operations Network
Classification: JBoss
Component: Plugin -- JBoss EAP 6 (Show other bugs)
JON 3.3.5
Unspecified Unspecified
high Severity high
: DR02
: One-off release
Assigned To: Michael Burman
vsorokin
: Triaged
Depends On:
Blocks: 1261060 1261062 1261066 1273531 1289370 1300725 1302426 1319889 1319904 1319945
  Show dependency treegraph
 
Reported: 2016-03-04 08:31 EST by Michael Burman
Modified: 2016-10-31 21:42 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1314784 (view as bug list)
Environment:
Last Closed: 2016-09-01 05:04:18 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Michael Burman 2016-03-04 08:31:19 EST
Description of problem: If there's an issue when loading HostXmlFile information (such as when the resource was manually imported), the EAP6 / EAP7 plugins will throw a NullPointerException to the logs:

2016-03-04 15:25:57,480 ERROR [WorkerThread#0[127.0.0.1:49436]] (rhq.core.pc.upgrade.ResourceUpgradeDelegate)- ResourceUpgradeFacet threw an exception while upgrading resource [Resource[id=13140, uuid=9785b166-266e-4a1b-a8b4-291942fa51b8, type={EAP7}EAP7 Standalone Server, key=hostPort: localhost:9990, name=EAP 7 (localhost:9990), parent=localhost.localdomain, version=7.0.0.GA]]
java.lang.reflect.UndeclaredThrowableException
	at com.sun.proxy.$Proxy228.upgrade(Unknown Source)
	at org.rhq.core.pc.inventory.InventoryManager.invokeDiscoveryComponentResourceUpgradeFacet(InventoryManager.java:575)
	at org.rhq.core.pc.upgrade.ResourceUpgradeDelegate.executeResourceUpgradeFacetAndStoreRequest(ResourceUpgradeDelegate.java:290)
	at org.rhq.core.pc.upgrade.ResourceUpgradeDelegate.processAndQueue(ResourceUpgradeDelegate.java:107)
	at org.rhq.core.pc.inventory.InventoryManager.activateAndUpgradeResourceRecursively(InventoryManager.java:3715)
	at org.rhq.core.pc.inventory.InventoryManager.activateAndUpgradeResourceRecursively(InventoryManager.java:3726)
	at org.rhq.core.pc.inventory.InventoryManager.activateAndUpgradeResources(InventoryManager.java:3685)
	at org.rhq.core.pc.inventory.InventoryManager.initialize(InventoryManager.java:298)
	at org.rhq.core.pc.PluginContainer.initialize(PluginContainer.java:292)
	at org.rhq.enterprise.agent.AgentMain.startPluginContainer(AgentMain.java:2066)
	at org.rhq.enterprise.agent.PluginContainerLifecycleListener.start(PluginContainerLifecycleListener.java:37)
	at org.rhq.enterprise.agent.PluginContainerLifecycleListener.updatePlugins(PluginContainerLifecycleListener.java:49)
	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.rhq.enterprise.communications.command.impl.remotepojo.server.RemotePojoInvocationCommandService.execute(RemotePojoInvocationCommandService.java:184)
	at sun.reflect.GeneratedMethodAccessor97.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
	at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
	at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:112)
	at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:46)
	at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237)
	at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138)
	at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
	at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:298)
	at com.sun.proxy.$Proxy3.execute(Unknown Source)
	at org.rhq.enterprise.communications.command.server.CommandProcessor.handleIncomingInvocationRequest(CommandProcessor.java:286)
	at org.rhq.enterprise.communications.command.server.CommandProcessor.invoke(CommandProcessor.java:180)
	at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:967)
	at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:798)
	at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:751)
	at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:586)
	at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)
Caused by: java.lang.Exception: Discovery component invocation failed.
	at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:309)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
	at org.rhq.modules.plugins.wildfly10.BaseProcessDiscovery.upgrade(BaseProcessDiscovery.java:506)
	at sun.reflect.GeneratedMethodAccessor225.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.rhq.core.pc.util.DiscoveryComponentProxyFactory$ComponentInvocationThread.call(DiscoveryComponentProxyFactory.java:305)
	... 4 more



Version-Release number of selected component (if applicable): 3.3.5, EAP plugin pack 02


How reproducible:


Steps to Reproduce:
1. 
2.
3.

Actual results:


Expected results:


Additional info:
Comment 1 Michael Burman 2016-03-04 08:35:55 EST
Fixed in the master:

commit 264870d0caefc0f6682552e039b53fc0b5ce87fa
Author: Michael Burman <miburman@redhat.com>
Date:   Fri Mar 4 15:33:41 2016 +0200

    [BZ 1314782] Add missing null check for HostXmlFile
Comment 4 vsorokin 2016-03-10 11:15:47 EST
Completed steps for bug reproducing:

1) Install JON on VM1

2) install EAP6 on VM2 (with agent pointing to VM1)

3) upgrade plugins on JON@VM1 (directory 'plugins/')

4) run 'Discovery Queue' to see EAP6@VM2

5) open stream of Agent@VM2 log file (EAP6)

6) open stream of JON@VM1

7) Click 'Import' button

8) View log files and ascertain the absence of NullPointException.

Note You need to log in before you can comment on or make changes to this bug.