Bug 1314784 - 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 7 (Show other bugs)
JON 3.3.5
Unspecified Unspecified
high Severity high
: DR01
: One-off release
Assigned To: Michael Burman
vsorokin
: Triaged
Depends On:
Blocks: 1314853
  Show dependency treegraph
 
Reported: 2016-03-04 08:32 EST by Michael Burman
Modified: 2016-10-31 21:42 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1314782
Environment:
Last Closed: 2016-06-06 14:57:39 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:32:42 EST
+++ This bug was initially created as a clone of Bug #1314782 +++

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:34:43 EST
Fixed in the master:

commit e076cd3a84d2b84a12fbe4964dbffe813e6f824c
Author: Michael Burman <miburman@redhat.com>
Date:   Fri Mar 4 15:34:15 2016 +0200

    [BZ 1314784] Add missing null check for HostXmlFile
Comment 4 vsorokin 2016-03-24 07:36:42 EDT
Reproduced while verification by manually imported resources.
Used plugins from jon-plugin-pack-eap-3.3.0.GA-update-04-DR01.
No NullPointerException in logs of agent, or EAP, or JON watched.

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