is there anything peculiar about your Class::DBI install?

some troubleshooting techniques that may help:

compare your @INC paths for each environment.

try a 'use Class::DBI' within your mason component and see if it  
croaks -- the errors from a load failure from 'use base' may not be  
bubbling up correctly.

interrogate your class for its methods from each environment:

   use Class::Can;
   use Data::Dumper;
   print Dumper({ Class::Can->interrogate('ESTdb::Organism') });

do a Dumper(\%INC) from each environment, and look for relevant  
differences (are Class::DBI and ESTdb::* being loaded from the same  
correct lib paths?)



On Aug 6, 2007, at 9:59 AM, Rojas, Fernando (CIAT) wrote:

> Ok I did it:
>
> This is the perl_code and it runs OK; basically it returns count of  
> the tables of database:
>
> [EMAIL PROTECTED] html]# perl scriptotal.pl
> Manihot esculenta
> Manihot esculenta
> 13050
> 5809
> 1875
> 3934
>
>
> #!/usr/bin/perl
> use ESTdb::Organism;
> use ESTdb::Library;
> #my $root = $m->comp('/root');
> #my $species = $m->comp('/species');
> my $species = 'Manihot esculenta';
> print "$species \n";
> my $orgn = (ESTdb::Organism->search(name => $species))[0];
> print $orgn->name(), "\n";
> print ESTdb::Library->sql_nests_by_species($orgn)->select_val,"\n";
> 1 ?  '' : ESTdb::Est->rel_count({clone => {library => {organism =>  
> {organism=> $orgn}}}});
> print ESTdb::Library->sql_ncontig_by_species(1, 999999, $orgn)- 
> >select_val,"\n";
> print ESTdb::Library->sql_ncontig_by_species(2, 99999, $orgn)- 
> >select_val,"\n";
> print ESTdb::Library->sql_ncontig_by_species(1, 1, $orgn)- 
> >select_val,"\n";
>
> I restarted the web server; I can't find mason_data in the system;   
> the error running in web persist:
>
> error:  Can't locate object method "search" via package  
> "ESTdb::Organism" at /usr/local/www/meest/html/index.html line 40.
>
> context:  ...
> 36:  use ESTdb::Library;
> 37:  my $root = $m->comp('/root');
> 38:  my $species = $m->comp('/species');
> 39:  print "$species \n";
> 40:  my $orgn = (ESTdb::Organism->search(name => $species))[0];
> 41:  </%init>
> 42:
>
> code stack:  /usr/local/www/meest/html/index.html:40
> /usr/local/www/meest/html/autohandler:3
>
> Thank you for more help
>
>
>
> -----Original Message-----
> From: Sherrard Burton [mailto:[EMAIL PROTECTED]
> Sent: Monday, August 06, 2007 9:54 AM
> To: Rojas, Fernando (CIAT)
> Cc: Mason-Users
> Subject: Re: [Mason] Can't locate object method "search" via package
>
> this looks like the stack trace from the earlier error. the latest  
> error you mentioned was related to the table method, not search.
>
> error:  Error during compilation of /usr/local/www/meest/html/ 
> index.html:
>>> Can't locate object method "table" via package "ESTdb::Organism"  
>>> at  >> /usr/lib/perl5/site_perl/5.8.0/ESTdb/Organism.pm line 3   
>>> >>  >>
>
> i would clear out the obj files, which will be a different  
> locations depending on your setup. try locate mason_data to see  
> where they might be. i would also restart the web server to make  
> sure you aren't dealing with page caching issues. if that doesn't  
> work, then you should expand your script to include all of the  
> method that you are calling in the mason page, using the exact same  
> syntax. you basically take the code in your mason page and strip  
> out the apache- and mason-specific bits. if that doesn't work, then  
> i'm at a loss.
>
> Rojas, Fernando (CIAT) wrote:
>> This is the stack-trace:
>>
>> Trace begun at /usr/lib/perl5/site_perl/5.8.0/HTML/Mason/ 
>> Exceptions.pm
>> line 131 HTML::Mason::Exceptions::rethrow_exception('Can\'t locate
>> object method "search" via package "ESTdb::Organism" at
>> /usr/local/www/meest/html/index.html line 41.^J') called at
>> /usr/local/www/meest/html/index.html line 41
>> HTML::Mason::Commands::__ANON__ at
>> /usr/lib/perl5/site_perl/5.8.0/HTML/Mason/Component.pm line 136
>> HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH 
>> (0x
>> 924c900)') called at
>> /usr/lib/perl5/site_perl/5.8.0/HTML/Mason/Request.pm line 1074 eval
>> {...} at /usr/lib/perl5/site_perl/5.8.0/HTML/Mason/Request.pm line
>> 1068 HTML::Mason::Request::comp(undef, undef) called at
>> /usr/lib/perl5/site_perl/5.8.0/HTML/Mason/Request.pm line 760
>> HTML::Mason::Request::call_next 
>> ('HTML::Mason::Request::ApacheHandler=H
>> ASH(0x926642c)') called at /usr/local/www/meest/html/autohandler line
>> 3 HTML::Mason::Commands::__ANON__ at
>> /usr/lib/perl5/site_perl/5.8.0/HTML/Mason/Component.pm line 136
>> HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH 
>> (0x
>> 8b3a9d0)') called at
>> /usr/lib/perl5/site_perl/5.8.0/HTML/Mason/Request.pm line 1069 eval
>> {...} at /usr/lib/perl5/site_perl/5.8.0/HTML/Mason/Request.pm line
>> 1068 HTML::Mason::Request::comp(undef, undef, undef) called at
>> /usr/lib/perl5/site_perl/5.8.0/HTML/Mason/Request.pm line 338 eval
>> {...} at /usr/lib/perl5/site_perl/5.8.0/HTML/Mason/Request.pm line  
>> 338
>> eval {...} at /usr/lib/perl5/site_perl/5.8.0/HTML/Mason/Request.pm
>> line 297
>> HTML::Mason::Request::exec 
>> ('HTML::Mason::Request::ApacheHandler=HASH(0
>> x926642c)') called at
>> /usr/lib/perl5/site_perl/5.8.0/HTML/Mason/ApacheHandler.pm line 128
>> eval {...} at
>> /usr/lib/perl5/site_perl/5.8.0/HTML/Mason/ApacheHandler.pm line 128
>> HTML::Mason::Request::ApacheHandler::exec 
>> ('HTML::Mason::Request::Apach
>> eHandler=HASH(0x926642c)') called at
>> /usr/lib/perl5/site_perl/5.8.0/HTML/Mason/ApacheHandler.pm line 825
>> HTML::Mason::ApacheHandler::handle_request 
>> ('HTML::Mason::ApacheHandler
>> =HASH(0x82ad010)', 'Apache=SCALAR(0x9219438)') called at
>> /usr/local/apache/conf/handler.pl line 32
>> MyMason::MyApp::handler('Apache=SCALAR(0x9219438)') called at
>> /dev/null line 0 eval {...} at /dev/null line 0
>>
>> Thanks
>>
>> -----Original Message-----
>> From: Sherrard Burton [mailto:[EMAIL PROTECTED]
>> Sent: Monday, August 06, 2007 9:41 AM
>> To: Rojas, Fernando (CIAT)
>> Cc: Mason-Users
>> Subject: Re: [Mason] Can't locate object method "search" via package
>>
>> but you don't seem to be calling all of the same methods from the  
>> script that you are trying to use from the web interface.
>>
>> from the stack trace you should be able to see which line in your  
>> mason component called the method that eventually led to this error.
>>
>> ps--you should use reply-all so that these discussions stay on- 
>> list where everybody can benefit.
>>
>> Rojas, Fernando (CIAT) wrote:
>>> TY for your help; I have this script that was attached to the end  
>>> of my e-mail and it runs ok:
>>>
>>>  #!/usr/bin/perl
>>>>> use strict;
>>>>> use ESTdb::Organism;
>>>>> use ESTdb::Library;
>>>>> my $species = 'Manihot esculenta';
>>>>> my $orgn = 99;
>>>>> print "$orgn >>>\n";
>>>>> print "$species :";
>>>>> my $orgn = (ESTdb::Organism->search(name => $species))[0]; print
>>>>> "$orgn :\n"; my $library = 0; my $name = 'aflp'; print "$name  ";
>>>>> my $library = (ESTdb::Library->search(name => $name))[0]; print
>>>>> "$library \n";
>>> In this case im querying 2 tables of database organism and  
>>> library and runs ok:
>>>
>>> Ty for your help again.
>>>
>>> -----Original Message-----
>>> From: Sherrard Burton [mailto:[EMAIL PROTECTED]
>>> Sent: Monday, August 06, 2007 9:32 AM
>>> To: Rojas, Fernando (CIAT)
>>> Subject: Re: [Mason] Can't locate object method "search" via package
>>>
>>> it sounds like you are having perl problems. are you sure the  
>>> same code works from a command-line script?
>>>
>>> that message usually means that you haven't "use"ed the package  
>>> that exports that method, or that that method doesn't exist in  
>>> the package.
>>>
>>> maybe you should prototype the code in a perl script or module  
>>> called from the command line first so that you can distinguish  
>>> the simple perl errors from any that are mason-specific.
>>>
>>> good luck
>>>
>>>
>>> Rojas, Fernando (CIAT) wrote:
>>>> TY for your answer; I tried it; now im getting:
>>>>
>>>> error:  Error during compilation of /usr/local/www/meest/html/ 
>>>> index.html:
>>>> Can't locate object method "table" via package "ESTdb::Organism" at
>>>> /usr/lib/perl5/site_perl/5.8.0/ESTdb/Organism.pm line 3
>>>>
>>>> TY.
>>>>
>>>> -----Original Message-----
>>>> From: Sherrard Burton [mailto:[EMAIL PROTECTED]
>>>> Sent: Monday, August 06, 2007 7:23 AM
>>>> To: Rojas, Fernando (CIAT)
>>>> Cc: mason-users@lists.sourceforge.net
>>>> Subject: Re: [Mason] Can't locate object method "search" via  
>>>> package
>>>>
>>>> i'm not sure, but i'm guessing you should be using
>>>>
>>>> use ESTdb::Organism;
>>>> use ESTdb::Library;
>>>>
>>>> in your mason code instead of
>>>>
>>>> use base 'ESTdb::Organism';
>>>> use base 'ESTdb::Library';
>>>>
>>>>
>>>>
>>>> Rojas, Fernando (CIAT) wrote:
>>>>> ______________________________________________
>>>>> *From:  * Rojas, Fernando (CIAT)
>>>>> *Sent:  * Friday, August 03, 2007 5:47 PM
>>>>> *To:    * 'mason-users@lists.sourceforge.net'
>>>>> *Subject:       *
>>>>>
>>>>> HI: I have a web-site running in this environment:
>>>>>
>>>>> Linux (Red Hat 8.0 3-2-7); Apache 1.3.24 Mod-Perl 1.29 Perl 5.8.5;
>>>>> Html-Mason-1.27; MySql 4.1.20; Al CPAN Modules installed
>>>>>
>>>>> Im getting this error running my web aplication:
>>>>>
>>>>> *error:* Can't locate object method "search" via package
>>>>> "ESTdb::Organism" at /usr/local/www/meest/html/index.html line 41.
>>>>> *context:*
>>>>> *...*
>>>>> *37:*     use base 'ESTdb::Library';
>>>>> *38:*     my $root = $m->comp('/root');
>>>>> *39:*     my $species = $m->comp('/species');
>>>>> *40:*     print "$species \n";
>>>>> *41:*     my $orgn = (ESTdb::Organism->search(name => $species)) 
>>>>> [0];
>>>>> *42:*     </%init>
>>>>> *43:*
>>>>> *code stack:* /usr/local/www/meest/html/index.html:41
>>>>> /usr/local/www/meest/html/autohandler:3
>>>>>
>>>>> *The index.html is:*
>>>>> <h1><% $orgn->name() %> ESTs</h1>
>>>>> <p/>
>>>>> <table>
>>>>>   <tbody>
>>>>>     <tr> <th>ESTs </th>
>>>>>       <td> <%
>>>>> ESTdb::Library->sql_nests_by_species($orgn)->select_val
>>>>> %> <%  1 ?  '' : ESTdb::Est->rel_count({clone => {library =>
>>>>> {organism => {organism=> $orgn}}}})%> </td></tr>
>>>>>     <tr> <th>non redondant contigs </th>
>>>>>       <td> <% ESTdb::Library->sql_ncontig_by_species(1, 999999,
>>>>> $orgn)->select_val %> <td></tr>
>>>>>     <tr> <th>Contigs : </th>
>>>>>        <td><% ESTdb::Library->sql_ncontig_by_species(2, 99999,
>>>>> $orgn)->select_val%></td></tr>
>>>>>     <tr> <th>Singletons : </th>
>>>>>       <td><% ESTdb::Library->sql_ncontig_by_species(1, 1,
>>>>> $orgn)->select_val%></td></tr> </tbody> </table> <hr/>
>>>>> <h2>Search</h2> <ul> <li>search <a
>>>>> href="<%$root%>/byfactor/factor.html">by
>>>>> factor</a></li> <li>search <a
>>>>> href="<%$root%>/bylib/library.html">by
>>>>> lib</a></li> <li>search <a href="<%$root%>/byest/est.html">by
>>>>> est</a></li> <li>search <a href="<%$root%>/bycn/cn.html">by
>>>>> contig</a></li> </ul> <hr/> <h2>Blast</h2> <a
>>>>> href="<%$root%>/blast/blast">blast</a>
>>>>> <!--
>>>>> <ul>
>>>>> <li>blast on <a href="blast/ests/">ESTs</a></li> <li>blast on <a
>>>>> href="blast/contigs/">Contigs</li>
>>>>> </ul>
>>>>> -->
>>>>> <%init>
>>>>> use strict;
>>>>> use base 'ESTdb::Organism';
>>>>> use base 'ESTdb::Library';
>>>>> my $root = $m->comp('/root');
>>>>> my $species = $m->comp('/species'); print "$species \n"; my  
>>>>> $orgn =
>>>>> (ESTdb::Organism->search(name => $species))[0]; </%init>
>>>>>
>>>>> *Organism.pm code is:*
>>>>> package ESTdb::Organism;
>>>>> use base 'ESTdb::DBI';
>>>>> __PACKAGE__->table('organism');
>>>>> __PACKAGE__->columns(All => qw/ organism name/);
>>>>> __PACKAGE__->has_many(libs => 'ESTdb::Library');
>>>>>
>>>>> *DBI.pm is:*
>>>>> package ESTdb::DBI;
>>>>> use strict;
>>>>> use base 'Class::DBI';
>>>>> use Data::Dumper;
>>>>> my $dsn      = 'DBI:mysql:dbname=est;host=localhost;port=3306';
>>>>> my $user     = 'root';
>>>>> my $password = 'ciatroot';
>>>>> __PACKAGE__->connection($dsn, $user, $password);
>>>>> #Class::DBI->connection($dsn, $user, $password);
>>>>> #__PACKAGE__->set_db('Main', $dsn, $user, $password); ..
>>>>>
>>>>> *Someone could give me some ideas.  What's happening.??* *I have
>>>>> this Perl Script and when I run as root or as another user it runs
>>>>> ok connecting to the database and retrieving information.*
>>>>>
>>>>> #!/usr/bin/perl
>>>>> use strict;
>>>>> use ESTdb::Organism;
>>>>> use ESTdb::Library;
>>>>> my $species = 'Manihot esculenta';
>>>>> my $orgn = 99;
>>>>> print "$orgn >>>\n";
>>>>> print "$species :";
>>>>> my $orgn = (ESTdb::Organism->search(name => $species))[0]; print
>>>>> "$orgn :\n"; my $library = 0; my $name = 'aflp'; print "$name  ";
>>>>> my $library = (ESTdb::Library->search(name => $name))[0]; print
>>>>> "$library \n";
>>>>>
>>>>>
>>>>> Sorry for the long mail;; I hope some help  THANKS.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> FERNANDO ROJAS
>>>>> Ingeniero de Sistemas y Computación Unidad de Sistemas de
>>>>> Información Centro Internacional de Agricultura Tropical (CIAT)
>>>>> E-mail: [EMAIL PROTECTED]
>>>>> Phone:(57-2)445-01-00 Ext 3647
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------ 
>>>>> -
>>>>> -
>>>>> -
>>>>> ---
>>>>>
>>>>> ------------------------------------------------------------------ 
>>>>> -
>>>>> -
>>>>> -
>>>>> ---- This SF.net email is sponsored by: Splunk Inc.
>>>>> Still grepping through log files to find problems?  Stop.
>>>>> Now Search log events and configuration files using AJAX and a  
>>>>> browser.
>>>>> Download your FREE copy of Splunk now >>  http://get.splunk.com/
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------ 
>>>>> -
>>>>> -
>>>>> -
>>>>> ---
>>>>>
>>>>> _______________________________________________
>>>>> Mason-users mailing list
>>>>> Mason-users@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/mason-users
>>
>> --------------------------------------------------------------------- 
>> -
>> --- This SF.net email is sponsored by: Splunk Inc.
>> Still grepping through log files to find problems?  Stop.
>> Now Search log events and configuration files using AJAX and a  
>> browser.
>> Download your FREE copy of Splunk now >>  http://get.splunk.com/
>> _______________________________________________
>> Mason-users mailing list
>> Mason-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/mason-users
>
> ---------------------------------------------------------------------- 
> ---
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a  
> browser.
> Download your FREE copy of Splunk now >>  http://get.splunk.com/
> _______________________________________________
> Mason-users mailing list
> Mason-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mason-users

---
michael reece :: software engineer :: [EMAIL PROTECTED]



-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to