[sip-comm-dev] log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not assignable to a "org.apache.log4j.Appender" variable.


#1

Hello all,

While I was trying to incorporate otr4j into SIP Communicator, I encountered
the following error.

[java] log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not
assignable to a "org.apache.log4j.Appender" variable.
[java] log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
[java] log4j:ERROR [321.0] whereas object of type
[java] log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by
[sun.misc.Launcher$AppClassLoader@11b86e7].
[java] log4j:ERROR Could not instantiate appender named "stdout".
[java] log4j:ERROR A "org.apache.log4j.net.SocketAppender" object is not
assignable to a "org.apache.log4j.Appender" variable.
[java] log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
[java] log4j:ERROR [321.0] whereas object of type
[java] log4j:ERROR "org.apache.log4j.net.SocketAppender" was loaded by
[sun.misc.Launcher$AppClassLoader@11b86e7].
[java] log4j:ERROR Could not instantiate appender named "Chainsaw".
[java] log4j:WARN No appenders could be found for logger
(net.java.otr4j.context.auth.AuthenticationInfo).
[java] log4j:WARN Please initialize the log4j system properly.

A) otr4j is incorporated in the otr plugin bundle; this is my
build.xml<https://sip-communicator.dev.java.net/source/browse/checkout/sip-communicator/branches/gsoc09/otr/build.xml?content-type=text%2Fplain&rev=5489>(
*bundle-plugin-otr is defined to the bottom*). B) otr4j uses this
log4j.logging<http://code.google.com/p/otr4j/source/browse/src/log4j.properties>properties
file. C) That log4j.logging file is included in the
bundle-plugin-otr (from A and B). If I manually delete log4j.logging from
the bundle-plugin-otr, I don't get the errors, but I do get the warnings.

Logging is essential, so any help on how to tackle this would be really
appreciated.

Thanks,
George.


#2

Hey George,

I'd imagine that there are conflicts between the log4j classes you
bundle with your lib and the ones we have in SC.

That said, is there any specific reason you want to use log4j? We use
java.util.logging in SC and try to have it in as many of our libs as
possible. This allows us to have a single configuration file and uniform
logs formatting. If there isn't a specific reason why you really need
log4j in otr4j I'd suggest on using java.util.logging instead.

Cheers
Emil

Geekius Caesar wrote:

···

Hello all,

While I was trying to incorporate otr4j into SIP Communicator, I
encountered the following error.

[java] log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not
assignable to a "org.apache.log4j.Appender" variable.
[java] log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
[java] log4j:ERROR [321.0] whereas object of type
[java] log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by
[sun.misc.Launcher$AppClassLoader@11b86e7].
[java] log4j:ERROR Could not instantiate appender named "stdout".
[java] log4j:ERROR A "org.apache.log4j.net.SocketAppender" object is not
assignable to a "org.apache.log4j.Appender" variable.
[java] log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
[java] log4j:ERROR [321.0] whereas object of type
[java] log4j:ERROR "org.apache.log4j.net.SocketAppender" was loaded by
[sun.misc.Launcher$AppClassLoader@11b86e7].
[java] log4j:ERROR Could not instantiate appender named "Chainsaw".
[java] log4j:WARN No appenders could be found for logger
(net.java.otr4j.context.auth.AuthenticationInfo).
[java] log4j:WARN Please initialize the log4j system properly.

A) otr4j is incorporated in the otr plugin bundle; this is my build.xml
<https://sip-communicator.dev.java.net/source/browse/checkout/sip-communicator/branches/gsoc09/otr/build.xml?content-type=text%2Fplain&rev=5489>
(/bundle-plugin-otr is defined to the bottom/). B) otr4j uses this
log4j.logging
<http://code.google.com/p/otr4j/source/browse/src/log4j.properties>
properties file. C) That log4j.logging file is included in the
bundle-plugin-otr (from A and B). If I manually delete log4j.logging
from the bundle-plugin-otr, I don't get the errors, but I do get the
warnings.

Logging is essential, so any help on how to tackle this would be really
appreciated.

Thanks,
George.

--
Emil Ivov, Ph.D. 67000 Strasbourg,
Project Lead France
SIP Communicator
emcho@sip-communicator.org PHONE: +33.1.77.62.43.30
http://sip-communicator.org FAX: +33.1.77.62.47.31

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#3

Hi Emil,

Thank you for the fast response, I will replace log4j with
java.util.logging.

···

On Fri, Jul 3, 2009 at 1:03 AM, Emil Ivov <emcho@sip-communicator.org>wrote:

Hey George,

I'd imagine that there are conflicts between the log4j classes you
bundle with your lib and the ones we have in SC.

That said, is there any specific reason you want to use log4j? We use
java.util.logging in SC and try to have it in as many of our libs as
possible. This allows us to have a single configuration file and uniform
logs formatting. If there isn't a specific reason why you really need
log4j in otr4j I'd suggest on using java.util.logging instead.

Cheers
Emil

Geekius Caesar wrote:
> Hello all,
>
> While I was trying to incorporate otr4j into SIP Communicator, I
> encountered the following error.
>
> [java] log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not
> assignable to a "org.apache.log4j.Appender" variable.
> [java] log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
> [java] log4j:ERROR [321.0] whereas object of type
> [java] log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by
> [sun.misc.Launcher$AppClassLoader@11b86e7].
> [java] log4j:ERROR Could not instantiate appender named "stdout".
> [java] log4j:ERROR A "org.apache.log4j.net.SocketAppender" object is not
> assignable to a "org.apache.log4j.Appender" variable.
> [java] log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
> [java] log4j:ERROR [321.0] whereas object of type
> [java] log4j:ERROR "org.apache.log4j.net.SocketAppender" was loaded by
> [sun.misc.Launcher$AppClassLoader@11b86e7].
> [java] log4j:ERROR Could not instantiate appender named "Chainsaw".
> [java] log4j:WARN No appenders could be found for logger
> (net.java.otr4j.context.auth.AuthenticationInfo).
> [java] log4j:WARN Please initialize the log4j system properly.
>
> A) otr4j is incorporated in the otr plugin bundle; this is my build.xml
> <
https://sip-communicator.dev.java.net/source/browse/checkout/sip-communicator/branches/gsoc09/otr/build.xml?content-type=text%2Fplain&rev=5489
>
> (/bundle-plugin-otr is defined to the bottom/). B) otr4j uses this
> log4j.logging
> <http://code.google.com/p/otr4j/source/browse/src/log4j.properties>
> properties file. C) That log4j.logging file is included in the
> bundle-plugin-otr (from A and B). If I manually delete log4j.logging
> from the bundle-plugin-otr, I don't get the errors, but I do get the
> warnings.
>
> Logging is essential, so any help on how to tackle this would be really
> appreciated.
>
> Thanks,
> George.

--
Emil Ivov, Ph.D. 67000 Strasbourg,
Project Lead France
SIP Communicator
emcho@sip-communicator.org PHONE: +33.1.77.62.43.30
http://sip-communicator.org FAX: +33.1.77.62.47.31

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net