[Catalyst] creating a model

Octavian Rasnita orasnita at gmail.com
Fri Dec 22 19:34:35 GMT 2006


Hi,

I have tried creating a model using:

perl script/tranzactiibursiere_create.pl model Intranet DBIC
DBI:mysql:database=intranet root

The result shown was:

exists "E:\web\TranzactiiBursiere\lib\TranzactiiBursiere\Model"
exists "E:\web\TranzactiiBursiere\t"
This module has been deprecated in favor of Catalyst::Model::DBIC::Schema at
D:/usr/site/lib/Catalyst/Helper/Model/DBIC.pm line 45.
created "E:\web\TranzactiiBursiere\lib\TranzactiiBursiere\Model\Intranet.pm"
created "E:\web\TranzactiiBursiere\lib\TranzactiiBursiere\Model\Intranet"
created
"E:\web\TranzactiiBursiere\lib\TranzactiiBursiere\Model\Intranet\Analize.pm"
created
"E:\web\TranzactiiBursiere\lib\TranzactiiBursiere\Model\Intranet\BvbStiri.pm"
exists "E:\web\TranzactiiBursiere\t"
exists "E:\web\TranzactiiBursiere\t\model_Intranet-Analize.t"
exists "E:\web\TranzactiiBursiere\t"
exists "E:\web\TranzactiiBursiere\t\model_Intranet-BvbStiri.t"

So it seems that the program found the 2 tables from my database, and
created the following files:

Model/Intranet.pm:

package TranzactiiBursiere::Model::Intranet;

use strict;
use base 'Catalyst::Model::DBIC';

__PACKAGE__->config(
    dsn           => 'DBI:mysql:database=intranet',
    user          => 'root',
    password      => '',
    options       => {},
    relationships => 1
);

1;

Model/Intranet/Analize.pm:

package TranzactiiBursiere::Model::Intranet::Analize;

use strict;
use warnings;
use base 'DBIx::Class::Core';

1;

Model/Intranet/BvbStiri.pm:

package TranzactiiBursiere::Model::Intranet::BvbStiri;

use strict;
use warnings;
use base 'DBIx::Class::Core';

1;

Now if I restart the web server, it doesn't want to start. It pops up an
error message window, but it doesn't print anything in the Apache's log.
If I click on the "details" button of that window, the following text is
displayed:

szAppName : httpd.exe szAppVer : 2.2.3.0 szModName : perl58.dll
szModVer : 5.8.8.819 offset : 00085b8c


If I delete the model classes that I've just created, the server can be
started, and the program works.

Do you have any idea what could be the problem?
If the model files created would not be correct, perl should give an error,
and Apache should print it in the log file, but it doesn't.

I have also tried the program using perl
script/tranzactiibursiere_server.pl, but in this case the program works, and
in the log printed I can see that those 2 tables were loaded.
I don't know why Apache is not working. I am using Windows XP Pro and:
Server version: Apache/2.2.3
Server built:   Jul 27 2006 16:49:49
and
perl, v5.8.8 built for MSWin32-x86-multi-thread
Binary build 819 [267479] provided by ActiveState http://www.ActiveState.com
Built Aug 29 2006 12:42:41


I have also noticed that warning:
This module has been deprecated in favor of Catalyst::Model::DBIC::Schema at
D:/usr/site/lib/Catalyst/Helper/Model/DBIC.pm line 45.

So I have replaced DBIC with DBIC::Schema when creating the model. I don't
know if this is correct or not, but it created a single Intranet.pm model
file, and no other files for the tables from the database. But in that case
the server still could not be started because of the same error window
appears.

Thank you for any idea about this problem.

Octavian




More information about the Catalyst mailing list