Re: [Catalyst] DBIC::Schema issue - out of ideas [ more info ]

2009-02-18 Thread kakimoto

Hello, Dermot and Alejandro,

  Thanks for your help. Yes, they are very good hints :)
I tried them and I learnt more about the Catalyst framework.

 I looked at how I executed the script and I think I figured out why. I
ran myApp_create.pl within the script subdirectory. For some reason,
the files are not generated in the right places.

 I have reexecuted myApp_create.pl from outside 'scripts' and am now
getting another error (which I think is trivial) when I run myApp_server.pl

 In short: Never ever  myApp_create.pl in the scripts directory level.
Don't know why it is such (which I think is silly cause we should be
able to run the any damn script in the directory level which it is made
in without problems).

Ta!


K. akimoto 


Quoting Dermot paik...@googlemail.com:

 2009/2/18  kakim...@tpg.com.au:
  Hello Dermot,
 
   sorry, you're right.
   Yes, I could not find myAppDB::Listing myself.
 
  I ran the following command for generating the static schema
 manually.
 
   myApp_create.pl model myAppDB DBIC::Schema myApp::Schema
 create=static
  dbi:Pg:dbname=myApp  myAdminUser mypassword
 
 
  Where in catalyst do we get Catalyst to recognise all the static
 files
  found under Schema ?
 
 In lib/myApp/Model/DB.pm
 
 
 It should look something like:
 
 __PACKAGE__-config(
 schema_class = 'myApp::myAppDB',
 ...
 
 
 Your command says Create a schema under the directory 'myAppDB', so
 they should be under
 
 lib/myApp/myAppDB/
 
 They probably are there as *.new (as Alejandro says)
 
 This whole issue can be quickly resolved if you can search/grep
 through the files in ~/Controller/* and/or ~/myAppDB/*  to find out
 how is trying to use Listing.pm. Does you this table exist in you
 DB?
 
 Good luck, you'll get there eventually :)
 Dp.
 
 ___
 List: Catalyst@lists.scsys.co.uk
 Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
 Searchable archive:
 http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
 Dev site: http://dev.catalyst.perl.org/
 
 
 




___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] DBIC::Schema issue - out of ideas [ more info ]

2009-02-18 Thread kakimoto
Hello, Dermot,

   Replies are as per below.

Quoting Dermot paik...@googlemail.com:

 myApp_create.pl model myAppDB DBIC::Schema myApp::Schema  
create=static  dbi:Pg:dbname=myApp  myAdminUser mypassword

 Your command says Create a schema under the directory 'myAppDB', so
 they should be under
 
 lib/myApp/myAppDB/


I beg to differ. The files are created within
myApp/lib/myApp/Schema and myApp/lib/myApp/Schema.pm





 
 They probably are there as *.new (as Alejandro says)

Nope.


 
 This whole issue can be quickly resolved if you can search/grep
 through the files in ~/Controller/* and/or ~/myAppDB/*  to find out
 how is trying to use Listing.pm. Does you this table exist in you
 DB?
 

Yes the table exists.
I ran the myApp_create.pl script again outside of the 'scripts'
directory and running myApp_server.pl is ok except I  got another error
(small one).

I found that when I add relations into the ORM files (ie. Listings.pm,
Users.pm), I was using the notation of 

__PACKAGE__-has_many( 'listings' = 'myAppDB::Listings', 'manager_id');


That should be right because 'myAppDB' to my understanding, is how
Catalyst will recognise my schema (as defined in the myApp_create.pl
call above).

I know logically, it should be 'myApp::Schema::Listings' as that package
can be found in lib/myApp/Schema/Listings.pm
 
'
Very confused here.

Can anyone please enlighten me??



___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] DBIC::Schema issue - out of ideas [ more info ]

2009-02-18 Thread Dermot
2009/2/18  kakim...@tpg.com.au:

 lib/myApp/myAppDB/

 I beg to differ. The files are created within
 myApp/lib/myApp/Schema and myApp/lib/myApp/Schema.pm

What not Schema/myAppDB?

All of these question really belong on the DBIc mailing list which is here:

http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class


 Yes the table exists.
 I ran the myApp_create.pl script again outside of the 'scripts'
 directory and running myApp_server.pl is ok except I  got another error
 (small one).

 I found that when I add relations into the ORM files (ie. Listings.pm,
 Users.pm), I was using the notation of

 __PACKAGE__-has_many( 'listings' = 'myAppDB::Listings', 'manager_id');


 That should be right because 'myAppDB' to my understanding, is how
 Catalyst will recognise my schema (as defined in the myApp_create.pl
 call above).

 I know logically, it should be 'myApp::Schema::Listings' as that package
 can be found in lib/myApp/Schema/Listings.pm

 '
 Very confused here.

 Can anyone please enlighten me??


I'm going to do something horrid and point you at the documentation:

http://search.cpan.org/~ribasushi/DBIx-Class-0.08012/lib/DBIx/Class/Relationship.pm#has_many
and
http://search.cpan.org/~ribasushi/DBIx-Class-0.08012/lib/DBIx/Class/Schema.pm

You created you Schema with DBIx::Class::Schema. If you had used
myApp_create model myApp::Model, your model would reside under the
model directory. Instead you a a Schema.pm file the points resolves
everything to the files with the the model name you handed to it.

I not expert enough to say much more and I fear I might give incorrect
information if I try and summarise why you use 'myAppDB::Listing' and
not the full path (i suspect the latter woudl work though.

Good luck,
Dp..

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] DBIC::Schema issue - out of ideas [ more info ]

2009-02-18 Thread kakimoto
Reply is as per  below



 
 I'm going to do something horrid and point you at the documentation:
 

http://search.cpan.org/~ribasushi/DBIx-Class-0.08012/lib/DBIx/Class/Relationship.pm#has_many
 and

http://search.cpan.org/~ribasushi/DBIx-Class-0.08012/lib/DBIx/Class/Schema.pm
 
 You created you Schema with DBIx::Class::Schema. If you had used
 myApp_create model myApp::Model, your model would reside under the
 model directory. Instead you a a Schema.pm file the points resolves
 everything to the files with the the model name you handed to it.
 

K.akimoto: 
hi,

1) Please read the latest update on this thread which I posted. I found
the solution
2) Please read the command which I used properly.
  a) myApp::Schema is used hence, the ORM files will be created in
'lib/myApp/Schema'. I have looked at the output and it's confirmed. 
  b) the script/myApp_create.pl command is:
 myApp_create.pl model myAppDB DBIC::Schema myApp::Schema create=static
dbi:Pg:dbname=myApp  myAdminUser mypassword




___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] DBIC::Schema issue - out of ideas [ more info ]

2009-02-18 Thread Tomas Doran


On 18 Feb 2009, at 10:43, kakim...@tpg.com.au wrote:


 In short: Never ever  myApp_create.pl in the scripts directory  
level.

Don't know why it is such (which I think is silly cause we should be
able to run the any damn script in the directory level which it is  
made

in without problems).


From a quick scan of the changelog, I make that as being fixed in 2005!

What version are you running, as I certainly can't replicate this in  
any of my applications?


If you create a new application, and then try to run the create, can  
you make it happen again, and if so please cough up the command line  
as it needs fixing! :)


Cheers
t0m
 


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] DBIC::Schema issue - out of ideas.

2009-02-17 Thread kakimoto

hi, everyone :)

 I just updated my ORM (DBIx::Class) based on the latest tutes. The
application was working fine until I found a bug which led to another
bug. I corrected the error and saw an update to the tute. With itchy
fingers, I decided to update my ORM and now, when  I run myApp_server.pl
or myApp_test.pl,  I get the errors below.

kakim...@gautica:~/projects/myApp/script$ ./server
Couldn't instantiate component myApp::Model::myAppDB, Cannot load
schema class 'myApp::Schema': DBIx::Class::Schema::throw_exception():
DBIx::Class::Row::throw_exception(): Can't locate myAppDB/Listi
ngs.pm in @INC (@INC contains:
/home/kakimoto/projects/myApp/script/../lib /etc/perl
/usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5
/usr/share/perl5 /usr/lib/perl/5.8 /usr/share/pe
rl/5.8 /usr/local/lib/site_perl .
/home/kakimoto/projects/myApp/lib/myApp/Schema) at
/usr/local/share/perl/5.8.8/Class/C3/Componentised.pm line 126.
Compilation failed in require at
/usr/local/share/perl/5.8.8/Class/C3/Componentised.pm line 126.
Compilation failed in require at
/usr/local/share/perl/5.8.8/Catalyst/Model/DBIC/Schema.pm line 295.
 at ./server line 56 at ./server line 56
 Compilation failed in require at ./server line 56.
 kakim...@gautica:~/projects/myApp/script$


1) './server' = './myApp_server.pl'
2) line 56 in ./server reads 'require myApp;' 


what I have done:


1) Googled and found another post which has the similar error message.
Sadly, the cause is different and that post was for a catalyst app on
activestate perl
(http://www.nabble.com/Issue-with-Tutorial-section-3-td21139137.html)

2) did a sanity check (ie  perl -cw myApp_server.pl  ) and it checks
out fine. Syntax is ok. This is off 
http://lists.scsys.co.uk/pipermail/catalyst/2006-November/010337.html

3) nope, i did not miss any ending ';' (based on
http://lists.scsys.co.uk/pipermail/catalyst/2006-November/010232.html).

4) read up on the docs. These are (not limited to):
  - DBIx::Class, 
  -Catalyst::Model::DBIC::Schema 
  - Catalyst tutes (again)
  - etc...


I am going to have to break down the app to only its authorisation
components and try debugging from there.
 
Any ideas? 

Thanks,
K. akimoto

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] DBIC::Schema issue - out of ideas [ more info ]

2009-02-17 Thread kakimoto

Hi, guys,

   Just about to shut the machine down when i realised I could give a
little more info.

This is the command I ran to generate the static ORM files.

 myApp_create.pl model myAppDB DBIC::Schema myApp::Schema create=static
dbi:Pg:dbname=myApp  myAdminUser mypassword

- the Schema.pm file got generated fine,
- all the files under Schema/ are matching what's on the database.
- I added the relationships to the files under Schema/
- I removed ' int (4) ' or something like that which limited the IDs
(primary keys) of my db tables to 4 digits.


Any ideas on what could have possible failed would be helpful.


Thank you

K. akimoto
 

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] DBIC::Schema issue - out of ideas [ more info ]

2009-02-17 Thread Dermot
2009/2/17  on...@houseofdesign.de:

 On Tue, 17 Feb 2009 23:07:02 +1100, kakim...@tpg.com.au wrote:
 Hi, guys,

Just about to shut the machine down when i realised I could give a
 little more info.

 This is the command I ran to generate the static ORM files.

  myApp_create.pl model myAppDB DBIC::Schema myApp::Schema create=static
 dbi:Pg:dbname=myApp  myAdminUser mypassword

 - the Schema.pm file got generated fine,
 - all the files under Schema/ are matching what's on the database.
 - I added the relationships to the files under Schema/
 - I removed ' int (4) ' or something like that which limited the IDs
 (primary keys) of my db tables to 4 digits.


 Any ideas on what could have possible failed would be helpful.


 Do you run ./myApp_server.pl from within the scripts/ directory?

 try scripts/myApp_server.pl from the root directory!

This should really go to the DBIc mailing list. This problem that DBIx
can't locate Listings.pm which might be defined in you Schema.pm file.

If your pwd is /home/kakimoto/projects/ and you type `find . -name
Listings.pm -ls` do you see the file?

Can you post the contents of that file.
Good luck,
Dp.

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] DBIC::Schema issue - out of ideas [ more info ]

2009-02-17 Thread kakimoto
hi Dermot and all,

   I tried running myApp_server.pl from the root dir (ie. perl
scripts/myApp_server.pl or script/myApp_server.pl) and the same error
message still comes up.

   Also, I did an upgrade of perl from 5.8.8 to 5.8.9 and when I first
ran myApp_server.pl, there was an error that parent.pm was not to be
found. For the moment, I have included a path to parent.pm explicitly
pointing to the copy in perl 5.8.8 . I checked around and it seemed that
parent.pm is not supported by perl 5.8.9.
  Any ideas on these two issues?


thank you:)



Quoting Dermot paik...@googlemail.com:

 2009/2/17  on...@houseofdesign.de:
 
  On Tue, 17 Feb 2009 23:07:02 +1100, kakim...@tpg.com.au wrote:
  Hi, guys,
 
 Just about to shut the machine down when i realised I could
 give a
  little more info.
 
  This is the command I ran to generate the static ORM files.
 
   myApp_create.pl model myAppDB DBIC::Schema myApp::Schema
 create=static
  dbi:Pg:dbname=myApp  myAdminUser mypassword
 
  - the Schema.pm file got generated fine,
  - all the files under Schema/ are matching what's on the
 database.
  - I added the relationships to the files under Schema/
  - I removed ' int (4) ' or something like that which limited the
 IDs
  (primary keys) of my db tables to 4 digits.
 
 
  Any ideas on what could have possible failed would be helpful.
 
 
  Do you run ./myApp_server.pl from within the scripts/ directory?
 
  try scripts/myApp_server.pl from the root directory!
 
 This should really go to the DBIc mailing list. This problem that
 DBIx
 can't locate Listings.pm which might be defined in you Schema.pm
 file.
 
 If your pwd is /home/kakimoto/projects/ and you type `find . -name
 Listings.pm -ls` do you see the file?
 
 Can you post the contents of that file.
 Good luck,
 Dp.
 
 ___
 List: Catalyst@lists.scsys.co.uk
 Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
 Searchable archive:
 http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
 Dev site: http://dev.catalyst.perl.org/
 
 
 




___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] DBIC::Schema issue - out of ideas [ more info ]

2009-02-17 Thread Dermot
2009/2/17  kakim...@tpg.com.au:
 hi Dermot and all,

   I tried running myApp_server.pl from the root dir (ie. perl
 scripts/myApp_server.pl or script/myApp_server.pl) and the same error
 message still comes up.

   Also, I did an upgrade of perl from 5.8.8 to 5.8.9 and when I first
 ran myApp_server.pl, there was an error that parent.pm was not to be
 found. For the moment, I have included a path to parent.pm explicitly
 pointing to the copy in perl 5.8.8 . I checked around and it seemed that
 parent.pm is not supported by perl 5.8.9.
  Any ideas on these two issues?


 thank you:)

You haven't answered the questions.

The error says Can't locate myAppDB/Listings.pm

Can you find it?

You need to install Parent
(http://search.cpan.org/~corion/parent-0.221/lib/parent.pm). There is
nothing in the docs to say that it won't 5.8.9. You just haven't
installed it against that version of your perl binary. You didn't need
to install a new perl, just configure your myApp correctly.

Good Luck,
Dp.

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] DBIC::Schema issue - out of ideas [ more info ]

2009-02-17 Thread kakimoto
Hello Dermot,

  sorry, you're right.
 Yes, I could not find myAppDB::Listing myself.

I ran the following command for generating the static schema manually.

 myApp_create.pl model myAppDB DBIC::Schema myApp::Schema create=static
dbi:Pg:dbname=myApp  myAdminUser mypassword


Where in catalyst do we get Catalyst to recognise all the static files
found under Schema ?


ta






 
 You haven't answered the questions.
 
 The error says Can't locate myAppDB/Listings.pm
 
 Can you find it?
 
 You need to install Parent
 (http://search.cpan.org/~corion/parent-0.221/lib/parent.pm). There
 is
 nothing in the docs to say that it won't 5.8.9. You just haven't
 installed it against that version of your perl binary. You didn't
 need
 to install a new perl, just configure your myApp correctly.
 
 Good Luck,
 Dp.
 
 ___
 List: Catalyst@lists.scsys.co.uk
 Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
 Searchable archive:
 http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
 Dev site: http://dev.catalyst.perl.org/
 
 
 




___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] DBIC::Schema issue - out of ideas.

2009-02-17 Thread kakimoto
Hello Alejandro,
  Yep, I made sure that the 'Schema' subdir does not exist before I ran
the following command to create static ORM files.

 myApp_create.pl model myAppDB DBIC::Schema myApp::Schema create=static
dbi:Pg:dbname=myApp  myAdminUser mypassword

Yet, i followed tute 3 of the catalyst manual and DBIC docs to no success.

What am I missing? 




Quoting Alejandro Imass alejandro.im...@gmail.com:

 Are you using a static schema? (it seems).
 
 If so, and unless you have customized the generated Schema files, it
 is usually safe to delete your Schema classes and generate the ORM
 model again.
 
 If you re-generate your static schema, on top of the old one, the
 model class will not overwrite and you will have a .new class
 sitting beside the old one. Also the schema loader does not deal
 with
 table drops and I think it doesn't deal with updates either, so you
 are always better off by deleting your schema classes prior to
 reloading your static schema.
 
 On Wed, Feb 18, 2009 at 7:26 AM,  kakim...@tpg.com.au wrote:
 
  hi, everyone :)
 
   I just updated my ORM (DBIx::Class) based on the latest tutes.
 The
  application was working fine until I found a bug which led to
 another
  bug. I corrected the error and saw an update to the tute. With
 itchy
  fingers, I decided to update my ORM and now, when  I run
 myApp_server.pl
  or myApp_test.pl,  I get the errors below.
 
  kakim...@gautica:~/projects/myApp/script$ ./server
  Couldn't instantiate component myApp::Model::myAppDB, Cannot
 load
  schema class 'myApp::Schema':
 DBIx::Class::Schema::throw_exception():
  DBIx::Class::Row::throw_exception(): Can't locate myAppDB/Listi
  ngs.pm in @INC (@INC contains:
  /home/kakimoto/projects/myApp/script/../lib /etc/perl
  /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8
 /usr/lib/perl5
  /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/pe
  rl/5.8 /usr/local/lib/site_perl .
  /home/kakimoto/projects/myApp/lib/myApp/Schema) at
  /usr/local/share/perl/5.8.8/Class/C3/Componentised.pm line 126.
  Compilation failed in require at
  /usr/local/share/perl/5.8.8/Class/C3/Componentised.pm line 126.
  Compilation failed in require at
  /usr/local/share/perl/5.8.8/Catalyst/Model/DBIC/Schema.pm line
 295.
   at ./server line 56 at ./server line 56
   Compilation failed in require at ./server line 56.
   kakim...@gautica:~/projects/myApp/script$
 
 
  1) './server' = './myApp_server.pl'
  2) line 56 in ./server reads 'require myApp;'
 
 
  what I have done:
  
 
  1) Googled and found another post which has the similar error
 message.
  Sadly, the cause is different and that post was for a catalyst app
 on
  activestate perl
 
 (http://www.nabble.com/Issue-with-Tutorial-section-3-td21139137.html)
 
  2) did a sanity check (ie  perl -cw myApp_server.pl  ) and it
 checks
  out fine. Syntax is ok. This is off
 
 http://lists.scsys.co.uk/pipermail/catalyst/2006-November/010337.html
 
  3) nope, i did not miss any ending ';' (based on
 
 http://lists.scsys.co.uk/pipermail/catalyst/2006-November/010232.html).
 
  4) read up on the docs. These are (not limited to):
   - DBIx::Class,
   -Catalyst::Model::DBIC::Schema
   - Catalyst tutes (again)
   - etc...
 
 
  I am going to have to break down the app to only its authorisation
  components and try debugging from there.
 
  Any ideas?
 
  Thanks,
  K. akimoto
 
  ___
  List: Catalyst@lists.scsys.co.uk
  Listinfo:
 http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
  Searchable archive:
 http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
  Dev site: http://dev.catalyst.perl.org/
 
 
 ___
 List: Catalyst@lists.scsys.co.uk
 Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
 Searchable archive:
 http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
 Dev site: http://dev.catalyst.perl.org/
 
 
 




___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/