Bug with BatchExecutionHelper when using Log4j rootlogger?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug with BatchExecutionHelper when using Log4j rootlogger?

dunnlow
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
Reply | Threaded
Open this post in threaded view
|

Re: Bug with BatchExecutionHelper when using Log4j rootlogger?

dunnlow