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

Key: RHQ-842
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Heiko W. Rupp
Reporter: Heiko W. Rupp
Votes: 0
Watchers: 0
Operations

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

NPE when httpd path not given

Created: 16/Sep/08 07:33 AM   Updated: 18/Dec/08 08:25 AM
Component/s: Plugins
Affects Version/s: 1.0, 1.0.1, 1.1pre
Fix Version/s: 1.2

Time Tracking:
Not Specified

Environment: Copied over from JBNADM-3481
Issue Links:
Relation
 

Resolution Date: 28/Nov/08 01:27 PM
Date of First Response: 18/Dec/08 08:25 AM
Tester: Corey Welton
VCS Revision: 2,131


 Description  « Hide
Manually taking an apache instance into inventory with a NPE, when only the server root is given, but not the path to the httpd.
This is possibly due to the fact that my httpd 2.0.x is called httpd and not apache2

Caused by: java.lang.NullPointerException
        at org.rhq.plugins.apache.ApacheServerComponent.getExecutablePath(ApacheServerComponent.java:278)
        at org.rhq.plugins.apache.ApacheServerComponent.start(ApacheServerComponent.java:136)
        at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.rhq.core.pc.inventory.ResourceContainer$ComponentInvocationThread.call(ResourceContainer.java:446)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
        at java.util.concurrent.FutureTask.run(FutureTask.java:123)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:613)

Binary info is null here on first manual add:

            if (systemInfo.getOperatingSystemType() != OperatingSystemType.WINDOWS) // UNIX
            {
                if (this.binaryInfo.getVersion().startsWith("2.")) { // <<<<<------- HERE
                    executableFile = new File(serverRoot, "bin/apache2");
                } else {
                    executableFile = new File(serverRoot, "bin/httpd");
                }


Later on, this code block fails again, as a httpd2 does not necessarily need to be called apache2


Workaround: give the full data for Server Root, Executable Path and Control Script Path

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Heiko W. Rupp - 16/Sep/08 07:55 AM
Btw.: This also prevents configuration updates for instances that were auto-inventoried.

Heiko W. Rupp - 27/Nov/08 08:16 AM
Acutally, the first ApacheServerComponent.start() is calling getExecutablePath() to compute the binaryInfo ...

Heiko W. Rupp - 28/Nov/08 01:24 PM
In both cases a false assumption is taken for apache 2

Corey Welton - 18/Dec/08 08:25 AM
QA Verified.