Forgot the list... ---------- Forwarded message ---------- From: Patrick LeBoutillier <[EMAIL PROTECTED]> Date: Nov 23, 2005 11:24 AM Subject: Re: Calling static methods from a studied class without creating an object To: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
Hi, On 11/23/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi, > > I was wondering if it is possible to call a static method from a class which > has > been studied by Inline::Java, if there is no constructor available for the > class. For example, I have written the following script: > > ---------------------------------------------------------------------------------- > #C:\sonicMQ-Perl\ShowQueues.pl > > use Inline Java => 'STUDY', STUDY => > ['com.sonicsw.mq.mgmtapi.runtime.MQProxyFactory']; > > #a bunch of perl commands > > my $broker = > com::sonicsw::mq::mgmtapi::runtime::MQProxyFactory->createBrokerProxy($connector, > $jmxName); #line 23 What type of object does createBrokerProxy return? You must add that to the STUDY list (or use AUTOSTUDY) to be able to manipulate that class type from Perl. Patrick > > my $queues = $broker->getQueues(0); #line 24 > > #some more perl commands > > -------------------------------------------------------------------------------- > > It is to be noted here that I have already defined $connector and $jmxName > before calling the static method, createBrokerProxy. I have also looked at the > java API used here, and the CLASSPATH environment variable, and they all seem > to > be fine. When I try to run this script, I get the following error: > > -------------------------------------------------------------------------------- > > Can't call method 'getQueues' on an object (Inline::Java::Object) that is not > bo > und to Perl at C:\sonicMQ-Perl\ShowQueues.pl line 24 > > -------------------------------------------------------------------------------- > > What am I doing wrong here? I'll appreciate any point-outs. > > Thanks. > > Vishal > > ---------------------------------------- > This mail sent through www.mywaterloo.ca > -- ===================== Patrick LeBoutillier Laval, Québec, Canada -- ===================== Patrick LeBoutillier Laval, Québec, Canada