You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Franck Quinard <fr...@yahoo.com> on 2001/11/18 19:11:11 UTC

RE: [junit]

The answer was in the archive. I just needed to alter the
excluded.properties file in the junit.jar (include org/xml/*)

thanks to Ceki Gulcu

Franck
  -----Original Message-----
  From: Franck Quinard [mailto:franck_quinard@yahoo.com]
  Sent: Sunday, November 18, 2001 1:05 PM
  To: junit@yahoogroups.com
  Subject: [junit]


  Hello,

  Could any one tell me where I should initialize log4J so JUnit don't stop
  with this exception:

  Failed to invoke suite():java.lang.LinkageError: Class
  org/xml/sax/InputSource violates loader constraints.

  What I liked to do, is to initialize log4J with this:


              URL url = ClassLoader.getSystemResource("log.xml");
              if (url != null) {
                    DOMConfigurator.configure(url);
                    cat.debug("Configuration file found\n");
              } else {
                    BasicConfigurator.configure();
                    cat.error("Configuration file not found\n");
              }

  But, if I put that in the setUp method of FooTest.java or in here,

        public static Test suite() {
              return new TestSuite(MoneyTest.class);
        }

  I get the Exception.

  If I put the initialization in the constructor of FooTest.java, I get this

  junit.framework.AssertionFailedError: Exception in Constructor:
  testFooEquals (java.lang.LinkageError: Class org/xml/sax/InputSource
  violates loader constraints

  When I don't initialize Log4J everything work well.

  Does anybody could help me with that.
  Thanks a lot

  Franck

  P.S.: I'm sorry for my English, But I'm working on it


  _________________________________________________________
  Do You Yahoo!?
  Get your free @yahoo.com address at http://mail.yahoo.com


        Yahoo! Groups Sponsor



  To unsubscribe from this group, send an email to:
  junit-unsubscribe@yahoogroups.com


  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


RE: [junit]

Posted by Ceki Gulcu <ce...@qos.ch>.
Franck,

I could not find the answer. Do you have it somewhere handy?

At 19:11 18.11.2001 +0100, you wrote:
>The answer was in the archive. I just needed to alter the
>excluded.properties file in the junit.jar (include org/xml/*)
>
>thanks to Ceki Gulcu
>
>Franck
>  -----Original Message-----
>  From: Franck Quinard [mailto:franck_quinard@yahoo.com]
>  Sent: Sunday, November 18, 2001 1:05 PM
>  To: junit@yahoogroups.com
>  Subject: [junit]
>
>
>  Hello,
>
>  Could any one tell me where I should initialize log4J so JUnit don't stop
>  with this exception:
>
>  Failed to invoke suite():java.lang.LinkageError: Class
>  org/xml/sax/InputSource violates loader constraints.
>
>  What I liked to do, is to initialize log4J with this:
>
>
>              URL url = ClassLoader.getSystemResource("log.xml");
>              if (url != null) {
>                    DOMConfigurator.configure(url);
>                    cat.debug("Configuration file found\n");
>              } else {
>                    BasicConfigurator.configure();
>                    cat.error("Configuration file not found\n");
>              }
>
>  But, if I put that in the setUp method of FooTest.java or in here,
>
>        public static Test suite() {
>              return new TestSuite(MoneyTest.class);
>        }
>
>  I get the Exception.
>
>  If I put the initialization in the constructor of FooTest.java, I get this
>
>  junit.framework.AssertionFailedError: Exception in Constructor:
>  testFooEquals (java.lang.LinkageError: Class org/xml/sax/InputSource
>  violates loader constraints
>
>  When I don't initialize Log4J everything work well.
>
>  Does anybody could help me with that.
>  Thanks a lot
>
>  Franck
>
>  P.S.: I'm sorry for my English, But I'm working on it
>
>
>  _________________________________________________________
>  Do You Yahoo!?
>  Get your free @yahoo.com address at http://mail.yahoo.com
>
>
>        Yahoo! Groups Sponsor
>
>
>
>  To unsubscribe from this group, send an email to:
>  junit-unsubscribe@yahoogroups.com
>
>
>  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>