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 » General IBM MQ Support » [SOLVED] Technical problem in Triggering (AIX)

Post new topic  Reply to topic Goto page Previous  1, 2
 [SOLVED] Technical problem in Triggering (AIX) « View previous topic :: View next topic » 
Author Message
mca
PostPosted: Mon Apr 18, 2005 11:54 am    Post subject: Reply with quote

Disciple

Joined: 09 Mar 2005
Posts: 196

Thanks fo ur suggestion of including the jar files. My version of MQ is 5.3 CSD09. I have downloaded and included resolver, xercesSamples, xmlParserAPIs along with the xercesImpl and xml-apis jar files in my class path in the script file. But still the code is hanging over at same place. I also made sure the CP is correct. Also i included some statements to see if the correct xml message is being passed into the file and i got it worked like this:

reader = new StringReader(msg);
print(msg); ---> its printing the XML message i passed here
try {
print(reader.toString()); ---> its printing "java.io.Stringreader@484a8747"
doc = builder.build("reader"); ---> hanging out here with out going to catch block where i tried to catch with "exception" which is the parent class for all exceptions.

I tried by all means. and made sure many times that i am doing correct. Still NO USE. Hanging out at same point when triggered.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
mca
PostPosted: Mon Apr 18, 2005 4:02 pm    Post subject: MessageProgram.java Reply with quote

Disciple

Joined: 09 Mar 2005
Posts: 196

This is my messageParser.java program. This is the program that is not working when triggered. May be it is missing some header files or any other stuff needed for working with MQ Trigger mechanism. I am using JDOM parser for the parsing...This program is not working when triggered, but works from cmd prompt ...

Last edited by mca on Thu Apr 28, 2005 6:54 am; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
fjb_saper
PostPosted: Mon Apr 18, 2005 5:37 pm    Post subject: Reply with quote

Grand High Poobah

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

You might want to remove the Jdom.jar and just use xerces:
xml-apis.jar
xerces-impl.jar

I have an AIX MQ 5.3.08 setup that triggers and uses a dom parser and not a SAX parser and it triggers fine using xerces (6.2 ??)

Enjoy
Back to top
View user's profile Send private message Send e-mail
mca
PostPosted: Tue Apr 19, 2005 9:16 am    Post subject: Reply with quote

Disciple

Joined: 09 Mar 2005
Posts: 196

isn't there a log file that records the reason for errors occured while triggering ? If so, what is the path of that log file in AIX machines ?

Also i am planning to change the parser i used from JDom to either xerces/Sax/Dom. Hope fully it works. Any suggestions ?
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
fjb_saper
PostPosted: Tue Apr 19, 2005 5:38 pm    Post subject: Reply with quote

Grand High Poobah

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

It really depends on how you set logging up for your app?
Read up on java.util.logging.* ...
You can install Lumberjack for java 1.3 (using the logging API of 1.4)


Back to top
View user's profile Send private message Send e-mail
mca
PostPosted: Wed Apr 20, 2005 7:45 am    Post subject: Reply with quote

Disciple

Joined: 09 Mar 2005
Posts: 196

After a week of prolonged confusion regarding my program, i have a good news and sad news with in no time. The good news is that, i changed my MessageParser program from JDOM -> SAX and its parsing the values and sending back those values to the MQGet program when triggered. So, the problem i had got cleared.

Now sad news is that the program is getting hanged when triggered at some other point in another application program which is invoked from MQGet. The problem is similar. Its is working when executed from command-line. But hanging out at this point when triggered."Session session = Session.getDefaultInstance(props, null);"

As a reminder i am working on AIX with MQ version 5.3 CSD 09. My program starts like this:

import java.util.Properties;
import javax.mail.*;
import javax.mail.internet.*;

public class AppliProg {
public void ApplProg(String message,String groupMailId) {
boolean debug = false;
try {
//Set the host smtp address
Properties props = new Properties();
props.put("mail.smtp.host", "smtp.company.com");

// create some properties and get the default Session
Session session = Session.getDefaultInstance(props, null);//----> Program getting hanged here when triggered.
session.setDebug(debug);

// create a message
Message msg = new MimeMessage(session);
//msg.setFrom(new InternetAddress(from));
InternetAddress[] address = {new InternetAddress(recipients[0])};
msg.setRecipients(Message.RecipientType.TO, address);
msg.setSubject(subject);

Guess like how i got the problem with JDOM, the problem here is with "session" when triggered. So, probably i need to change my code which doesnot have session in it. Any suggestions ?
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
jefflowrey
PostPosted: Wed Apr 20, 2005 8:02 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I think you are running into classpath issues or runtime jar issues, where you are trying to access classes that you do not have permission to access or a location to find, when you are running as the trigger monitor user. Your regular user has all the needed permissions, but the trigger monitor user does not.

You should not, by the way, be running the trigger monitor as root. Anyone who has write access to the init q can write a program to create a trigger message that does whatever they want.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
mca
PostPosted: Fri Apr 22, 2005 7:56 am    Post subject: Reply with quote

Disciple

Joined: 09 Mar 2005
Posts: 196

Hi all,

I tried contacting some MQ experts from my team, but they are not able to figure out.


Last edited by mca on Tue Apr 26, 2005 9:03 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
fjb_saper
PostPosted: Fri Apr 22, 2005 3:58 pm    Post subject: Reply with quote

Grand High Poobah

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

You have no control over which directory your application is starting in.
It could be that the directory and authorization problems are killing you

Your classpath may be specified in relative vs absolute mode...
You may not be able to find the .properties files corresponding to your application programming...

To avoid all this just start you program in a specific directory by adding
before the java call:

cd /<my absolute path to the directory I want my java program to start in?>

Enjoy
Back to top
View user's profile Send private message Send e-mail
mca
PostPosted: Tue Apr 26, 2005 9:10 am    Post subject: Reply with quote

Disciple

Joined: 09 Mar 2005
Posts: 196

Hi all,

I tried implementing the same code on an Linux machine and it worked successfully without any issues. I did the same way as on AIX. So, my problem here on AIX may be with the jar files. May be they are not compatible. tried all possibilities, but never worked and still trying. Thanks all for your patience. I will let you know the outcome if any.

MCA
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
fjb_saper
PostPosted: Tue Apr 26, 2005 6:08 pm    Post subject: Reply with quote

Grand High Poobah

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

Are you sure your trigger monitor has the evironment variable set ?

It must be set before running:
Code:

export JAVA_COMPILER=NONE

runmqtrm -m <qmgr> -q <initq>


Sorry all from memory.

Better check it.
Back to top
View user's profile Send private message Send e-mail
mca
PostPosted: Wed Apr 27, 2005 8:02 am    Post subject: Reply with quote

Disciple

Joined: 09 Mar 2005
Posts: 196

hi all,

My problem is solved now. The small thing missing is AMQ_NO_SIGWAIT_SIGTRAP is not set to 1. So, the only change was setting that to 1 and export it. Earlier i tried it, but did not test it, whether it was set. But today tried it again and saw it was set and it worked on my AIX system.

Thanks fjb_saper for the advice and all others who replied to my post in helping me. Thanks again.

MCA
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » General IBM MQ Support » [SOLVED] Technical problem in Triggering (AIX)
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.