Thursday, July 1, 2010

Can't locate File/Compare.pm in @INC on AIX

While integrating SOA Suite 10g with Oracle Identity Management 10g, I came across some strange PERL errors, probably which pointed to the fact that some libraries were missing.

While running the osso1013 script, I tumbled upon these errors:

Can't locate File/Compare.pm in @INC (@INC contains: /project/as10g/src/shvaramb/perl58/perl58/bin/AIX/Opt/lib/5.8.3/aix-thread-multi /project/as10g/src/shvaramb/perl58/perl58/bin/AIX/Opt/lib/5.8.3 /project/as10g/src/shvaramb/perl58/perl58/bin/AIX/Opt/lib/site_perl/5.8.3/aix-thread-multi /project/as10g/src/shvaramb/perl58/perl58/bin/AIX/Opt/lib/site_perl/5.8.3 /project/as10g/src/shvaramb/perl58/perl58/bin/AIX/Opt/lib/site_perl . /u01/app/oracle/product/10.1.3/OracleAS_1/perl/site/5.8.3/lib /u01/app/oracle/product/10.1.3/OracleAS_1/perl/5.8.3/lib) at ./osso1013 line 67.
BEGIN failed--compilation aborted at ./osso1013 line 67.

The file (Compare.pm) in this case could be any other file. A quick cross check on the perl version tells me I'm using the latest one.

$ perl -version
This is perl, v5.8.2 built for aix-thread-multi
$ which perl
/usr/bin/perl

But, wait a second. Looks like I'm using the default perl supplied by the OS. Now, this is not supported by Oracle. According to the doc, it says that for every perl script you run within the Application Server Stack, you need to use the perl shipped with Application Server i.e. I should be using $OH/perl/bin/perl and not /usr/bin/perl.

Time for corrections then,

$ export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin:$ORACLE_HOME/perl/bin:$PATH
$ export LD_LIBRARY_PATH=$ORACLE_HOME/lib
$ which perl
/u01/app/oracle/product/10.1.3/OracleAS_1/perl/bin/perl

I retried, but it failed again with the same errors! I could see the Compare.pm file somewhere under $OH/perl/lib but somehow the perl interpreter doesn't seem to pick it up. You can check the paths perl is picking up with "perl -V" command. (Remember the capital "V")

After a bit of googling n metalinking, I found the solution. This machine is an AIX box and for AIX the environment variable PERL5LIB has to be set.

Setting the variable PERL5LIB:

$ export PERL5LIB=$ORACLE_HOME/perl/lib/site_perl/5.8.3:$ORACLE_HOME/perl/lib/5.8.3

Note that the "5.8.3" could be any version (5.6.1 or something else).

That did the trick and I could register SSO successfully!

No comments:

Post a Comment