On 02/02/2010 04:50 AM, Marco Giunta wrote:
INFO   | jvm 1    | 2010/02/01 23:00:04 | 2010-02-01 23:00:04,514
[DefaultQuartzScheduler_Worker-3] ERROR org.quartz.core.JobRunShell -
Job Taskomatic
Group.com.redhat.rhn.taskomatic.task.CompareConfigFilesTask-13 threw an
unhandled Exception: C3P0Registry banner
INFO   | jvm 1    | 2010/02/01 23:00:04 | java.lang.NullPointerException
INFO   | jvm 1    | 2010/02/01 23:00:04 |       at
com.redhat.rhn.taskomatic.task.CompareConfigFilesTask.execute(CompareConfigFilesTask.java:94)
INFO   | jvm 1    | 2010/02/01 23:00:04 |       at
org.quartz.core.JobRunShell.run(JobRunShell.java:203)
INFO   | jvm 1    | 2010/02/01 23:00:04 |       at
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:520)

The other message is about
com.redhat.rhn.taskomatic.task.CompareConfigFilesTask
java.lang.NullPointerException, but I don't understand which is the
problem; I've tried to enable debug loggin, but I'm not able to do it.
I've add this line to /usr/share/rhn/classes/log4j.properties

Hello,

This is a piece of my code- so I apologize that it is not working properly. The messages are basically harmless, although annoying. You can disable the task if you aren't using it, via /etc/rhn/default/rhn_taskomatic.conf, and commenting out the "... CompareConfigFilesTask.schedule = 0 0 23 ? * *" line, and probably also by removing it from the list of taskomatic.default_tasks at the top of the same file. The task, when working properly, queues up an automated comparison of configuration files.

Attached is a patch that should fix the issue.

Josh
From 16d0f841cead2171808b68b597b4ccbc0d6454ae Mon Sep 17 00:00:00 2001
From: Joshua Roys <[email protected]>
Date: Tue, 2 Feb 2010 14:12:22 +0000
Subject: [PATCH] Fix a NPE in CompareConfigFilesTask

---
 .../taskomatic/task/CompareConfigFilesTask.java    |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/java/code/src/com/redhat/rhn/taskomatic/task/CompareConfigFilesTask.java 
b/java/code/src/com/redhat/rhn/taskomatic/task/CompareConfigFilesTask.java
index bc0127b..1057fb8 100644
--- a/java/code/src/com/redhat/rhn/taskomatic/task/CompareConfigFilesTask.java
+++ b/java/code/src/com/redhat/rhn/taskomatic/task/CompareConfigFilesTask.java
@@ -17,6 +17,7 @@ package com.redhat.rhn.taskomatic.task;
 import com.redhat.rhn.domain.action.Action;
 import com.redhat.rhn.domain.action.ActionFactory;
 import com.redhat.rhn.domain.action.config.ConfigAction;
+import com.redhat.rhn.domain.action.config.ConfigRevisionAction;
 import com.redhat.rhn.domain.config.ConfigFile;
 import com.redhat.rhn.domain.config.ConfigRevision;
 import com.redhat.rhn.domain.config.ConfigurationFactory;
@@ -32,6 +33,8 @@ import org.quartz.Job;
 import org.quartz.JobExecutionContext;
 import org.quartz.JobExecutionException;
 
+import java.util.Set;
+
 /**
  * Compare Config Files
  *  Schedules a comparison of config files on all systems
@@ -88,10 +91,11 @@ public class CompareConfigFilesTask implements Job {
                 ActionFactory.addConfigRevisionToAction(crev, server, cfact);
             }
 
-            if (act.getServerActions().size() < 1) {
+            if (act.getServerActions() == null || 
act.getServerActions().size() < 1) {
                 continue;
             }
-            if (cfact.getConfigRevisionActions().size() < 1) {
+            Set<ConfigRevisionAction> cra = cfact.getConfigRevisionActions();
+            if (cra == null || cra.size() < 1) {
                 continue;
             }
 
-- 
1.6.5.2

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
Spacewalk-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to