Re: Unit testing log4j JMS Appender

2014-04-02 Thread Mohit Anchlia
(RemoteTestRunner.java:390)
 at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
log4j:ERROR Could not create an Appender. Reported error follows.
java.lang.NullPointerException
 at java.util.Hashtable.put(Unknown Source)
 at
org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:141)
 at
org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:153)
 at
org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:201)
 at
org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:140)
 at
org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:153)
 at
org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:415)
 at
org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.java:335)
 at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:781)
 at
org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:666)
 at
org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:616)
 at
org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:602)
 at
org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:460)
 at org.apache.log4j.LogManager.clinit(LogManager.java:113)
 at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:73)
 at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:242)
 at
org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:156)
 at
org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132)
 at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:272)
 at org.mule.util.SystemUtils.clinit(SystemUtils.java:35)
 at
org.mule.tck.junit4.AbstractMuleTestCase.clinit(AbstractMuleTestCase.java:71)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
On Tue, Apr 1, 2014 at 12:41 PM, Gary Gregory garydgreg...@gmail.comwrote:

 On Tue, Apr 1, 2014 at 3:13 PM, Mohit Anchlia mohitanch...@gmail.com
 wrote:

  Is there a stable version available?


 Yes: https://logging.apache.org/log4j/2.x/


  How do I reload configuration?


 Please see:
 -

 https://logging.apache.org/log4j/2.x/manual/configuration.html#AutomaticReconfiguration
 -

 https://logging.apache.org/log4j/2.x/log4j-core/apidocs/org/apache/logging/log4j/core/config/Reconfigurable.html#reconfigure()


  I am
  using log4j.properties and not xml
 

 Log4j 2 does not support properties files for configuration. It might one
 day, but not now.

 Gary


 
  On Tue, Apr 1, 2014 at 12:09 PM, Gary Gregory garydgreg...@gmail.com
  wrote:
 
   You would be better served using version 2 which we are actively
 working
   on.
  
   Gary
  
    Original message 
   From: Mohit Anchlia mohitanch...@gmail.com
   Date:04/01/2014  15:01  (GMT-05:00)
   To: Log4J Users List log4j-user@logging.apache.org
   Subject: Unit testing log4j JMS Appender
  
   I am trying to unit test log4j with jms appender, however even before I
   bring up the jms embedded broker service log4j.properties get loaded
 and
  it
   fails to connect to the broker. Is there a way to reload log4j after
 the
   broker is up?
  
 



 --
 E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
 Java Persistence with Hibernate, Second Edition
 http://www.manning.com/bauer3/
 JUnit in Action, Second Edition http://www.manning.com/tahchiev/
 Spring Batch in Action http://www.manning.com/templier/
 Blog: http://garygregory.wordpress.com
 Home: http://garygregory.com/
 Tweet! http://twitter.com/GaryGregory



Re: Unit testing log4j JMS Appender

2014-04-02 Thread Gary Gregory
)
  at org.junit.runners.ParentRunner.run(ParentRunner.java:292)
  at

 org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
  at

 org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
  at

 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
  at

 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
  at

 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
  at

 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
 log4j:ERROR Could not create an Appender. Reported error follows.
 java.lang.NullPointerException
  at java.util.Hashtable.put(Unknown Source)
  at

 org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:141)
  at

 org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:153)
  at

 org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:201)
  at

 org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:140)
  at

 org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:153)
  at

 org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:415)
  at

 org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.java:335)
  at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:781)
  at
 org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:666)
  at
 org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:616)
  at
 org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:602)
  at

 org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:460)
  at org.apache.log4j.LogManager.clinit(LogManager.java:113)
  at org.slf4j.impl.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:73)
  at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:242)
  at

 org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:156)
  at

 org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132)
  at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:272)
  at org.mule.util.SystemUtils.clinit(SystemUtils.java:35)
  at

 org.mule.tck.junit4.AbstractMuleTestCase.clinit(AbstractMuleTestCase.java:71)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 On Tue, Apr 1, 2014 at 12:41 PM, Gary Gregory garydgreg...@gmail.com
 wrote:

  On Tue, Apr 1, 2014 at 3:13 PM, Mohit Anchlia mohitanch...@gmail.com
  wrote:
 
   Is there a stable version available?
 
 
  Yes: https://logging.apache.org/log4j/2.x/
 
 
   How do I reload configuration?
 
 
  Please see:
  -
 
 
 https://logging.apache.org/log4j/2.x/manual/configuration.html#AutomaticReconfiguration
  -
 
 
 https://logging.apache.org/log4j/2.x/log4j-core/apidocs/org/apache/logging/log4j/core/config/Reconfigurable.html#reconfigure()
 
 
   I am
   using log4j.properties and not xml
  
 
  Log4j 2 does not support properties files for configuration. It might one
  day, but not now.
 
  Gary
 
 
  
   On Tue, Apr 1, 2014 at 12:09 PM, Gary Gregory garydgreg...@gmail.com
   wrote:
  
You would be better served using version 2 which we are actively
  working
on.
   
Gary
   
 Original message 
From: Mohit Anchlia mohitanch...@gmail.com
Date:04/01/2014  15:01  (GMT-05:00)
To: Log4J Users List log4j-user@logging.apache.org
Subject: Unit testing log4j JMS Appender
   
I am trying to unit test log4j with jms appender, however even
 before I
bring up the jms embedded broker service log4j.properties get loaded
  and
   it
fails to connect to the broker. Is there a way to reload log4j after
  the
broker is up?
   
  
 
 
 
  --
  E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
  Java Persistence with Hibernate, Second Edition
  http://www.manning.com/bauer3/
  JUnit in Action, Second Edition http://www.manning.com/tahchiev/
  Spring Batch in Action http://www.manning.com/templier/
  Blog: http://garygregory.wordpress.com
  Home: http://garygregory.com/
  Tweet! http://twitter.com/GaryGregory
 




-- 
E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
Java Persistence with Hibernate, Second Editionhttp://www.manning.com/bauer3/
JUnit in Action, Second Edition http://www.manning.com/tahchiev/
Spring Batch in Action http://www.manning.com/templier/
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory


Re: Unit testing log4j JMS Appender

2014-04-02 Thread Mohit Anchlia
)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  On Tue, Apr 1, 2014 at 12:41 PM, Gary Gregory garydgreg...@gmail.com
  wrote:
 
   On Tue, Apr 1, 2014 at 3:13 PM, Mohit Anchlia mohitanch...@gmail.com
   wrote:
  
Is there a stable version available?
  
  
   Yes: https://logging.apache.org/log4j/2.x/
  
  
How do I reload configuration?
  
  
   Please see:
   -
  
  
 
 https://logging.apache.org/log4j/2.x/manual/configuration.html#AutomaticReconfiguration
   -
  
  
 
 https://logging.apache.org/log4j/2.x/log4j-core/apidocs/org/apache/logging/log4j/core/config/Reconfigurable.html#reconfigure()
  
  
I am
using log4j.properties and not xml
   
  
   Log4j 2 does not support properties files for configuration. It might
 one
   day, but not now.
  
   Gary
  
  
   
On Tue, Apr 1, 2014 at 12:09 PM, Gary Gregory 
 garydgreg...@gmail.com
wrote:
   
 You would be better served using version 2 which we are actively
   working
 on.

 Gary

  Original message 
 From: Mohit Anchlia mohitanch...@gmail.com
 Date:04/01/2014  15:01  (GMT-05:00)
 To: Log4J Users List log4j-user@logging.apache.org
 Subject: Unit testing log4j JMS Appender

 I am trying to unit test log4j with jms appender, however even
  before I
 bring up the jms embedded broker service log4j.properties get
 loaded
   and
it
 fails to connect to the broker. Is there a way to reload log4j
 after
   the
 broker is up?

   
  
  
  
   --
   E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
   Java Persistence with Hibernate, Second Edition
   http://www.manning.com/bauer3/
   JUnit in Action, Second Edition http://www.manning.com/tahchiev/
   Spring Batch in Action http://www.manning.com/templier/
   Blog: http://garygregory.wordpress.com
   Home: http://garygregory.com/
   Tweet! http://twitter.com/GaryGregory
  
 



 --
 E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
 Java Persistence with Hibernate, Second Edition
 http://www.manning.com/bauer3/
 JUnit in Action, Second Edition http://www.manning.com/tahchiev/
 Spring Batch in Action http://www.manning.com/templier/
 Blog: http://garygregory.wordpress.com
 Home: http://garygregory.com/
 Tweet! http://twitter.com/GaryGregory



Re: Unit testing log4j JMS Appender

2014-04-02 Thread Gary Gregory
)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:242)
at
  
  
 
 org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:156)
at
  
  
 
 org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:272)
at org.mule.util.SystemUtils.clinit(SystemUtils.java:35)
at
  
  
 
 org.mule.tck.junit4.AbstractMuleTestCase.clinit(AbstractMuleTestCase.java:71)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   On Tue, Apr 1, 2014 at 12:41 PM, Gary Gregory garydgreg...@gmail.com
   wrote:
  
On Tue, Apr 1, 2014 at 3:13 PM, Mohit Anchlia 
 mohitanch...@gmail.com
wrote:
   
 Is there a stable version available?
   
   
Yes: https://logging.apache.org/log4j/2.x/
   
   
 How do I reload configuration?
   
   
Please see:
-
   
   
  
 
 https://logging.apache.org/log4j/2.x/manual/configuration.html#AutomaticReconfiguration
-
   
   
  
 
 https://logging.apache.org/log4j/2.x/log4j-core/apidocs/org/apache/logging/log4j/core/config/Reconfigurable.html#reconfigure()
   
   
 I am
 using log4j.properties and not xml

   
Log4j 2 does not support properties files for configuration. It might
  one
day, but not now.
   
Gary
   
   

 On Tue, Apr 1, 2014 at 12:09 PM, Gary Gregory 
  garydgreg...@gmail.com
 wrote:

  You would be better served using version 2 which we are actively
working
  on.
 
  Gary
 
   Original message 
  From: Mohit Anchlia mohitanch...@gmail.com
  Date:04/01/2014  15:01  (GMT-05:00)
  To: Log4J Users List log4j-user@logging.apache.org
  Subject: Unit testing log4j JMS Appender
 
  I am trying to unit test log4j with jms appender, however even
   before I
  bring up the jms embedded broker service log4j.properties get
  loaded
and
 it
  fails to connect to the broker. Is there a way to reload log4j
  after
the
  broker is up?
 

   
   
   
--
E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
Java Persistence with Hibernate, Second Edition
http://www.manning.com/bauer3/
JUnit in Action, Second Edition http://www.manning.com/tahchiev/
Spring Batch in Action http://www.manning.com/templier/
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory
   
  
 
 
 
  --
  E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
  Java Persistence with Hibernate, Second Edition
  http://www.manning.com/bauer3/
  JUnit in Action, Second Edition http://www.manning.com/tahchiev/
  Spring Batch in Action http://www.manning.com/templier/
  Blog: http://garygregory.wordpress.com
  Home: http://garygregory.com/
  Tweet! http://twitter.com/GaryGregory
 




-- 
E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
Java Persistence with Hibernate, Second Editionhttp://www.manning.com/bauer3/
JUnit in Action, Second Edition http://www.manning.com/tahchiev/
Spring Batch in Action http://www.manning.com/templier/
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory


Re: Unit testing log4j JMS Appender

2014-04-02 Thread Mohit Anchlia
I don't think there is any problem with that jar, the issue is that I am
trying to use log4j 2 but the dependency jar that I am using is using log4j
1. When I switch back to log4j 1 everything works fine. Is there a way to
avoid this compatibility issue? Not sure how others that have similar
issue are able to migrate today to log4j 2

On Wed, Apr 2, 2014 at 4:48 PM, Remko Popma remko.po...@gmail.com wrote:

 The problem is in  activemq-all-5.9.0.jar. I suggest you contact the
 activemq team.

 Sent from my iPhone

  On 2014/04/03, at 2:53, Gary Gregory garydgreg...@gmail.com wrote:
 
  activemq-all-5.9.0.jar

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




Re: Unit testing log4j JMS Appender

2014-04-02 Thread Remko Popma
SLF4J finds the two bindings below, but not the log4j2 binding (
*log4j-slf4j-impl-2.0.jar*).

So first you need to add the log4j2 slf4j impl dependency.

Second the classpath will still have the two jars below that also provide a
binding. So whichever comes first in the classpath is the binding used by
your app. Not ideal. I suggest removing the other bindings.
Unfortunately, the activemq jar seems to bundle the binding in an
all-in-one jar, making it hard to remove that binding. Perhaps activemq
also provides a collection of component jars so you can exclude the slf4j
binding...

SLF4J: Found binding in
[jar:file:/C:/Users/manchlia/.m2/repository/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in
[jar:file:/C:/Users/manchlia/.m2/repository/org/apache/activemq/activemq-all/5.9.0/activemq-all-5.9.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]

On Thursday, April 3, 2014, Mohit Anchlia mohitanch...@gmail.com wrote:

 I don't think there is any problem with that jar, the issue is that I am
 trying to use log4j 2 but the dependency jar that I am using is using log4j
 1. When I switch back to log4j 1 everything works fine. Is there a way to
 avoid this compatibility issue? Not sure how others that have similar
 issue are able to migrate today to log4j 2

 On Wed, Apr 2, 2014 at 4:48 PM, Remko Popma 
 remko.po...@gmail.comjavascript:;
 wrote:

  The problem is in  activemq-all-5.9.0.jar. I suggest you contact the
  activemq team.
 
  Sent from my iPhone
 
   On 2014/04/03, at 2:53, Gary Gregory 
   garydgreg...@gmail.comjavascript:;
 wrote:
  
   activemq-all-5.9.0.jar
 
  -
  To unsubscribe, e-mail: 
  log4j-user-unsubscr...@logging.apache.orgjavascript:;
  For additional commands, e-mail: 
  log4j-user-h...@logging.apache.orgjavascript:;
 
 



Unit testing log4j JMS Appender

2014-04-01 Thread Mohit Anchlia
I am trying to unit test log4j with jms appender, however even before I
bring up the jms embedded broker service log4j.properties get loaded and it
fails to connect to the broker. Is there a way to reload log4j after the
broker is up?


RE: Unit testing log4j JMS Appender

2014-04-01 Thread Gary Gregory
You would be better served using version 2 which we are actively working on.

Gary

 Original message 
From: Mohit Anchlia mohitanch...@gmail.com 
Date:04/01/2014  15:01  (GMT-05:00) 
To: Log4J Users List log4j-user@logging.apache.org 
Subject: Unit testing log4j JMS Appender 

I am trying to unit test log4j with jms appender, however even before I
bring up the jms embedded broker service log4j.properties get loaded and it
fails to connect to the broker. Is there a way to reload log4j after the
broker is up?


Re: Unit testing log4j JMS Appender

2014-04-01 Thread Mohit Anchlia
Is there a stable version available? How do I reload configuration? I am
using log4j.properties and not xml

On Tue, Apr 1, 2014 at 12:09 PM, Gary Gregory garydgreg...@gmail.comwrote:

 You would be better served using version 2 which we are actively working
 on.

 Gary

  Original message 
 From: Mohit Anchlia mohitanch...@gmail.com
 Date:04/01/2014  15:01  (GMT-05:00)
 To: Log4J Users List log4j-user@logging.apache.org
 Subject: Unit testing log4j JMS Appender

 I am trying to unit test log4j with jms appender, however even before I
 bring up the jms embedded broker service log4j.properties get loaded and it
 fails to connect to the broker. Is there a way to reload log4j after the
 broker is up?



Re: Unit testing log4j JMS Appender

2014-04-01 Thread Gary Gregory
On Tue, Apr 1, 2014 at 3:13 PM, Mohit Anchlia mohitanch...@gmail.comwrote:

 Is there a stable version available?


Yes: https://logging.apache.org/log4j/2.x/


 How do I reload configuration?


Please see:
-
https://logging.apache.org/log4j/2.x/manual/configuration.html#AutomaticReconfiguration
-
https://logging.apache.org/log4j/2.x/log4j-core/apidocs/org/apache/logging/log4j/core/config/Reconfigurable.html#reconfigure()


 I am
 using log4j.properties and not xml


Log4j 2 does not support properties files for configuration. It might one
day, but not now.

Gary



 On Tue, Apr 1, 2014 at 12:09 PM, Gary Gregory garydgreg...@gmail.com
 wrote:

  You would be better served using version 2 which we are actively working
  on.
 
  Gary
 
   Original message 
  From: Mohit Anchlia mohitanch...@gmail.com
  Date:04/01/2014  15:01  (GMT-05:00)
  To: Log4J Users List log4j-user@logging.apache.org
  Subject: Unit testing log4j JMS Appender
 
  I am trying to unit test log4j with jms appender, however even before I
  bring up the jms embedded broker service log4j.properties get loaded and
 it
  fails to connect to the broker. Is there a way to reload log4j after the
  broker is up?
 




-- 
E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
Java Persistence with Hibernate, Second Editionhttp://www.manning.com/bauer3/
JUnit in Action, Second Edition http://www.manning.com/tahchiev/
Spring Batch in Action http://www.manning.com/templier/
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory