You are explicitely studying the class you have problem with (com.ibm.client.Contract). It doesn't even look like an AUTOSTUDY problem. Is the Contract class in your classpath?
Vishal Quoting Jay Strauss <[EMAIL PROTECTED]>: > Hi, > > I can't seem to autostudy. I've looked at the archives, and I know I need to > > study at least one class in order to autostudy others. But when I do the > below I get: > > [EMAIL PROTECTED]:~/Finance-IB-TWS/t$ perl demo.pl > Can't locate object method "new" via package > "com::ib::client::Contract" (perhaps you forgot to load > "com::ib::client::Contract"?) at demo.pl line 38, <GEN8> line 16. > > If I uncomment the studying of the Contract class everything works. Maybe I > > misunderstand autostudy, but I thought it was an ease of use thing, so you > don't have to list every java class you might use > > Thanks > Jay > > use Finance::IB::TWS; > use Finance::IB::TWS::callback; > > use Inline ( > Java => 'STUDY', > AUTOSTUDY => 1, > STUDY => [ > 'com.ib.client.EClientSocket', > # 'com.ib.client.Contract', > ], > ); > > > my $callback = Finance::IB::TWS::callback->new(); > > my $tws = Finance::IB::TWS->new(callback=>$callback); > > my $ib = $tws->get_EClientSocket(); > my $api = $tws->get_api(); > > #### Host Port Client_ID > #### ---- ---- --------- > my @tws_GUI_location = qw/ 127.0.0.1 7496 15 /; > > $ib->eConnect(@tws_GUI_location); > $api->OpenCallbackStream() ; > > my $flag = 1; > > while ((my $got_data = $api->WaitForCallback(.01)) > -1) { > if ($got_data) { > print "process data\n"; > $api->ProcessNextCallback() ; > } > else { > > if ($flag) { > my $contract = com::ib::client::Contract->new(); > $contract->{m_symbol} = 'QQQQ'; > $contract->{m_secType} = 'STK'; > $contract->{m_exchange} = 'SMART'; > my $contract_id = 50; > $ib->reqMktData($contract_id, $contract); > $flag=0; > } > print "No data to process\n"; > } > } > ---------------------------------------- This mail sent through www.mywaterloo.ca