logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "DeSantis, MJ Mark @ IS (7179)" <Mark.J.DeSan...@L-3com.com>
Subject RE: JmsReceiver Chainsaw problem
Date Wed, 01 Feb 2006 18:49:31 GMT
Thanks for info Scott. It helped.

Okay so since I'm using ActiveMq 3.2.1 I put the geromino-jms-spec-1.1jar in
my classpath and the activemq-core.jar in there too because another error
was thrown saying that it wanted a class in that jar. Anyway,

I have chainsaw up with no errors (hooray) except for an "error creating log
panel" error which I don't think is from what I'm doing because I get the
same error if I just start chainsaw up normally without the config file.

When I run my logging test program that sends log messages to the jms server
I don't seem see anything happening in Chainsaw. I would have expected a new
tab to pop up with the log events.

My logging test program uses the JoranConfigurator to config log4j and then
just loops sending out debug messages

Here is the config file the JoranC reads:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration>
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
debug="true">
  <appender name="jmsAppender" class="org.apache.log4j.net.JMSAppender">
    <param name="ProviderURL" value="tcp://localhost:61616"/>
    <param name="InitialContextFactoryName" value
="org.activemq.jndi.ActiveMQInitialContextFactory"/>
    <param name="topicBindingName" value="MyTopic"/>
    <param name="topicConnectionFactoryBindingName"
value="ConnectionFactory"/>
    <param name="LocationInfo" value="false"/>
    <param name="Threshold" value="DEBUG"/>
  </appender>

  <appender name="console" class="org.apache.log4j.ConsoleAppender">
    <param name="Threshold" value="DEBUG"/>
    <layout class="org.apache.log4j.SimpleLayout"/>
  </appender>

  <root>
    <level value="debug"/>
    <appender-ref ref="jmsAppender"/>
    <appender-ref ref="console"/>
  </root>
</log4j:configuration>


And when I start chainsaw I use this config file.

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
debug="true">
   <plugin name="jmsReceiver" class="org.apache.log4j.net.JMSReceiver">
    <param name="JndiPath"
value="C:\EngineeringTools\jars\ActiveMQ\activemq-3.2.1\conf\jndi.properties
"/>
    <param name="topicName" value="MyTopic"/>
    <param name="userId" value="defaultUser"/>
    <param name="password" value="defaultPassword"/>
    <param name="topicFactoryName" value="ConnectionFactory"/>
    <param name="Threshold" value="DEBUG"/>
   </plugin>

   <appender name="console" class="org.apache.log4j.ConsoleAppender">
    <param name="Threshold" value="DEBUG"/>
    <layout class="org.apache.log4j.SimpleLayout"/>
  </appender>

  <root>
    <level value="debug"/>
    <appender-ref ref="console"/>
  </root>
</log4j:configuration>


Note: the chainsaw config file has an appender in it because I have another
program that also gets configured with this file and I thought perhaps with
this other program I could config log4j with a receiver and then using the
appender print the log messages received out to the console - I don't know
if that would work or not but I wanted to give it a try.

Anyway, sorry flood this mailing list but I'm desperate. I'd appreciate any
help or insight into what I'm messing up on.

Thanks again.

Mark


-----Original Message-----
From: Scott Deboy [mailto:sdeboy@comotivsystems.com] 
Sent: Wednesday, February 01, 2006 12:00 PM
To: Log4J Users List
Subject: RE: JmsReceiver Chainsaw problem


It looks like you need to add a jar containing javax.jms.MessageListener to
your classpath.

Scott Deboy
COMOTIV SYSTEMS
111 SW Columbia Street Ste. 950
Portland, OR  97201

Telephone:      503.224.7496
Cell:           503.997.1367
Fax:            503.222.0185

sdeboy@comotivsystems.com

www.comotivsystems.com



-----Original Message-----
From: DeSantis, MJ Mark @ IS (7179) [mailto:Mark.J.DeSantis@L-3com.com]
Sent: Wed 2/1/2006 9:34 AM
To: 'Log4J Users List'
Subject: JmsReceiver Chainsaw problem
 
Hello all,
 
Well, I have program that is appending it's logs with a JmsAppender and I
want to monitor it will Chainsaw using a JmsReceiver. When I start chainsaw
up and point it to my receiver configfile I the following error shows up in
chainsaw's log panel.
 
Could not instantiate object of class [org.apache.log4j.net.JMSReceiver].
 
java.lang.NoClassDefFoundError: javax/jms/MessageListener
 at java.lang.ClassLoader.defineClass1(Native Method)
     at java.lang.ClassLoader.defineClass(Unknown Source)
     at java.security.SecureClassLoader.defineClass(Unknown Source)
     at java.net.URLClassLoader.defineClass(Unknown Source)
     at java.net.URLClassLoader.access$100(Unknown Source)
     at java.net.URLClassLoader$1.run(Unknown Source)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.net.URLClassLoader.findClass(Unknown Source)
     at java.lang.ClassLoader.loadClass(Unknown Source)
     at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
     at java.lang.ClassLoader.loadClass(Unknown Source)
     at java.lang.ClassLoader.loadClassInternal(Unknown Source)
     at java.lang.Class.forName0(Native Method)
     at java.lang.Class.forName(Unknown Source)
     at org.apache.log4j.helpers.Loader.loadClass(Loader.java:171)
     at
org.apache.log4j.helpers.OptionConverter.instantiateByClassName(OptionConver
ter.java:340)
     at
org.apache.log4j.joran.action.PluginAction.begin(PluginAction.java:48)
     at
org.apache.log4j.joran.spi.Interpreter.callBeginAction(Interpreter.java:239)
     at
org.apache.log4j.joran.spi.Interpreter.startElement(Interpreter.java:131)
     at
org.apache.log4j.joran.spi.JoranDocument$StartElementEvent.replay(JoranDocum
ent.java:225)
     at
org.apache.log4j.joran.spi.JoranDocument.replay(JoranDocument.java:113)
     at
org.apache.log4j.joran.JoranConfigurator.doConfigure(JoranConfigurator.java:
170)
     at
org.apache.log4j.joran.JoranConfigurator.doConfigure(JoranConfigurator.java:
89)
     at
org.apache.log4j.chainsaw.LogUI.loadConfigurationUsingPluginClassLoader(LogU
I.java:1890)
     at org.apache.log4j.chainsaw.LogUI.access$17(LogUI.java:1881)
     at org.apache.log4j.chainsaw.LogUI$38$2.run(LogUI.java:1352)
     at java.lang.Thread.run(Unknown Source)
 
 
This is my receiver config file:
 
 
<code>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration
xmlns:log4j="http://jakarta.apache.org/log4j/
<http://jakarta.apache.org/log4j/> " debug="true">
   <plugin name="jmsReceiver" class="org.apache.log4j.net.JMSReceiver">
    <param name="Application" value="RemoteTask"/>
    <param name="JndiPath"
value="C:\EngineeringTools\jars\ActiveMQ\activemq-3.2.1\conf\jndi.properties
"/>
    <param name="topicName" value="MyTopic"/>
    <param name="userId" value="defaultUser"/>
    <param name="password" value="defaultPassword"/>    
    <param name="topicFactoryName"
value="javax.jms.TopicConnectionFactory"/>
    <param name="Threshold" value="DEBUG"/>
   </plugin>
   
   <appender name="console" class="org.apache.log4j.ConsoleAppender">
    <param name="Threshold" value="DEBUG"/>
    <layout class="org.apache.log4j.SimpleLayout"/>
  </appender>
  
  <root>
    <level value="debug"/>
    <appender-ref ref="console"/>
  </root>
</log4j:configuration>
</code>
 
 
I'm using chainsaw that comes with alpha-7 and the log4j-jms-alpha7.jar is
in my classpath when I startup chainsaw Is there anyone who might know what
I'm doing wrong?  thanks.
 
Mark



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


Mime
View raw message