Inline::Java problem dealing with PayPal .jar file

[email protected] (Tom Kane)
Newsgroups perl.inline
Message-ID <12270857.1351722059076.JavaMail.root@elwamui-mouette.atl.sa.earthlink.net>
Hi,

I am trying to work with Inline::Java from within a Linux/nginx/fastcgi/Catalyst framework. I need to be able to interface to a PayPal .jar file, which is the only method of access I have to their "Hosted Checkout" credit card processing.

I have a perl module (.pm) that executes an Inline Java STUDY on the PayPal .jar file. I can access this module from a non-Catalyst perl program and everything works fine. However, if I try to execute this same module from within a Catalyst module, there is a problem and I don't know if this stems from something being done within Inline::Java's STUDY process or whether Catalyst is doing or missing something.

Before going forward, I would like to add that I have been able to successfully use Catalyst together with Inline::Java where I have a simple class defined in a very simple .jar file. Works like a champ. I use a simple STUDY command:

use Inline Java  => 'STUDY',
           CLASSPATH => "/path/to/Greeter.jar",
           STUDY => [ Greeter ] ;

So it's not as if there are incompatibilities between Catalyst and Inline::Java.

The problem comes from the fact that the PayPal .jar file's methods are more complex than the simple methods used in my successful Catalyst-Inline::Java test. 

I declare the PayPal methods that I'm trying to use as follows:

use Inline Java  => 'STUDY',
           CLASSPATH => "/path/to/payflow.jar",
           STUDY => [
                      'paypal.payflow.AuthorizationTransaction',
                      'paypal.payflow.BillTo',
                      'paypal.payflow.Currency',
                      'paypal.payflow.Invoice',
                      'paypal.payflow.PayflowConnectionData',
                      etc.
                    ];

The problem seems to be a namespace issue as I get the error message:

... (perhaps you forgot to load "paypal::payflow::Invoice"?)

As I said, the multi-layered PayPal methods declaration works successfully when I execute it from a non-Catalyst perl program. But it seems as though Catalyst expects there to be separate sub-directories for each of the methods (given the use of the :: separators between paypal, payflow, and Invoice).

Have I missed something with regard to how Inline::Java STUDY works when there is a multi-layered library? (Except it works okay outside of Catalyst, which, of course, may be purely accidental.)

Thanks for any help.

Tom
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.