logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stadelmann Josef" <josef.stadelm...@axa-winterthur.ch>
Subject AW: [log4j-1.2.17] build problem - Failure authenticating with NTLM <any realm>@bcproxyserver.ch.
Date Tue, 03 Jul 2012 09:20:37 GMT
Hi Christian

I am glad to help you, . . . if I can, at least I like to make you aware about 
my observations and what I have found so far.

I am on NetBeans 7.1.2 on a Vista System
$ mvn install
fails with the CoreTestSuite

looking closer at testing  ...

First, I assume that each test(-case) is self contained and hence can be run in any order.

Correct me if I am wrong.

Then I like to know a bit about the testing philosophy of log4j 
i.e. - is ant or maven the main test driver?

Because I made the following observation and I do not know how log4j developers intend to
handle this.
doing 
$ mvn -Dtest=org.apache.log4j.EnhancedPatternLayoutTestCase test
from a dos window or any other cmd window should run the defined test case but does not!

However when I select a test case from NB and do a test file or debug test file the test file
gets executed
and fails or passes. 

Doing so causes a different problem:

*** Many test file operation fails because the path to test resources is set wrong using NB
***
*** i.e. witness/serialization/info.bin etc instead of tests/witness/serialization/info.bin
***
*** however this is only true if the test is selected from NetBeans, while executing it 
from maven, the maven-surefire-plugin has it's working directory set to "tests" in pom.xml,
which, 
I guess, acts like a "cd tests" and makes the default for path for FileIO. However, NetBeans
as an IDE
is absolute unhappy with that.  I got many test running test just correcting the paths to
resources
i.e. witness to tests/witness,   input to tests/input,   output to tests/output, ....  and
so on.
But this makes the current maven ant setup unhappy.

Maybe I miss something or do not understand how to setup NetBeans to behave on that aspect
like maven/ant.

***

Anyway looking closer what fails - I decided to take one by one.
I select the CoreTestSuite.java and RMB down and then executed  DebugTestFile

CoreTestSuite resulted in the output attached to this e-mail as CoreTestSuite.txt

***

When I select the project node, then RMB down and Test to execute all test, 
the CoreTestSuit fails at SMTPAppenderTest

    [junit] Testcase: testTrigger took 0.023 sec
    [junit] 	Caused an ERROR
    [junit] javax/mail/MessagingException
    [junit] java.lang.NoClassDefFoundError: javax/mail/MessagingException
    [junit] 	at java.lang.Class.getDeclaredConstructors0(Native Method)
    [junit] 	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    [junit] 	at java.lang.Class.getConstructor0(Class.java:2699)
    [junit] 	at java.lang.Class.newInstance0(Class.java:326)
    [junit] 	at java.lang.Class.newInstance(Class.java:308)
    [junit] 	at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:247)
    [junit] 	at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:176)
    [junit] 	at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:191)
    [junit] 	at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:523)
    [junit] 	at org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:492)
    [junit] 	at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:1006)
    [junit] 	at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:872)
    [junit] 	at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:755)
    [junit] 	at org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:896)

    [junit] 	at org.apache.log4j.net.SMTPAppenderTest.testTrigger(SMTPAppenderTest.java:57)

    [junit] Caused by: java.lang.ClassNotFoundException: javax.mail.MessagingException
    [junit] 	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    [junit] 	at java.security.AccessController.doPrivileged(Native Method)
    [junit] 	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    [junit] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    [junit] 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    [junit] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    [junit] 	... 32 more

    [junit] Testcase: testIt took 1.424 sec

When I select the SMTPAppenderTest.java File and execute a single test using NetBeans, it
failed 
with a FileNotFoundException at the DOMConfiguration Line below. (Line 57 as above) 
    /**
     * Tests that triggeringPolicy element will set evaluator.
     */
  public void testTrigger() {
      DOMConfigurator.configure("input/xml/smtpAppender1.xml");
      SMTPAppender appender = (SMTPAppender) Logger.getRootLogger().getAppender("A1");
      TriggeringEventEvaluator evaluator = appender.getEvaluator();
      assertTrue(evaluator instanceof MockTriggeringEventEvaluator);
  }

So I make the path absolute and re-run the single test, and it performs OK
    /**
     * Tests that triggeringPolicy element will set evaluator.
     */
  public void testTrigger() {
      DOMConfigurator.configure("/E:asf/logging/log4j/tags/v1_2_17/tests/input/xml/smtpAppender1.xml");
      SMTPAppender appender = (SMTPAppender) Logger.getRootLogger().getAppender("A1");
      TriggeringEventEvaluator evaluator = appender.getEvaluator();
      assertTrue(evaluator instanceof MockTriggeringEventEvaluator);
  }

With configuration like that I re-run all test as said above and run into 
    [junit] Testcase: testTrigger took 0.012 sec
    [junit] 	Caused an ERROR
    [junit] null
    [junit] java.lang.NullPointerException
    [junit] 	at org.apache.log4j.net.SMTPAppenderTest.testTrigger(SMTPAppenderTest.java:60)

    [junit] Testcase: testIt took 1.419 sec
as shown above.

I do not have an explanation for that.



So far for the moment.
Any thoughts from you or any other developer is very welcome but in general in which direction
testing 
should develop to support maven ant and IDE's like NetBeans

Josef










-----Urspr√ľngliche Nachricht-----
Von: Christian Grobmeier [mailto:grobmeier@gmail.com] 
Gesendet: Montag, 2. Juli 2012 15:27
An: Log4J Users List
Betreff: Re: [log4j-1.2.17] build problem - Failure authenticating with NTLM <any realm>@bcproxyserver.ch.

Hello Josef,

On Mon, Jul 2, 2012 at 11:31 AM, Stadelmann Josef
<josef.stadelmann@axa-winterthur.ch> wrote:
> your are correct I just attempted to do a
> $ mvn install
>
> The next step will be a closer look at which test actually failes and why
> it is attempting to reach out through our bcproxyserver.ch.winterthur.com:8080
> firewall server without using http.proxyUser and http.proxyPassword properly.
>
> So I just attempted a $ mvn install

in this case, please look at the link:
http://logging.apache.org/log4j/1.2/building.html

My guess is that you are running into trouble with the DLL building.
Please search the page above for "NTEventLogAppender.dll" and check if
you have followed the instructions there.

We are glad if you would report everything you find which we have
missed - thank you!
In addition I would like to point you to log4j 2.0 which is alpha:
loggingtest.apache.org/log4j/2.x/
(temporary link)

Cheers
Christian

>
> I do not want a binary, I'll re-do it all from source and get my packages
> built for operation.
>
> Josef
>
>
> -----Urspr√ľngliche Nachricht-----
> Von: Christian Grobmeier [mailto:grobmeier@gmail.com]
> Gesendet: Donnerstag, 28. Juni 2012 16:27
> An: Log4J Users List
> Betreff: Re: [log4j-1.2.17] build problem - Failure authenticating with NTLM <any
realm>@bcproxyserver.ch.
>
> Hello,
>
> On Tue, Jun 26, 2012 at 5:39 PM, Stadelmann Josef
> <josef.stadelmann@axa-winterthur.ch> wrote:
>> During
>> $ mvn build
>> of log4j-1.2.17 under NetBeans on a Vista PC I get the following.
>
> sorry, did you mean mvn package?
>
>> [ INFO] Failure authenticating with NTLM <any
>> realm>@bcproxyserver.ch.winterthur.com:8080
>
> Not sure why you are running into this and what it actually means.
> Can you please tell me what you want achieve? Maybe we can find it out
> that way round.
>
> Maybe this might help you:
> http://logging.apache.org/log4j/1.2/building.html
>
> The log4j 1.2.17 build is a bit horrible as you can see on that page.
> We are currently cleaning it up. That bein said I have heard of some
> people who had trouble with building log4j on windows machines, but
> there are also people who succeeded. If you just want to get a binary,
> why aren't you downloading the standard packages? If you tell me your
> goal, I might find some time to set up a windows box and look into it.
>
> Cheers
> Christian
>
>> Can sombody tell me what I have to enter as <any relam> as username
>> C770817 and password to make the NTLM cycle go;
>> I just need to know the proper format and where to include this
>> information into the builds system, i.e pom.xml or the like.
>>
>> Josef
>
>
>
> --
> http://www.grobmeier.de
> https://www.timeandbill.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>



-- 
http://www.grobmeier.de
https://www.timeandbill.de

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

Mime
View raw message