You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Stephen Pain <st...@db.com> on 2004/06/07 14:15:28 UTC

XMLDecoder NullPointer

Hi - I've been having problems with XMLDecoder throwing a NullPointer this morning... after a bit of digging around I discovered that it occurs when trying to decode a message with more than 100 lines in the CDATA MSG tag.  I made this quick change to XMLDecoder.java to allow me to read in the log file I needed to view:

   try {
        while ((line = reader.readLine()) != null) {
                  StringBuffer buffer = new StringBuffer(line);
                  for (int i = 0;i<100;i++) {
                        buffer.append(reader.readLine());
                  }

                  // old code:  v.addAll(decodeEvents(buffer.toString()));

                  Vector events = decodeEvents(buffer.toString());
                  if (events != null) {
                        v.addAll(events);
                  } else {
                        System.err.println("couldn't decode: " + buffer.toString());
                  }
        }
    } finally {

I know that the plan is to re-write XMLDecoder soon anyway - but any chance of someone getting a quick patch in (either like the above, or simply increase the 100 line limit?) so that the people on my team who are launching through webstart can load in the log files that contain these long messages? (I'll be changing the log format for these but that change won't be released to the environment we're taking the log files from for a few days...)

Thanks,
Stephen



--

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org