The moose likes EJB and other Java EE Technologies and the fly likes JMS Queue : Log4j Warning Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "JMS Queue : Log4j Warning" Watch "JMS Queue : Log4j Warning" New topic

JMS Queue : Log4j Warning

Csk Kumar

Joined: Mar 07, 2011
Posts: 13
Im using jboss5.1.0GA as an application server. While sending a JMS message to the queue in linux machine its throwing a warning as pasted below:

java SendJmsEvents
log4j:WARN No appenders could be found for logger (org.jnp.interfaces.TimedSocketFactory).
log4j:WARN Please initialize the log4j system properly.
Connection started
Sending an Event to the StateMachine Event=2
Connection stopped

My program SendJmsEvents is able to send text message to the queue but i need to resolve this warning. Please help me out.

Class file for reference :

import java.util.Properties;
import javax.jms.JMSException;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jms.TextMessage;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

public class SendJmsEvents {
QueueConnection conn;
QueueSession session;
Queue que;

public void setupConnection() throws JMSException, NamingException {
Properties properties = new Properties();
properties.put(Context.PROVIDER_URL, "jnp://");
InitialContext iniCtx = new InitialContext(properties);
QueueConnectionFactory qcf = (QueueConnectionFactory) iniCtx

que = (Queue) iniCtx.lookup("MyQueue");

conn = qcf.createQueueConnection();
session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
System.out.println("Connection started");

public void stop() throws JMSException {
System.out.println("Connection stopped");

public void sendAnEventToQueue(String event) throws JMSException {
QueueSender send = session.createSender(que);
TextMessage tm = session.createTextMessage(event);
System.out.println("Sending an Event to the StateMachine Event="+event);

public static void main(String args[]) throws Exception {
SendJmsEvents sm = new SendJmsEvents();


Jaikiran Pai

Joined: Jul 20, 2005
Posts: 10441

You are missing a (or log4j.xml) from the classpath.

[My Blog] [JavaRanch Journal]
Csk Kumar

Joined: Mar 07, 2011
Posts: 13
I have already set jboss-log4j.xml to the classpath like below:
export CLASSPATH=$CLASSPATH:$JBOSS_HOME/server/default/conf/jboss-log4j.xml

Am still getting the same warning.

My jboss-log4j.xml configuration looks like this:

Here JMSAppender configuration is present only for Topic, but i am using Queue. Will this cause a problem? and if so please let me know how to configure JMSAppender for Queue.
Csk Kumar

Joined: Mar 07, 2011
Posts: 13
Waiting for the response. Please reply.
Joe Ess

Joined: Oct 29, 2001
Posts: 9188

Please be patient. Everyone on the JavaRanch is a volunteer, answering questions in their free time.
As for your problem, one does not specify file names on the classpath unless they are archives like zip or jar files (see our FAQ, HowToSetTheClasspath).

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: JMS Queue : Log4j Warning
It's not a secret anymore!