-
1. Re: No appenders could be found for logger (org.jnp.interfac
alexb_1593 Nov 19, 2004 5:44 AM (in response to alexb_1593)Correction: the full text of the message is:
No appenders could be found for logger (org.jnp.interfaces.NamingContext)
log4j:WARN Please initialize the log4j system properly. -
2. Re: No appenders could be found for logger (org.jnp.interfac
ftg314159 Nov 5, 2005 11:37 AM (in response to alexb_1593)I'm getting this too. A forum search shows people asking variants of this question all over the place, with the common theme being that the messages appear on the client side in spite of the fact that all of the jars in client/ are in the CLASSPATH. The usual recommendation is to add a log4j.properties or a log4j.xml to the CLASSPATH, but it would be helpful if the distro contained such a default file for client use. The only log4j.properties I can find is buried in a SAR file in all/deploy, and I'm assuming that the log4j.xml files in xx/conf are for server use.
Could someone please clear this up and add it to a FAQ ? Thanks. -
3. Re: No appenders could be found for logger (org.jnp.interfac
jaikiran Nov 5, 2005 10:48 PM (in response to alexb_1593)Whenever log4j APIs are used for logging, you should place log4j.xml or log4j.properties in your classpath. Now, if you have server side application in jboss, then there is already a log4j.xml in conf directory. In case you have a client application which uses log4j API, then you will have to place the log4j.xml or log4j.properties in your client classpath. These files will be used for finding appropriate appenders for a logger.
but it would be helpful if the distro contained such a default file for client use
This file is application specific, so the distribution cannot contain this file.
Sample contents of log4j.xml:<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> <appender name="myAppender" class="org.apache.log4j.FileAppender"> <layout class="org.apache.log4j.SimpleLayout"/> </appender> <root> <priority value="debug" /> <appender-ref ref="myAppender"/> </root> </log4j:configuration>
Sample log4j.properties:# The root logger is assigned priority level DEBUG and an appender # named myAppender. log4j.rootLogger=debug, myAppender # The appender's type specified as FileAppender, i.e. log output # written to a file. log4j.appender.myAppender=org.apache.log4j.FileAppender # The appender is assigned a layout SimpleLayout. # SimpleLayout will include only priority level of the log # statement and the log statement itself in log output. log4j.appender.myAppender.layout=org.apache.log4j.SimpleLayout
Have a look at :
http://www.developer.com/open/article.php/10930_3097221_3 for the same -
4. Re: No appenders could be found for logger (org.jnp.interfac
guitoon Nov 9, 2005 8:48 AM (in response to alexb_1593)I had this problem:
log4j:WARN No appenders could be found for logger (org.jboss.security.SecurityAssociation).
log4j:WARN Please initialize the log4j system properly.
So i added the advised log4j.xml file to the classpath, and i now get :
DEBUG - Using ThreadLocal: false
java.lang.reflect.UndeclaredThrowableException
at $Proxy1.diagnose(Unknown Source)
at PSDB_Plugin.run.SessionClient.main(SessionClient.java:52)
Caused by: java.io.NotSerializableException: PSDB_Plugin.ejb.Result
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1075)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)
at java.rmi.MarshalledObject.(MarshalledObject.java:92)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:410)
at sun.reflect.GeneratedMethodAccessor91.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:119)
at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:227)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:167)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:97)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
Any idea of what the problem is ?