ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Log4j JMS Appender in JavaCompute Node

Post new topic  Reply to topic
 Log4j JMS Appender in JavaCompute Node « View previous topic :: View next topic » 
Author Message
Harsha_AS
PostPosted: Mon Apr 15, 2013 10:21 pm    Post subject: Log4j JMS Appender in JavaCompute Node Reply with quote

Apprentice

Joined: 04 Dec 2011
Posts: 26

All,

We are trying to use log4j JMS appender in our JavaCompute Node. We are trying to publish it to a topic.But when we run our flow we dont see messages written to a subscribed qeueu. Below are setup that we have done. Could anyone please help if are doing anything wrong here

1. Creating the .binding file and have it in the JMDI-Directory (created from the Topic Defination File)
2. Created the log4j.properties file.
3. Then ran the flow which is having the JavaCompute Node.

Below are the log4j.properties details.

log4j.rootLogger=INFO, stdout, jms


log4j.logger.org.apache.webspheremq=INFO, stdout

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %-5p %c - %m%n


log4j.appender.jms=org.apache.log4j.net.JMSAppender
log4j.appender.jms.InitialContextFactoryName=com.sun.jndi.fscontext.RefFSContextFactory
log4j.appender.jms.ProviderURL=file:/C:\JNDI-Directory
log4j.appender.jms.TopicBindingName=testtop
log4j.appender.jms.TopicConnectionFactoryBindingName=testTCF
Back to top
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Tue Apr 16, 2013 4:32 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Well you may have the connection factory right, but you have no Destination defined. You need to Define a destination for your appender... like a queue or a (default) topic....

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Tue Apr 16, 2013 5:31 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Or maybe you don't have the TCF defined to correctly point to the right queue manager.

Or maybe you didn't correctly configure the broker's classpath.

Or maybe you didn't put the right jar files in the right place.

Or maybe you didn't put the log4j properties file in the right place.

Or maybe you didn't provide the right security options to the jar files or to the TCF or to the Topic or to the queue manager or or or

Or maybe Or Maybe or maybe
Back to top
View user's profile Send private message
mapa
PostPosted: Tue Apr 16, 2013 9:20 am    Post subject: Reply with quote

Master

Joined: 09 Aug 2001
Posts: 257
Location: Malmö, Sweden

Make sure you get it working from a JUnit test or similar stand-alone Java program before you try to incorporate it into the broker.

The ProviderURL is not properly formatted.

Try
Code:

log4j.appender.jms.ProviderURL=file:/C:/JNDI-Directory
#Or
log4j.appender.jms.ProviderURL=file:/C:\\JNDI-Directory


You should get an error message in the EG standard out file which on Windows is located in
Code:

%MQSI_WORKPATH%\components\<brokerName>\<egUID>\console.txt


I would recommend to not log to stdout on a production broker...

*Update*: You could also get some useful hints (nothing to do with JMS though) from reading the documentation about the IBM supportpac: "IAM3: WebSphere Message Broker - Node for log4j"
Back to top
View user's profile Send private message Visit poster's website
Harsha_AS
PostPosted: Tue Apr 16, 2013 10:14 pm    Post subject: Reply with quote

Apprentice

Joined: 04 Dec 2011
Posts: 26

Thanks for the response!!!

I can see the error in the console.txt file. Please find the error below.

2013-04-17 06:06:45.336 Execution group started. UUID is: 'b62081c5-3901-0000-0080-ac1f4c4f6be9'. Broker is: MTI2_BROKER
Listening for transport dt_socket at address: 2134
log4j:WARN No appenders could be found for logger (com.omgeo.connect.jcn.mapcsvtoconnect.Initialize).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.


From looking in to the error it looks like it is not able to find log4j.properties file. I have this file placed in "C:\Documents and Settings\All Users\Application Data\IBM\MQSI\shared-classes".
Please let me know if this is not the correct place to have it.
Back to top
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Wed Apr 17, 2013 2:38 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

You should be using a configurable service to locate the log4j.properties file. '
Don't use log4j use java.util.logging!
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Harsha_AS
PostPosted: Tue Apr 23, 2013 1:10 am    Post subject: Reply with quote

Apprentice

Joined: 04 Dec 2011
Posts: 26

Hey,

Thanks for the response!! I have placed the log4j.properties file under "C:\Documents and Settings\All Users\Application Data\IBM\MQSI\common\wsrr" and it is working fine.

And also i am able to publish the message to a topic using JMS appender in Java compute node. But the problem i am facing now is, the published message is having some junk characters in the message body. Please find the below published message. Could anyone please let me know how will i get rid of this Junk characters from the published message.
Back to top
View user's profile Send private message Send e-mail
Vitor
PostPosted: Tue Apr 23, 2013 3:19 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Harsha_AS wrote:
Thanks for the response!! I have placed the log4j.properties file under "C:\Documents and Settings\All Users\Application Data\IBM\MQSI\common\wsrr" and it is working fine.


Which is a really odd place to put it, unless log4j is part of wsrr. Why did you not accept the advice of my most worthy associate and use a configurable service?

Harsha_AS wrote:
Could anyone please let me know how will i get rid of this Junk characters from the published message.


Junk characters or JMS header data in binary form?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Log4j JMS Appender in JavaCompute Node
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.