|
List Info
Thread: Two Strange Catalyst/Apache Issues
|
|
| Two Strange Catalyst/Apache Issues |

|
2007-05-24 18:47:35 |
|
I am baffled by both of these, and I don't (usually) baffle that easily. First, the background:
- Latest Catalyst, C::E::Apache, and all related modules - Using SQLite from within DBIC for model storage
My application runs fine from the test-server scripts that catalyst.pl auto-generated. When I moved it to Apache (1.3.37) + mod_perl (1.30), initially I just installed the various components into Perl's default site_perl structure. The application loaded fine, but would not connect to the SQLite database. I tried having it in the same dir as the YAML config file, and I tried putting in a specific place and changing the setting in the config to have an absolute path. I also experimented with modes (up to and including 666) and user/group combinations (both on the ownership of the file and the running httpd processes). Nothing I've tried gets it to open the DB.
The second problem came when I tried to move the application to a dedicated directory (this is a small app for my company, and they're more likely to want it to live in its own world as opposed to being dropped into site_perl). Then things really went wacky. After adding the apropos directory to the search-path in a <Perl> block, attempting to start the server yielded this mess:
Subroutine Bylines::Model: B::class redefined at /usr/lib/perl5/site_perl/5.8.5/DBIx/Class/Schema.pm line 415. Subroutine Bylines::Model: B::source redefined at /usr/lib/perl5/site_perl/5.8.5/DBIx/Class/Schema.pm line 415.
Subroutine Bylines::Model: B::resultset redefined at /usr/lib/perl5/site_perl/5.8.5/DBIx/Class/Schema.pm line 415. Subroutine Bylines::Model: B::Sources::ACCEPT_CONTEXT redefined at /usr/lib/perl5/site_perl/5.8.5/Catalyst/Model/DBIC/Schema.pm line 301.
Subroutine Bylines::Model: B::Users::ACCEPT_CONTEXT redefined at /usr/lib/perl5/site_perl/5.8.5/Catalyst/Model/DBIC/Schema.pm line 301. Subroutine Bylines::Model: B::Statii::ACCEPT_CONTEXT redefined at /usr/lib/perl5/site_perl/5.8.5/Catalyst/Model/DBIC/Schema.pm line 301.
Syntax error on line 259 of /usr/local/apache/conf/httpd.conf: Can't locate Bylines/Model/DB/Users.pm in INC ( INC contains: ...
(No need to show the list of INC contents, it's a typical perl 5.8.X
set of paths)
I have one model defined, Bylines::Model: B. It's an empty sub-class of Catalyst::Model: BIC::Schema. In the configuration, I have defined the schema_class setting for Model: B to be "Bylines: B". Bylines/DB.pm is a sub-class of DBIx::Class::Schema, and loads three classes: Bylines: B::{Sources,Statii,Users}. In the -Debug output that Catalyst produces, I see that it has correctly mapped these classes to the model:
.-----------------------------------------------------------------+----------. | Class | Type | +-----------------------------------------------------------------+----------+
| Bylines::Controller::Admin | instance | | Bylines::Controller::Ajax | instance | | Bylines::Controller::Edit | instance |
| Bylines::Controller::Review | instance | | Bylines::Controller::Root | instance | | |