Yes; the perl-script in the bottom of the mail runs ok: this is the code:

#!/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";

This script connect to the database and are it use 2 tables organism and 
library.

Results:

[EMAIL PROTECTED] html]# perl prueba1.pl
99 >>>
Manihot esculenta :1 :
aflp  8  

I run his code as root user and as another user and runs ok.

Looks as the problem is when run in the apacheweb server./

Ty for any help. 

-----Original Message-----
From: Sherrard Burton [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 06, 2007 9:33 AM
To: Rojas, Fernando (CIAT)
Cc: mason-users@lists.sourceforge.net
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

Reply via email to