2 Replies Latest reply on Apr 30, 2003 11:13 AM by came

    log4j DOMConfigurator problem from within an MBean

    came

      Hi,

      I'm using JDK1.4.1_01, using jboss 3.0.4 with Tomcat.
      I have created an MBean for my application, which is loading an extra log4j configuration file in XML using the log4j DOMConfigurator.

      Here comes the problem: I have a perfectly valid xml configuration file witch is loading without any errors in a standalone application, but when loaded via my MBean, is giving the following errors:

      12:02:02,193 ERROR [STDERR] log4j:ERROR Parsing error on line 9 and column -1
      12:02:02,203 ERROR [STDERR] log4j:ERROR Element "log4j:configuration" allows no further input; "appender" is not allowed.
      12:02:02,213 ERROR [STDERR] log4j:ERROR Parsing error on line 16 and column -1
      12:02:02,223 ERROR [STDERR] log4j:ERROR Element "log4j:configuration" allows no further input; "appender" is not allowed.
      12:02:02,243 ERROR [STDERR] log4j:ERROR Parsing error on line 29 and column -1
      12:02:02,253 ERROR [STDERR] log4j:ERROR Element "log4j:configuration" allows no further input; "category" is not allowed.
      12:02:02,263 ERROR [STDERR] log4j:ERROR Parsing error on line 34 and column -1
      12:02:02,273 ERROR [STDERR] log4j:ERROR Element "log4j:configuration" allows no further input; "category" is not allowed.
      12:02:02,283 ERROR [STDERR] log4j:ERROR Parsing error on line 42 and column -1
      12:02:02,283 ERROR [STDERR] log4j:ERROR Element "log4j:configuration" allows no further input; "category" is not allowed.

      Now it seems that although I get these errors, this configuration is really used by log4j and working correctly. If I load the same settings via properties files (using PropertyConfigurator in stead of DOMConfigurator), everything goes fine without errors. I have debugged and the DocumentBuilder that is used is still the one from Crimson (so no other one is used).

      Anybody any idea how to fix this ?

      thx,

      came

        • 1. Re: log4j DOMConfigurator problem from within an MBean

          This sounds like a log4j problem or a dtd resolution
          problem?

          Regards,
          Adrian

          • 2. Re: log4j DOMConfigurator problem from within an MBean
            came

            That's what you would think, but the DTD is available in the log4j jar, so it can be found.

            It is more of a validation problem. I thought the parser did not validate correctly, so it was using the wrong parser, but after some debugging I found that log4j DOMConfigurator was really using crimson as a parser, so that probably is not the problem.

            Any more specific idea's?

            I replaced the standard log4j with a newer one : 1.2.8, but still the same problem...

            came