Bug 1314784 - EAP plugin upgradeResource fails with NPE if hostXmlFile can't be located
Summary: EAP plugin upgradeResource fails with NPE if hostXmlFile can't be located
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Operations Network
Classification: JBoss
Component: Plugin -- JBoss EAP 7
Version: JON 3.3.5
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: DR01
: One-off release
Assignee: Michael Burman
QA Contact: vsorokin
URL:
Whiteboard:
Depends On:
Blocks: 1314853
TreeView+ depends on / blocked
 
Reported: 2016-03-04 13:32 UTC by Michael Burman
Modified: 2016-11-01 01:42 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1314782
Environment:
Last Closed: 2016-06-06 18:57:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Michael Burman 2016-03-04 13:32:42 UTC
+++ 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 13:34:43 UTC
Fixed in the master:

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

    [BZ 1314784] Add missing null check for HostXmlFile

Comment 4 vsorokin 2016-03-24 11:36:42 UTC
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.