logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Smith <psm...@aconex.com>
Subject Re: JmsReceiver Chainsaw problem
Date Wed, 01 Feb 2006 20:45:47 GMT
To test the theory of jmsAppender being bad, perhaps you can use  
Hermes to browse the ActiveMQ Topic to see if it's sending the events  
correctly?

http://www.hermesjms.com/

Straightforward to configure, give me a hoi if you have trouble  
getting activemq & hermes working together.

Paul
On 02/02/2006, at 7:33 AM, DeSantis, MJ Mark @ IS (7179) wrote:

> Okay, here's the situation.
>
> The receiver seems to be functioning well. Chainsaw starts it up  
> fine and
> there are no errors in chainsaw's console from the console appender.
>
> I think there are problems with the JmsAppender.
>
> Things that make me think the jmsReceiver is okay:
> 1)chainsaw starts it up with no problems
> 2)my little test application also starts it up with no problems
> 3)I can see it has made a connection to the activemq broker (the  
> console
> output of activemq tells me this).
> 4 (and this one is the kicker)) if I manually instanciate a new
> LoggingEvent() and open the topic the receiever is supposed to be  
> listening
> on and I send the loggingevent as an ObjectMessage, then the  
> receiver gets
> it. Chainsaw posts it and my little test application sees it but  
> the layout
> of the console appender attached to the application throws an error.
>
> Things that make me think the jmsAppender is bad:
> 1)it's continually sending loggingevents but I don't get any output in
> chainsaw or my little test application.
>
>
> Conversely, the internal logging of log4j says that it's creating  
> the topic
> publisher as a result of being configured with the jmsAppender. And  
> I can
> see in the Activemq console output that it too has made a  
> connection. So if
> it is actually creating the topic and connectiong then it's not  
> actually
> publishing to that topic.
>
> Is there something in my jmsappender config that could be causing the
> problems?
>
> Mark
>
> -----Original Message-----
> From: Scott Deboy [mailto:sdeboy@comotivsystems.com]
> Sent: Wednesday, February 01, 2006 1:03 PM
> To: Log4J Users List
> Subject: RE: JmsReceiver Chainsaw problem
>
>
> Adding an appender to Chainsaw's config is a great way to tell  
> whether or
> not your receiver is receiving events...
>
> If you didn't see them in the console appender added to the  
> chainsaw config,
> jmsreceiver isn't receiving the events.
>
> Look in the chainsaw-log tab for information - there may be an  
> exception
> there related to jmsreceiver.
>
> Can you verify that you are receiving the events and collecting  
> them at the
> jms server (jmsappender working correctly)?
>
>
>
> 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 10:49 AM
> To: 'Log4J Users List'
> Subject: RE: JmsReceiver Chainsaw problem
>
> 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.loadConfigurationUsingPluginClassLoade 
> r(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
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


---------------------------------------------------------------------
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