Author |
Message
|
Krishnanunni |
Posted: Tue Apr 11, 2006 3:06 am Post subject: perl api on aix |
|
|
Newbie
Joined: 11 Apr 2006 Posts: 8
|
Hi,
I was trying to install the perl module on aix. perl version is 'This is perl, v5.6.0 built for aix'. MQ series client version is 5.3.
I am trying to install the package in the following directory.
/home/prods/inform/IWH01D/DEV/perl/MQSeries-1.23.
The first make was successful. When I try make test in this directory, I get the following error.
[IWH01D:/home/prods/inform/IWH01D/DEV/perl/MQSeries-1.23]> make test
make: 1254-002 Cannot find a rule to create target test from dependencies.
Stop.
Then I tried to run it from MQClient directory.
[IWH01D:/home/prods/inform/IWH01D/DEV/perl/MQSeries-1.23]> cd MQClient
[IWH01D:/home/prods/inform/IWH01D/DEV/perl/MQSeries-1.23/MQClient]> make test
PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib -I/usr/opt/perl5/lib/5.6.0/aix -I/usr/opt/perl5/lib/5.6.0:/home/prods/inform/IWH01D/DEV/perl/MQSeries-1.23/MQClient -e 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
t/10constants.......Can't locate MQSeries/Constants.pl in @INC (@INC contains: blib/arch blib/lib /usr/opt/perl5/lib/5.6.0/aix /usr/opt/perl5/lib/5.6.0/aix /usr/opt/perl5/lib/5.6.0/aix /usr/opt/perl5/lib/5.6.0 /home/prods/inform/IWH01D/DEV/perl/MQSeries-1.23/MQClient /home/prods/inform/IWH01D/DEV/perl/MQSeries-1.23/MQClient /usr/opt/perl5/lib/5.6.0/aix /usr/opt/perl5/lib/5.6.0/aix /usr/opt/perl5/lib/5.6.0 /usr/opt/perl5/lib/site_perl/5.6.0/aix /usr/opt/perl5/lib/site_perl/5.6.0/aix /usr/opt/perl5/lib/site_perl/5.6.0 /usr/opt/perl5/lib/site_perl/5.6.0/aix /usr/opt/perl5/lib/site_perl/5.6.0 /usr/opt/perl5/lib/site_perl . /usr/opt/perl5/lib/5.6.0/aix /usr/opt/perl5/lib/5.6.0 /usr/opt/perl5/lib/site_perl/5.6.0/aix /usr/opt/perl5/lib/site_perl/5.6.0 /usr/opt/perl5/lib/site_perl .) at blib/lib/MQClient/MQSeries.pm line 20.
Compilation failed in require at t/10constants.t line 22.
BEGIN failed--compilation aborted at t/10constants.t line 22.
t/10constants.......dubious
Test returned status 2 (wstat 512, 0x200)
.
.
.
Please can you advise where should I run the make test from ?
In the Makefile of MQClient directory I can see target test and I am interested in MQClient only. But it is looking for Constants.pl under MQSeries.
Thanks,
Krish |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Apr 11, 2006 3:23 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
This is what I've found, although not on AIX.
First, always run the make commands (perl Makefile.pl, make, make test, make install) from the root of the module directory (<wherever>/MQSeries-1.23/) and not from inside the client or server folders. The master make file will deal with building Client or Server or Both depending on what you have installed.
In order to get the module to actually test properly without failing on a machine that has the MQ Client installed (server or not , doesn't matter) - you have to have properly working MQSERVER or MQCLNT* variables defined and in scope before you run make test.
Also, the directory you're trying to install INTO is not the same as the directory you're BUILDING in. You should set PREFIX on the invocation of perl Makefile.pl to indicate where the module should eventually get installed.
So I'd do something like unpack the module into /home/prods/inform/IWHO1D/temp (if i've guessed where the user directory is correctly) and then cd /home/prods/inform/IWHO1D/temp/MQSeries-1.23/.
Then "perl Makefile.PL PREFIX=/home/prods/inform/IWHO1D/DEV/perl/".
Then perl programs using this module need to add "use lib '/home/prods/inform/IWHO1D/DEV/perl';" _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Krishnanunni |
Posted: Tue Apr 11, 2006 5:08 am Post subject: |
|
|
Newbie
Joined: 11 Apr 2006 Posts: 8
|
Thanks a lot. I am trying to install afresh now.. |
|
Back to top |
|
 |
Krishnanunni |
Posted: Wed Apr 12, 2006 12:28 am Post subject: |
|
|
Newbie
Joined: 11 Apr 2006 Posts: 8
|
I think I have installed the modules successfully eventhough make test had failed saying queue manager name not valid. I am able to browse message thru java program though. I had not installed a module before and thanks for your valuable input. I tried compiling a sample program getput.pl taken from this site and it compiled. I added 'use lib '/home/prods/inform/IWH01D/DEV/perl/lib/site_perl/5.6.0/aix';
By any chance have you got a perl program which browse some message ?
Thanks once again,
Krish |
|
Back to top |
|
 |
fschofer |
Posted: Wed Apr 12, 2006 12:37 am Post subject: |
|
|
 Knight
Joined: 02 Jul 2001 Posts: 524 Location: Mainz, Germany
|
|
Back to top |
|
 |
Krishnanunni |
Posted: Wed Apr 12, 2006 1:27 am Post subject: |
|
|
Newbie
Joined: 11 Apr 2006 Posts: 8
|
Thanks. By the way where do I specify the channel name, ipaddress and port details and que manager name ?
Is it thru something like export MQSERVER=S_ws011049/TCP/localhost(1428) ?
Krish |
|
Back to top |
|
 |
wschutz |
Posted: Wed Apr 12, 2006 2:38 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Krishnanunni wrote: |
Thanks. By the way where do I specify the channel name, ipaddress and port details and que manager name ?
Is it thru something like export MQSERVER=S_ws011049/TCP/localhost(1428) ?
Krish |
The perl client uses the normal MQ client, so you can look at the MQ Clients manuals for more info. But yes, you can use the MQSERVER variable as you have indicated. The qmgr name is really optional on the client when you use MQSERVER, but if you want to specify it, it is specified on the connect to the qmgr. _________________ -wayne |
|
Back to top |
|
 |
Krishnanunni |
Posted: Wed Apr 12, 2006 3:05 am Post subject: |
|
|
Newbie
Joined: 11 Apr 2006 Posts: 8
|
Thansk for all your help. I was able to read a message from perl!!!
Great help!!
Krish |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Apr 12, 2006 3:59 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Krishnanunni wrote: |
I think I have installed the modules successfully eventhough make test had failed saying queue manager name not valid. |
Yep.
That's because you hadn't "export MQSERVER=" yet. It's just the tests on the client portion that fail, and they fail in ways that can be ignored.
But it's a lot easier to set up MQSERVER first and then run "make test". _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Krishnanunni |
Posted: Thu Apr 13, 2006 12:14 am Post subject: |
|
|
Newbie
Joined: 11 Apr 2006 Posts: 8
|
Thanks. I was under the impression that make test reads the value from CONFIG where I had specified the details. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Apr 13, 2006 3:52 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Krishnanunni wrote: |
Thanks. I was under the impression that make test reads the value from CONFIG where I had specified the details. |
Yes, that's what the CONFIG file says.
That's not actually how it works.  _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Krishnanunni |
Posted: Tue Apr 18, 2006 12:32 am Post subject: |
|
|
Newbie
Joined: 11 Apr 2006 Posts: 8
|
One more question please..
I was using the OO modules for accessing the messages. Here is my code fragment.
while ( 1 ) {
my $getmessage = MQSeries::Message->new;
$queue->Get
(
Message => $getmessage,
Sync => 1,
) or die("Unable to get message\n" .
"CompCode = " . $queue->CompCode() . "\n" .
"Reason = " . $queue->Reason() . "\n");
print "msg = $getmessage->Data() \n";
last;
}
The output I am getting is
msg = MQSeries::Message=HASH(0x209c6454)->Data()
It is returning a hash I think.
I checked the reason code for opening the que manager and que name.
CompCode => 0 Reason => 0 No reason to report.
CompCode => 0 Reason => 0 No reason to report.
which looks like the functions were successful.
Can you tell me where am I going wrong ?
Thanks,
krish |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Apr 18, 2006 3:40 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
What it's printing is that $getMessage is a hash, and then not interpolating the arrow operator to retrieve the function and call it.
It might just be getting confused by your quotes and stuff.
Try
print "msg = ".$getmessage->Data()."\n"; _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Krishnanunni |
Posted: Tue Apr 18, 2006 5:03 am Post subject: |
|
|
Newbie
Joined: 11 Apr 2006 Posts: 8
|
Thanks again. Your advice works as expected.
Krish |
|
Back to top |
|
 |
|