activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Suchitha Koneru \(sukoneru\)" <sukon...@cisco.com>
Subject RE: active mq exceptions (when tomcat server is stopped)
Date Thu, 08 Mar 2007 18:51:36 GMT
Yes , this is the only log4j.properties . There is no other log4j file
in web-inf/classes. I am not sure , if active mq is able to find it. The
application uses this file successfully , without any problems.

The broker is started by tomcat 5.5.20 as a servlet context listener. 

The code for broker is as follows 
public class ActiveMQBrokerStartListener implements
ServletContextListener {

	BrokerService broker = new BrokerService();
	
	public void contextInitialized(ServletContextEvent arg0) {
        try{
        	System.out.println("Starting ActiveMQ Broker
Service...");
        	//for the broker URI , do not have leading or trailing
spaces
        	File dir = new File("../../activemq");
        	dir.mkdir();
        	broker.setDataDirectory(dir);
 
broker.addConnector("tcp://localhost:61616?trace=true&wireFormat.maxInac
tivityDuration=-1");
        	broker.start();
        	System.out.println("Active MQ Broker Started at local
host port 61616");
        }catch(Exception e){
        	System.err.println(e.getMessage());
        	e.printStackTrace();
        	throw new RuntimeException(e);
        }
	}

	public void contextDestroyed(ServletContextEvent arg0) {
		try{
			broker.stop();
			System.out.println("Active MQ Broker Stopped at
localhost port 61616");
		}catch(Exception e){
			System.err.println(e.getMessage());
			e.printStackTrace();
        	throw new RuntimeException(e);
        }
	}

}


-----Original Message-----
From: James Strachan [mailto:james.strachan@gmail.com] 
Sent: Thursday, March 08, 2007 10:46 AM
To: users@activemq.apache.org
Subject: Re: active mq exceptions (when tomcat server is stopped)

You sure there's not another log4j.properties file on the classpath?
You positive this one is being used?

On 3/8/07, Suchitha Koneru (sukoneru) <sukoneru@cisco.com> wrote:
>
> Thank you James for the help.
>
> Yes it declares a root logger
> The following are the contents
> log4j.rootLogger=INFO, FILE
>
> log4j.appender.FILE=org.apache.log4j.RollingFileAppender
> log4j.appender.FILE.File=../../logs/PNMServer.log
> log4j.appender.FILE.MaxFileSize=25MB
> log4j.appender.FILE.MaxBackupIndex=2
> log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
> log4j.appender.FILE.layout.ConversionPattern=%d [%t] %-5p %c{2} - %m%n
>
> This file is present in WEB-INF /classes directory. The exceptions 
> were raised  because active mq  was not able to instantiate a logger. 
> How can I make Active MQ use the above log4j.properties file ??
>
> Thank you,
> Suchitha.
> -----Original Message-----
> From: James Strachan [mailto:james.strachan@gmail.com]
> Sent: Wednesday, March 07, 2007 11:55 PM
> To: users@activemq.apache.org
> Subject: Re: active mq exceptions (when tomcat server is stopped)
>
> On 3/8/07, Suchitha Koneru (sukoneru) <sukoneru@cisco.com> wrote:
> > Thank you James for the response. I already have a log4j.properties
> used by the web application.
>
> Does it declare a root logger?
>
>
> > Can I declare activemq_home directory , and place log4j.properties
> file in it, exclusively  for active mq to use it.
>
> Not if you are using an embedded broker. If you run it stand alone via

> the activemq script, it has its own log4j.properties.
>
> --
>
> James
> -------
> http://radio.weblogs.com/0112098/
>


-- 

James
-------
http://radio.weblogs.com/0112098/

Mime
View raw message