History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: RHQ-882
Type: Bug Bug
Status: Integrated Integrated
Resolution: Fixed
Priority: Critical Critical
Assignee: Heiko W. Rupp
Reporter: Joseph Marques
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
RHQ Project

NPE during inventory sync

Created: 23/Sep/08 10:57 PM   Updated: 08/Dec/08 07:30 AM
Component/s: Plugin Container, Core Server
Affects Version/s: 1.1pre
Fix Version/s: 1.2

Time Tracking:
Not Specified

Environment: rev1602
Issue Links:
Duplicate
 

Resolution Date: 21/Nov/08 10:35 AM
Date of First Response: 24/Sep/08 11:13 AM
Tester: Corey Welton
VCS Revision: 2,065


 Description  « Hide
23:49:39,404 WARN [DiscoveryBossBean] Could not perform commit synchronization with agent for platform [spawn_36153]
java.lang.NullPointerException
        at org.rhq.core.pc.inventory.InventoryManager.purgeObsoleteResources(InventoryManager.java:1729)
        at org.rhq.core.pc.inventory.InventoryManager.synchInventory(InventoryManager.java:633)
        at org.rhq.core.pc.inventory.InventoryManager.synchronizeInventory(InventoryManager.java:1270)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.rhq.enterprise.communications.command.impl.remotepojo.server.RemotePojoInvocationCommandService.execute(R
emotePojoInvocationCommandService.java:184)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(Unknown Source)
        at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(Unknown Source)
        at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(Unknown Source)
        at com.sun.jmx.mbeanserver.PerInterface.invoke(Unknown Source)
        at com.sun.jmx.mbeanserver.MBeanSupport.invoke(Unknown Source)
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(Unknown Source)
        at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(Unknown Source)
        at javax.management.MBeanServerInvocationHandler.invoke(Unknown Source)
        at $Proxy66.execute(Unknown Source)
        at org.rhq.enterprise.communications.command.server.CommandProcessor.handleIncomingInvocationRequest(CommandProc
essor.java:358)
        at org.rhq.enterprise.communications.command.server.CommandProcessor.invoke(CommandProcessor.java:253)
        at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:734)
        at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:560)
        at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:369)
        at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:165)
23:49:39,607 INFO [DiscoveryBossBean] Inventory status set to [COMMITTED] for [1] platforms and [1] servers in [56453]m
s

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Heiko W. Rupp - 24/Sep/08 11:13 AM
I've seen this too, but am currently not able to provoke it.
It looks like the map of resource containers does not have all of them, so a query by uuid fails and returns null.
As a band aid, we could test for null-ness and log a warning otherwise.

            for (String uuid : mapForIterating.keySet()) {
                if (!allUuids.contains(uuid)) {
                    ResourceContainer resourceContainer = this.resourceContainers.get(uuid);
if (resourceContainer != null) { /// <<-----
                    Resource resource = resourceContainer.getResource();
                    // Only purge stuff that was synchronized at some point. Other stuff may just be newly discovered.
                    if (resource.getId() != 0) {
                        removeResource(resource.getId());
                        removedResources++;
                    }
} else {
  log.warn(" no container found for uuid : " + uuid );
}
                }
            }

Heiko W. Rupp - 21/Nov/08 10:35 AM
Fixed

Corey Welton - 01/Dec/08 10:36 PM
Steps to repro this? Did we ever figure out what criteria caused this behaviour to occur?

I have not yet been able to make this occur in the latest drop, but I'd like to know a little more about what may or may not have caused it, if that has been determined.