|
|
[Catalyst] mod_perl -- Undefined subroutine &MyApp::handler
By Michael Reece at Mar 29, 2005, 01:12 am UTC
Greetings. I am testing out Catalyst as an alternative to Maypole (specifically MasonX::Maypole). My major gripe about Maypole and MXM is that it shares config data across applications and I have not been able to reconcile all the issues in order to run multiple apps on the same mod_perl apache So... More...
Greetings.
I am testing out Catalyst as an alternative to Maypole (specifically MasonX::Maypole). My major gripe about Maypole and MXM is that it shares config data across applications and I have not been able to reconcile all the issues in order to run multiple apps on the same mod_perl apache (Apache/1.3.27).
So I created a small test app, using Catalyst and C::M::CDBI::CRUD.
It runs fine as ./scripts/server.pl but I get an error trying to run it under mod_perl.
In httpd.conf I have:
<Location /cswami2> <Perl> use lib '/usr/local/apache_perl/packages/CSwami2/lib'; </Perl> SetHandler perl-script PerlHandler CSwami2 </Location>
In the error log, I get:
[Mon Mar 28 13:47:40 2005] [catalyst] [debug] Debug messages enabled [Mon Mar 28 13:47:40 2005] [catalyst] [debug] Loaded plugin "Catalyst::Plugin::FormValidator" [Mon Mar 28 13:47:40 2005] [catalyst] [debug] Loaded engine "Catalyst::Engine::Apache" [Mon Mar 28 13:47:40 2005] [catalyst] [debug] Loaded tables [snip] [Mon Mar 28 13:47:40 2005] [catalyst] [debug] Initialized components [snip] [Mon Mar 28 13:47:40 2005] [catalyst] [info] CSwami2 powered by Catalyst 4.34 [Mon Mar 28 13:47:40 2005] [catalyst] [debug] "CSwami2" defined "test" as "CODE(0x886fa98)" [Mon Mar 28 13:47:40 2005] [catalyst] [debug] "CSwami2" defined "!default" as "CODE(0x86ce6b0)" [Mon Mar 28 13:47:40 2005] [error] Undefined subroutine &CSwami2::handler called.
CSwami2.pm has: package CSwami2; use Catalyst qw/-Debug FormValidator/;
Any ideas?
3 Replies
|
|
|
[Catalyst] Catalyst::Engine problem
By bs...@helix-it.com at Mar 28, 2005, 05:10 am UTC
Hi All, I've just been trying to set up catalyst for a new project. Although everything looks great, and works fine under the test server.pl setup, it will not run under apache2/mod_perl2. I an error in my logs saying on line 440 of Catalyst::Engine that method debug cannot be found in package... More...
Hi All,
I've just been trying to set up catalyst for a new project. Although everything looks great, and works fine under the test server.pl setup, it will not run under apache2/mod_perl2.
I an error in my logs saying on line 440 of Catalyst::Engine that method debug cannot be found in package Apache::RequestRec.
I am running Mandrake 10.1 with Apache 2.0.50 (prefork), mod_perl 1.99.16, mod_apreq2.04.03, and libapreq, perl-apreq packages of the same versions.
I am using Catalyst version 4.34, and perl 5.8.5 multithreaded.
After some debugging and determining that the $r argument to handler in Catalyst::Engine is always null (or seems to be), I think it might have to do with the fancy *{"$class\::debug"} = sub { 1 }; not working properly in Catalyst.pm, but in all honesty I have no idea what I am talking about at this point.
Anyway, any help would be much appreciated.
Thanks,
Blain
2 Replies
|
|
|
[Catalyst] Hops-0.02 example (still in beta)
By Vsevolod (Simon) Ilyushchenko at Mar 25, 2005, 10:59 am UTC
Hi, Thanks to Sebastian, Hops (BeerDB example rewritten for Catalyst) is in better shape. You can download it here: http://www.simonf.com/catalyst I welcome bug reports and feature suggestions. Sebastian - I put back the uri_base parameter, because I would like to have a way to run not just from... More...
Hi,
Thanks to Sebastian, Hops (BeerDB example rewritten for Catalyst) is in better shape. You can download it here:
http://www.simonf.com/catalyst
I welcome bug reports and feature suggestions.
Sebastian - I put back the uri_base parameter, because I would like to have a way to run not just from the base url, but from a subdirectory. It probably can be implemented in a cleaner way, though.
Also, I saw that Class::DBI::Loader::mysql can read the comments field from a table description. How should a table be created in order for the comment to be picked up and translated into a has-many relationship?
Thanks, Simon
--
Simon (Vsevolod ILyushchenko) [email protected: s...@cshl.edu] http://www.simonf.com
Terrorism is a tactic and so to declare war on terrorism is equivalent to Roosevelt's declaring war on blitzkrieg.
Zbigniew Brzezinski, U.S. national security advisor, 1977-81
4 Replies
|
|
|
[Catalyst] Can't locate object method "host" via package "Catalyst::Engine::Server::Simple"
By Sai Nelson Tong at Mar 25, 2005, 03:35 am UTC
Is there any reason why I encounter this error when running 'server.pl '? Can't locate object method "host" via package "Catalyst::Engine::Server::Simple' at ...../.cpan/build/Catalyst-4.32/lib/Catalyst/Engine/Server.pm line 79 More...
Is there any reason why I encounter this error when running 'server.pl '?
Can't locate object method "host" via package "Catalyst::Engine::Server::Simple'
at ...../.cpan/build/Catalyst-4.32/lib/Catalyst/Engine/Server.pm line 79
2 Replies
|
|
|
[Catalyst] Win2k?
By Jeremy Silva at Mar 22, 2005, 10:59 am UTC
Has anyone been successfull in installing Catalyst fully onto a Win32 platform? Using, Win2k, I was able to get Bundle::Catalyst to install successfully, and be able to create my own basic Catalyst programs, but was not able to get the Hops sample working. Specifically,Cache::FastMmap, is a huge... More...
Has anyone been successfull in installing Catalyst fully onto a Win32 platform?
Using, Win2k, I was able to get Bundle::Catalyst to install successfully, and be able to create my own basic Catalyst programs, but was not able to get the Hops sample working.
Specifically,Cache::FastMmap, is a huge CPAN roadblock. It will not install under any circumstances and it seems it has failed the CPAN testers (http://www.nntp.perl.org/group/perl.cpan.testers/183737). Any ideas/suggestions?
Unfortunately, Linux is not an option at this point.
Jeremy
1 Reply
|
|
|
[Catalyst] CGI-Expand-Plugin
By Uwe Voelker at Mar 22, 2005, 09:40 am UTC
Hello, I have written an CGI::Expand plugin. It extends the prepare phase and converts $c->req->params with CGI::Expand::expand_hash(). Question: How should I name it? I named it Catalyst::Plugin::CGI::Expand, but I see the other plugins are more named like Catalyst::Plugin::Expand or... More...
Hello,
I have written an CGI::Expand plugin. It extends the prepare phase and converts $c->req->params with CGI::Expand::expand_hash().
Question: How should I name it? I named it Catalyst::Plugin::CGI::Expand, but I see the other plugins are more named like Catalyst::Plugin::Expand or Catalyst::Plugin::CGIExpand.
Thanks, bye, Uwe
0 Replies
|
|
|
[Catalyst] Hops (Sample app), alpha version
By Vsevolod (Simon) Ilyushchenko at Mar 21, 2005, 3:48 pm UTC
Hi, Hops is a rewrite of the BeerDB example from Maypole. It's a generic database browsing application that attempts to use as little code as possible. Before I release it, I'd like to get feedback from the developers about what could be changed or simplified to reflect best practices. Do let me... More...
Hi,
Hops is a rewrite of the BeerDB example from Maypole. It's a generic database browsing application that attempts to use as little code as possible. Before I release it, I'd like to get feedback from the developers about what could be changed or simplified to reflect best practices. Do let me know if you have any suggestions!
There is as yet no search, list paging or table relationship support, but I'd like to add them.
Thanks, Simon
--
Simon (Vsevolod ILyushchenko) [email protected: s...@cshl.edu] http://www.simonf.com
Terrorism is a tactic and so to declare war on terrorism is equivalent to Roosevelt's declaring war on blitzkrieg.
Zbigniew Brzezinski, U.S. national security advisor, 1977-81
Attachment: Hops.tar.gz
6 Replies
|
|
|
[Catalyst] MojoMojo example - errors with database tables
By Uwe Voelker at Mar 20, 2005, 6:14 pm UTC
Hello, I checked out the MojoMojo example. http://maypole.perl.org/repos/mojomojo/trunk cd trunk script/server.pl brings the attached output. I suspect something with the database is wrong. I have all the necessary modules installed (at least I hope so). I have modified mojomojo.yml to contain my... More...
Hello,
I checked out the MojoMojo example. http://maypole.perl.org/repos/mojomojo/trunk
cd trunk script/server.pl brings the attached output.
I suspect something with the database is wrong. I have all the necessary modules installed (at least I hope so).
I have modified mojomojo.yml to contain my paths.
What can I do next?
Thank you, good bye, Uwe
Attachment: unknown.1
12 Replies
|
|
|
[Catalyst] catalyst code examples?
By Richard Hubbell at Mar 15, 2005, 11:34 pm UTC
Hello, Wanted to have a look at Catalyst but for my mind I get up to speed quickest with working examples. Do some good examples exist? I'd like something I could play with ideally. But will take any code examples that are available. Like learning any language the real, working thing often provides... More...
Hello,
Wanted to have a look at Catalyst but for my mind I get up to speed quickest with working examples.
Do some good examples exist? I'd like something I could play with ideally. But will take any code examples that are available.
Like learning any language the real, working thing often provides the best ramp to learning quickly. thanks, Richard
1 Reply
|
|
|
[Catalyst] Static file problem
By Vsevolod (Simon) Ilyushchenko at Mar 15, 2005, 8:01 pm UTC
Hi, I'm trying to run my Catalyst app under Apache, so the URLs look like http://localhost/hops/beer/list etc. The problem is that static files are not server correctly in this case. Consider the following code (below). On the first request to serve http://localhost/hops/maypole.css the CSS file is... More...
Hi,
I'm trying to run my Catalyst app under Apache, so the URLs look like http://localhost/hops/beer/list etc. The problem is that static files are not server correctly in this case.
Consider the following code (below). On the first request to serve http://localhost/hops/maypole.css
the CSS file is displayed correctly, but on the second one the regex action is not found, and the url gets forwarded to
http://localhost/hops/maypole.css/list
which of course does not exist.
Debugging this, I found that the iteration over $self->actions->{compiled} in Catalyst::Engine::Action does not happen on the second invocation. However, if I use Data::Dumper to print $self->actions->{compiled} right before the iteration, everything works.
Thanks, Simon
package AAA;
use strict; use utf8; use Catalyst qw/-Debug FormValidator FillInForm Session::FastMmap Static SubRequ est/;
AAA->config( root => '/usr/local/apache2/htdocs/hops', uri_base => 'hops' );
AAA->action(
'/^.*\.css$/' => sub { my ( $self, $c ) = @_; my $path = $c->req->path; my $base = $c->config->{uri_base}; $path =~ s/^$base//g; $c->req->path($path); $c->serve_static('text/css'); },
);
1;
--
Simon (Vsevolod ILyushchenko) [email protected: s...@cshl.edu] http://www.simonf.com
Terrorism is a tactic and so to declare war on terrorism is equivalent to Roosevelt's declaring war on blitzkrieg.
Zbigniew Brzezinski, U.S. national security advisor, 1977-81
0 Replies
|
|
|
[Catalyst] Catalyst::Plugin::Session::ApacheSession
By Todd W at Mar 15, 2005, 7:41 pm UTC
aside: can we get gmane to pick up this mailing list? nntp is so much nicer for me. If the list admin could fill out the form at http://gmane.org/subscribe.php, I for one would be able to participate much more productively. I have written Catalyst::Plugin::Session::ApacheSession, please download... More...
aside: can we get gmane to pick up this mailing list? nntp is so much nicer for me. If the list admin could fill out the form at http://gmane.org/subscribe.php, I for one would be able to participate much more productively.
I have written Catalyst::Plugin::Session::ApacheSession, please download and review it while I wait for my PAUSE id.
http://waveright.homeip.net/~trwww/code/Catalyst-Plugin-Session-ApacheSession-0.01.tar.gz
Perrin had some questions about it, they are quoted and answered here.
--- On Tue 03/15, Perrin Harkins < [email protected: p...@elem.com] > wrote:
> On Tue, 2005-03-15 at 10:08 -0500, [email protected: tod...@excite.com] wrote:
>> I'll name it Catalyst::Plugin::Session::ApacheSession unless anyone
>> has any objections.
> Does it support any Apache::Session class, or just MySQL? You might
> consider having it use Apache::Session::Wrapper instead, to make it
> easy to support all classes. Maybe that could be something for a
> future version.
What I did to keep it simple so I can start building my apps yet share the code was force the user to use() the session module they want to use in the application and have them specify the options in the config:
use Apache::Session::MySQL;
use Catalyst 'Session::ApacheSession';
MyApp->config(
session => {
class => 'Apache::Session::MySQL',
Handle => $dbh,
LockHandle => $dbh,
}
);
And then the code in C::P::S::ApacheSession is nearly identical to C::P::S::FastMmap except the setup sub looks like this:
sub setup {
my $self = shift;
my $a_s_class = delete($self->config->{session}{class});
my $s_config = $self->config->{session};
tie my %hash, $a_s_class, undef, $s_config;
$self->_session( \%hash );
return $self->NEXT::setup(@_);
}
This way, any Apache::Session::* will work, its reuseable, and I should be able to make it backwards compatible with anything else we add later.
I wanted to use Apache::Session::Flex, but I dont have time right now doing sanity checks and setting defaults.
I didnt know about Apache::Session::Wrapper, I see that it wraps Apache::Session::Flex, but Im about out of time for this right now.
Todd W.
_______________________________________________ Join Excite! - http://www.excite.com The most personalized portal on the Web!
4 Replies
|
|
|
[Catalyst] porting C::FastMmap to use Cache::Cache
By Todd W at Mar 15, 2005, 4:18 pm UTC
Sebastian suggested using Cache::Cache in C::FastMmap so I can use Catalyst on windows. Looks easy enough, Should be just a couple changes to C::FastMmap. So I downloaded and installed all modules in Bundle::Catalyst. Then I downloaded Catalyst and did a "nmake test" hoping to see a test fail so I... More...
Sebastian suggested using Cache::Cache in C::FastMmap so I can use Catalyst on windows. Looks easy enough, Should be just a couple changes to C::FastMmap.
So I downloaded and installed all modules in Bundle::Catalyst. Then I downloaded Catalyst and did a "nmake test" hoping to see a test fail so I knew when I had Cache::Cache implemented in C::FastMmap right. Instead, all tests passed.
Can someone suggest a way I make sure I get this right?
Todd W.
_______________________________________________ Join Excite! - http://www.excite.com The most personalized portal on the Web!
9 Replies
|
|
|
[Catalyst] UNIVERSAL:require:ERROR
By Jose Nyimi at Mar 13, 2005, 9:11 pm UTC
Hello, I?m trying to learn from the Catalyst code. I started from Catalyst.pm file and I?m seeing the following: $engine->require; die qq/Couldn't load engine "$engine", "$@"/ if $@; I would suggest to replace $@ by $UNIVERSAL::require::ERROR To make it clear that you are using the... More...
Hello, I?m trying to learn from the Catalyst code. I started from Catalyst.pm file and I?m seeing the following: $engine->require; die qq/Couldn't load engine "$engine", "$@"/ if $@; I would suggest to replace $@ by $UNIVERSAL::require::ERROR To make it clear that you are using the UNIVERSAL::require module here and not the eval ?require $engine?; approach. I?m also wondering if $@ will contain the correct value since ?eval? is not in the scene ;) perldoc perlvar says: $@ The Perl syntax error message from the last <file:///c:\Perl\html\lib\Pod\perlfunc.html#item_eval> eval() operator. If $@ is the null string, the last <file:///c:\Perl\html\lib\Pod\perlfunc.html#item_eval> eval() parsed and executed correctly ... BR, Jos?.
5 Replies
|
|
|
[Catalyst] catalyst on windows
By Todd W at Mar 12, 2005, 01:05 am UTC
Catalyst installed on redhat 9 but on win2k I cant get Cache::FastMmap, no ppm. An attempt to nmake it with MS VC++ 6.0 failed also. Can I get around the Cache::FastMmap dependency? Is there a counterpart with a similar api that I could just drop in? Windows is pretty much a requirement. I have... More...
Catalyst installed on redhat 9 but on win2k I cant get Cache::FastMmap, no ppm. An attempt to nmake it with MS VC++ 6.0 failed also. Can I get around the Cache::FastMmap dependency? Is there a counterpart with a similar api that I could just drop in?
Windows is pretty much a requirement. I have customers that want their code on windows machines.
Otherwise, pretty slick tool.
Todd W.
_______________________________________________ Join Excite! - http://www.excite.com The most personalized portal on the Web!
4 Replies
|
|
|
[Catalyst] Catalyst::Model::CDBI::CRUD
By Robert Boone at Mar 11, 2005, 8:20 pm UTC
Hello, I can't seem to figure out Catalyst::Model::CDBI::CRUD. I have followed the manual but there seems to be a few things that I still don't understand. This is what I have so far. package WT::Keyshop::M::CRUD; use strict; use base 'Catalyst::Model::CDBI::CRUD'; __PACKAGE__->config( dsn =>... More...
Hello, I can't seem to figure out Catalyst::Model::CDBI::CRUD. I have followed the manual but there seems to be a few things that I still don't understand. This is what I have so far.
###################################################################################
package WT::Keyshop::M::CRUD;
use strict; use base 'Catalyst::Model::CDBI::CRUD';
__PACKAGE__->config( dsn => 'dbi:Pg:dbname=keyshop', user => 'user', password => 'pass', options => { AutoCommit => 1 }, relationships => 1 );
1; ###################################################################################
package WT::Keyshop::V::TT;
use strict; use base 'Catalyst::View::TT';
#And I did copy the templates in to the root directory.
1; ###################################################################################
package WT::Keyshop;
use strict; use Catalyst qw/-Debug FormValidator/;
our $VERSION = '0.01';
WT::Keyshop->config( name => 'WT::Keyshop', root => '/home/robert/projects/WT-Keyshop/root', );
__PACKAGE__->action( 'issuedkey' => sub { my ( $self, $c ) = @_; $c->form( optional => [ WT::Keyshop::M::CRUD::IssuedKey- >columns ] ); $c->stash->{template} = 'list'; $c->forward('WT::Keyshop::V::TT'); } ); 1;
###################################################################################
The output what I run the server is:
[Fri Mar 11 10:47:54 2005] [catalyst] [debug] Debug messages enabled [Fri Mar 11 10:47:54 2005] [catalyst] [debug] Loaded plugin "Catalyst::Plugin::FormValidator" [Fri Mar 11 10:47:54 2005] [catalyst] [debug] Loaded engine "Catalyst::Engine::CGI" [Fri Mar 11 10:47:56 2005] [catalyst] [debug] Loaded tables "building dept issued_key person wtkey" [Fri Mar 11 10:47:56 2005] [catalyst] [debug] Initialized components "WT::Keyshop::M::CRUD::Person WT::Keyshop::M::CRUD::Dept WT::Keyshop::M::CRUD::Building WT::Keyshop::V::TT WT::Keyshop::M::CRUD::IssuedKey WT::Keyshop::M::CRUD WT::Keyshop::M::CRUD::Wtkey" [Fri Mar 11 10:47:56 2005] [catalyst] [info] WT::Keyshop powered by Catalyst 4.23 [Fri Mar 11 10:47:56 2005] [catalyst] [debug] "WT::Keyshop" defined "issuedkey" as "CODE(0x9cb7a20)" You can connect to your server at http://localhost:3001
The error i'm getting is:
Couldn't render template "plugin error - Null filename used at (eval 81) line 2. ...propagated at /usr/local/lib/perl5/site_perl/5.8.6/Template/Plugin/Class.pm line 16. "
Can someone tell me what I'm doing wrong.
Thanks, Robert
1 Reply
|
|
 | |