[rules-users] Bug with BatchExecutionHelper when using Log4j rootlogger?

dunnlow dunnlow at yahoo.com
Mon Aug 29 12:57:33 EDT 2011


Hi,
I have a small drools client that sends a pojo to a Drools Server using
xstream:

MyBean mb = new MyBean();
List<Command> cmds = new ArrayList<Command>();
InsertObjectCommand insertCmd = (InsertObjectCommand)
CommandFactory.newInsert(mb);
insertCmd.setOutIdentifier("inserter");
insertCmd.setEntryPoint("Default");
cmds.add(insertCmd);
FireAllRulesCommand fireAllRulesCommand = new FireAllRulesCommand();
cmds.add(fireAllRulesCommand);

BatchExecutionCommand command =
CommandFactory.newBatchExecution(cmds,"ksession1");

String xml BatchExecutionHelper.newXstreammarshaller().toXML(command);  *<--
this XML is sent to the server*
..........8<

Pretty standard, I think.  It works just fine and I get a http 200 response
back from my server.

HOWEVER, if I add log4j (log4j.1.2.14.jar) and a log4j.properties that has a
root logger (set to any level) the XML produced includes an "appenderList"
which seems to be trying to stream the log4j appenders (e.g.
org.apache.log4j.ConsoleAppender).  I'm guessing these are not serializable
(no surprise there) and the server complains about the XML.  (fyi, the same
log4j jar is on the drools server)

Is this a known issue/expected?  I can comment out the root logger and
everything is back to ok.

Thanks for any insight,
-J

--
View this message in context: http://drools.46999.n3.nabble.com/Bug-with-BatchExecutionHelper-when-using-Log4j-rootlogger-tp3293188p3293188.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list