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 Error

Post new topic  Reply to topic Goto page 1, 2  Next
 Log4j Error « View previous topic :: View next topic » 
Author Message
deepak_paul
PostPosted: Sun Mar 14, 2010 12:45 pm    Post subject: Log4j Error Reply with quote

Centurion

Joined: 04 Oct 2008
Posts: 147
Location: US

When I am using log4j logging in our flows, i am getting some error as below.
Code:
2010-03-14 16:25:35.878791      848   RecoverableException  BIP2917E: A call to the Java method ''com.ibm.broker.IAM3.Log4jNode.log'' with parameters '''POC',  'WARN',  'Message from ESQL''' failed because a Java Exception occurred. The Java Exception information is ''org.apache.oro.text.perl.MalformedPerl5PatternException: Invalid expression: test''.
                                       An attempt was made to invoke the Java method ''com.ibm.broker.IAM3.Log4jNode.log'', but the method threw an exception. Typically the exception occurs because of a coding error in the Java method or an error in the JVM (such as Out of Memory). The Java exception information was ''org.apache.oro.text.perl.MalformedPerl5PatternException: Invalid expression: test''. The parameters passed into the method were '''POC',  'WARN',  'Message from ESQL'''.
                                       Examine and correct the Java method.
2010-03-14 16:25:35.878791      848   Error       BIP2648E: Message backed out to a queue; node 'POC.MQInput'.
                                       Node 'POC.MQInput' has received a message which has previously been backed out one or more times because of a processing error in the main path of the message flow. The failure terminal is not attached, so the message broker is putting the message directly to the requeue or dead letter backout queue associated with this node. The MQMD 'backoutCount' of the message now equals the 'backoutThreshold' defined for the WebSphere MQ input queue.
                                       Examine previous messages and the message flow to determine why the message is being backed out.  Correct this situation if possible.  Perform any local error recovery processing required.


Log filesa are just created but are empty.

Please help me.
Back to top
View user's profile Send private message
Vitor
PostPosted: Sun Mar 14, 2010 4:41 pm    Post subject: Re: Log4j Error Reply with quote

Grand High Poobah

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

deepak_paul wrote:
Please help me.


How are you invoking log4j within the flow?

Have you reviewed the many posts in this forum regarding the issues resulting from using log4j within WMB?

Have you considered the alternative logging options? Or just using log4j because that's what you use to log Java within WAS?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
deepak_paul
PostPosted: Sun Mar 14, 2010 5:11 pm    Post subject: Reply with quote

Centurion

Joined: 04 Oct 2008
Posts: 147
Location: US

Thanks for your response, Vitor.

1.I am using Compute node to invoke Log4j built in functions.

2.Till the search i had, i did not find the correct solution for this in this site. please forgive me if you find any old post.

3. I am just doing this for myself. We are planning to come with good logging mechanism for our project. Can you please suggest if you any logging mechanism on your mind..[I already knew about Event monitoring feature. I will start a new thread on this.]
Back to top
View user's profile Send private message
Vitor
PostPosted: Sun Mar 14, 2010 5:22 pm    Post subject: Reply with quote

Grand High Poobah

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

deepak_paul wrote:
1.I am using Compute node to invoke Log4j built in functions.


I assume you mean a Java Compute Node. If not, I've found your problem...

deepak_paul wrote:
2.Till the search i had, i did not find the correct solution for this in this site. please forgive me if you find any old post.


I was refering to the posts surrounding log4j, rather than a solution to this specific problem. I fear that once you fix this, you'll bump into another problem.

deepak_paul wrote:
3. I am just doing this for myself. We are planning to come with good logging mechanism for our project. Can you please suggest if you any logging mechanism on your mind..[I already knew about Event monitoring feature. I will start a new thread on this.]


Event Monitoring is something very different to a logging mechanism!

What's wrong with writing out a file?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
deepak_paul
PostPosted: Sun Mar 14, 2010 5:34 pm    Post subject: Reply with quote

Centurion

Joined: 04 Oct 2008
Posts: 147
Location: US

Vitor.

1. I am using Compute node only not Java Compute node. Could you please tell me what could be the possible problem i can have with this.

2. Can i assume that you dont recommend this Log4j being used for non-java applications?

3. Could you please suggest any possible logging mechanism?

Can you elaborate your idea of writing out to a file?
Back to top
View user's profile Send private message
Vitor
PostPosted: Sun Mar 14, 2010 6:06 pm    Post subject: Reply with quote

Grand High Poobah

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

deepak_paul wrote:
1. I am using Compute node only not Java Compute node. Could you please tell me what could be the possible problem i can have with this.


WMB isn't written in Java & doesn't instanciate a JVM unless a JCN is in use.

deepak_paul wrote:
2. Can i assume that you dont recommend this Log4j being used for non-java applications?


I don't recommend using log4j with WMB for anything. I know some people do, I also know people have had problems with it (and some have posted them here) and you did ask what I thought.

deepak_paul wrote:
3. Could you please suggest any possible logging mechanism?

Can you elaborate your idea of writing out to a file?


Use a FileOutput node to output logging information.

Another thing I've seen done which worked quite well was writing logging information to a WMQ queue (out of syncpoint obviously), where a Java app read the messages off and logged them with log4j.

A lot depends on what you're logging, why you're logging it and how coupled to the WMB flow it needs to be.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
deepak_paul
PostPosted: Sun Mar 14, 2010 6:21 pm    Post subject: Reply with quote

Centurion

Joined: 04 Oct 2008
Posts: 147
Location: US

I totally agree with you, Vitor.

We have more than 500 TPS and Multi-instance mesasge flows and also we have 4 main flows and 20+ subflows and so we feel we can not implemnet any logging using Fileoutput node as File lock may occur nad may also tend to reduce the performance of teh flow.

Our logging has to be:
1. Able to tell you which transaction happened what time.
2. Able to identify which nodes are participating in the transaction (like whol trace of teh contact admin in our WMB flow)
Back to top
View user's profile Send private message
Vitor
PostPosted: Sun Mar 14, 2010 6:43 pm    Post subject: Reply with quote

Grand High Poobah

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

deepak_paul wrote:
We have more than 500 TPS and Multi-instance mesasge flows and also we have 4 main flows and 20+ subflows and so we feel we can not implemnet any logging using Fileoutput node as File lock may occur nad may also tend to reduce the performance of teh flow.


I agree with you. I also think at those volumes log4j will trip over itself as well.

deepak_paul wrote:
Our logging has to be:
1. Able to tell you which transaction happened what time.
2. Able to identify which nodes are participating in the transaction (like whol trace of teh contact admin in our WMB flow)


If it was me, I'd implement 1 by writing messages and playing them into log4j (or similar) as I outlined above.

I'd implement 2 by laughing in the face of whoever gave me the requirement. That's not a logging requirement, that's an audit requirement. You meet that with proper source code control, deployment and documentation. If you try and log that, the useful information will drown in the ocean of rubbish you're generating.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
deepak_paul
PostPosted: Sun Mar 14, 2010 7:06 pm    Post subject: Reply with quote

Centurion

Joined: 04 Oct 2008
Posts: 147
Location: US

Of course it is an Audit requirement. We can consider delte old entries when they are one week old.

Still, I am waiting to resolve this log4j issue from some corner.

BTW Vitor, what do you think would best fit for this audit reqyuirement?
_________________
Regards
Paul
Back to top
View user's profile Send private message
Vitor
PostPosted: Sun Mar 14, 2010 7:22 pm    Post subject: Reply with quote

Grand High Poobah

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

deepak_paul wrote:
Of course it is an Audit requirement. We can consider delte old entries when they are one week old.


This doesn't alter the fact that potentially useful information will be buried in a load of rubbish about flow composition.

deepak_paul wrote:
Still, I am waiting to resolve this log4j issue from some corner.


I'm sure someone who knows more about Java/log4j than me will correct my belief and getting it working for you.

deepak_paul wrote:
BTW Vitor, what do you think would best fit for this audit reqyuirement?


The methods I outlined above.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
deepak_paul
PostPosted: Mon Mar 15, 2010 8:24 pm    Post subject: Re: Log4j Error Reply with quote

Centurion

Joined: 04 Oct 2008
Posts: 147
Location: US

deepak_paul wrote:
When I am using log4j logging in our flows, i am getting some error as below.
Code:
2010-03-14 16:25:35.878791      848   RecoverableException  BIP2917E: A call to the Java method ''com.ibm.broker.IAM3.Log4jNode.log'' with parameters '''POC',  'WARN',  'Message from ESQL''' failed because a Java Exception occurred. The Java Exception information is ''org.apache.oro.text.perl.MalformedPerl5PatternException: Invalid expression: test''.
                                       An attempt was made to invoke the Java method ''com.ibm.broker.IAM3.Log4jNode.log'', but the method threw an exception. Typically the exception occurs because of a coding error in the Java method or an error in the JVM (such as Out of Memory). The Java exception information was ''org.apache.oro.text.perl.MalformedPerl5PatternException: Invalid expression: test''. The parameters passed into the method were '''POC',  'WARN',  'Message from ESQL'''.
                                       Examine and correct the Java method.
2010-03-14 16:25:35.878791      848   Error       BIP2648E: Message backed out to a queue; node 'POC.MQInput'.
                                       Node 'POC.MQInput' has received a message which has previously been backed out one or more times because of a processing error in the main path of the message flow. The failure terminal is not attached, so the message broker is putting the message directly to the requeue or dead letter backout queue associated with this node. The MQMD 'backoutCount' of the message now equals the 'backoutThreshold' defined for the WebSphere MQ input queue.
                                       Examine previous messages and the message flow to determine why the message is being backed out.  Correct this situation if possible.  Perform any local error recovery processing required.


Log filesa are just created but are empty.

Please help me.


Does anybody have a solution for this issue?
_________________
Regards
Paul
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Mar 15, 2010 8:30 pm    Post subject: Reply with quote

Grand High Poobah

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

deepak_paul wrote:
010-03-14 16:25:35.878791 848 RecoverableException BIP2917E: A call to the Java method ''com.ibm.broker.IAM3.Log4jNode.log'' with parameters '''POC', 'WARN', 'Message from ESQL''' failed because a Java Exception occurred. The Java Exception information is ''org.apache.oro.text.perl.MalformedPerl5PatternException: Invalid expression: test''.

The java Exception is quite a clear pointer. You need to fix this first.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
deepak_paul
PostPosted: Mon Mar 15, 2010 8:49 pm    Post subject: Reply with quote

Centurion

Joined: 04 Oct 2008
Posts: 147
Location: US

Code:
   CREATE FUNCTION initLog4j( IN CONFIG_FILE_NAME CHARACTER )
   RETURNS BOOLEAN
   LANGUAGE JAVA
   EXTERNAL NAME "com.ibm.broker.IAM3.Log4jNode.initLog4j";
   
   CREATE FUNCTION log4j( IN COMPONENT_NAME CHARACTER,   IN LEVEL CHARACTER,   IN TEXT CHARACTER )
   RETURNS BOOLEAN
   LANGUAGE JAVA
   EXTERNAL NAME "com.ibm.broker.IAM3.Log4jNode.log";
   
   CREATE FUNCTION log4j_1_1( IN COMPONENT_NAME CHARACTER, IN LOGGER_NAME CHARACTER, IN LEVEL CHARACTER, IN TEXT CHARACTER )
   RETURNS BOOLEAN
   LANGUAGE JAVA
   EXTERNAL NAME "com.ibm.broker.IAM3.Log4jNode.log";

CREATE COMPUTE MODULE POC_Compute
   CREATE FUNCTION Main() RETURNS BOOLEAN
   BEGIN
       CALL CopyMessageHeaders();
       CALL CopyEntireMessage();
      RETURN TRUE;
   END;

   CREATE PROCEDURE CopyMessageHeaders() BEGIN
      DECLARE I INTEGER 1;
      DECLARE J INTEGER;
      SET J = CARDINALITY(InputRoot.*[]);
      WHILE I < J DO
         SET OutputRoot.*[I] = InputRoot.*[I];
         SET I = I + 1;
      END WHILE;
   END;

   CREATE PROCEDURE CopyEntireMessage() BEGIN
      
      DECLARE rc BOOLEAN;
      DECLARE rc1 BOOLEAN;
      CALL initLog4j('E:\\workarea\\brokerlog.xml') INTO rc;
      IF ( rc = FALSE ) THEN
      -- error initializing log4j
      END IF;
            
      CALL log4j('POC','WARN','Message from ESQL') INTO rc1;
      IF ( rc1 = FALSE ) THEN
      -- error during logging
         CALL log4j_1_1('POC', 'default', 'WARN','Message from ESQL') INTO rc1;
      END IF;

      SET OutputRoot = InputRoot;
      --SET Environment.Variables.Log4j.LogText='This is a log message.';
   END;
END MODULE;


This is my ESQl.
Please tell how i can get rid of java Exception.
_________________
Regards
Paul
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Mar 15, 2010 9:07 pm    Post subject: Reply with quote

Grand High Poobah

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

You are calling log4j directly and not from a little Java method.
So no, you can't trap the Exception that way.
You need to wrap your log4j call in a Java method that can trap the Exception...

You do realize that if your logger throws an exception you have no logging, right?

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
deepak_paul
PostPosted: Mon Mar 15, 2010 9:41 pm    Post subject: Reply with quote

Centurion

Joined: 04 Oct 2008
Posts: 147
Location: US

fjb_saper wrote:
You are calling log4j directly and not from a little Java method.
So no, you can't trap the Exception that way.
You need to wrap your log4j call in a Java method that can trap the Exception...


I am following the pdf which comes with the log4j support pac.. i have not tried your option yet..

Quote:
You do realize that if your logger throws an exception you have no logging, right?

Yes. I do.
_________________
Regards
Paul
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Log4j Error
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.