Uncaught exception from createSkeletonFromPropel

5 views
Skip to first unread message

ctodd

unread,
Oct 25, 2007, 11:31:05 PM10/25/07
to phocoa dev

I'm guessing this is a version issue in propel, or a Linux specific
thing. NamingFactory appears to Capitalize the first letter of the
project name, but can't find it in the propel configuration. Can
someone shed light on this before I submit a bug report. I tried
changing the case of 'blog' in the blog-conf.php file, but no luck.
I'd really rather avoid installing the beta packages (if that's the
issue) unless absolutely necessary.

Chris

[root@hs1 modules]# phocoa createSkeletonFromPropel
phing -f /usr/local/phocoa/phing/build.xml -Dusing.phocoa.make=true -
Dphocoa.pwd=/home/cmiller/phocoa/blog/blog/modules -Dphocoa.dir=/usr/
local/phocoa -Dphocoa.project.name=blog -Dphocoa.project.dir=/home/
cmiller/phocoa/blog/blog createSkeletonFromPropel
Buildfile: /usr/local/phocoa/phing/build.xml

phocoa > prepareGeneral:

[echo] PHOCOA framework base dir at: /usr/local/phocoa

phocoa > prepareProject:

[echo] 1
[php] Evaluating PHP expression: $_ENV['_']
[echo] PHOCOA project dir at: /home/cmiller/phocoa/blog/blog
[realpathexpandhome] Resolved /home/cmiller/phocoa/blog/blog/.. to /
home/cmiller/phocoa/blog
[echo] PHOCOA project container dir at: /home/cmiller/phocoa/blog
[property] Loading /home/cmiller/phocoa/blog/blog/conf/
build.properties
[property] Unable to find property file: /home/cmiller/phocoa/blog/
blog/conf/build.properties... skipped

phocoa > createSkeletonFromPropel:

Database Name: [blog]
Table Name: blog
Column name of single column that best describes the table: title
Module Name: [blog]
[php] Evaluating PHP expression: require('/home/cmiller/phocoa/
blog/blog/conf/webapp.conf')
[exec] Executing command: /usr/bin/php /usr/local/phocoa/
framework/createModule.php blog 2>&1
[exec] Writing blog/blog.php
[exec] Done building module blog!
[exec] Executing command: /usr/bin/php /usr/local/phocoa/
framework/createSkeletonFromPropel.php --phocoaConfFile=/home/cmiller/
phocoa/blog/blog/conf/webapp.conf --propelOutputDir=/home/cmiller/
phocoa/blog/blog/classes --propelConfFile=/home/cmiller/phocoa/blog/
blog/conf/blog-conf.php --databaseName=blog --tableName=blog --
columnName=title --pageType=search,edit,detail 2>&1
[exec] PHP Fatal error: Uncaught exception 'Exception' with
message 'Can't locate propel object Blog.' in /usr/local/phocoa/
framework/createSkeletonFromPropel.php:99
[exec] Stack trace:
[exec] #0 {main}
[exec] thrown in /usr/local/phocoa/framework/
createSkeletonFromPropel.php on line 99
[exec]
[exec] Fatal error: Uncaught exception 'Exception' with message
'Can't locate propel object Blog.' in /usr/local/phocoa/framework/
createSkeletonFromPropel.php:99
[exec] Stack trace:
[exec] #0 {main}
[exec] thrown in /usr/local/phocoa/framework/
createSkeletonFromPropel.php on line 99
[exec] Executing command: /usr/bin/php /usr/local/phocoa/
framework/util/convertModuleToYAML.php blog 2>&1
[exec] Converting shared setup to YAML for module at: 'blog'
[exec] Checking blog.php
[exec] Checking ..
[exec] Checking .
[exec] Executing command: mv suggested_code.php blog.php 2>&1

BUILD FINISHED

Total time: 11.0431 seconds

Alan Pinstein

unread,
Oct 26, 2007, 10:34:41 AM10/26/07
to phoco...@googlegroups.com
I recently updated PHOCOA to work with propel 1.3. Propel 1.3 adds a
bunch of new and useful features for PHOCOA integration (particularly
automatic autoload support) and the upgrade caused some of the
phocoa phing scripts to not work with 1.2 anymore.

I have made a special version of propel 1.2 that added autoload
support, but it's implemented differently than in the 1.3 final
version because we were able to come up with even better ideas for
1.3 autoload. I could give you that version of propel, but it has
bugs and other things that have been dealt with.

Can you use the 1.3 version of propel? I know it's in beta, but it's
been around for a long time and many people are already using it in
production and I am doing all of my new phocoa projects on propel 1.3
as well...

Alan

ctodd

unread,
Oct 26, 2007, 3:04:58 PM10/26/07
to phocoa dev

On Oct 26, 7:34 am, Alan Pinstein <apinst...@mac.com> wrote:
> Can you use the 1.3 version of propel? I know it's in beta, but it's
> been around for a long time and many people are already using it in
> production and I am doing all of my new phocoa projects on propel 1.3
> as well...

I upgraded propel to 1.3 and got :

PHP Fatal error: Class 'DateTime' not found in /usr/share/pear/propel/
engine/database/model/Domain.php on line 289

Turns out you need PHP 5.2 to use Propel 1.3 :-(. My production web
server is running PHP 5.1.6, and upgrading this could break customer
sites...

CentOS 4 only provides PHP 5.1.6 through the CentOSPlus yum repo, and
CentOS 5 only provides 5.1.6 standard (no CentOSPlus update). I did
find Jason Litka has provided source and binary RPMs for PHP 5.2.4 on
his site, but they won't install via "yum update" since the package
names differ.

http://www.jasonlitka.com/2007/09/05/upgrading-to-php-524-on-rhel-and-centos/

I'm going to have to get this going on a dev server for now, and
upgrade my production server later when I can make sure I'm not hosing
my customer's sites...

Chris

Alan Pinstein

unread,
Oct 26, 2007, 3:48:51 PM10/26/07
to phoco...@googlegroups.com
Oh right... I forgot about the 5.2.x dependency.

Yeah it's a bit of a tricky state now. PHP 5.1.x had all kinds of
issues regarding PDO and various other bugs. I think I am 5.1.6 on
production as well for the same reason as you; although I can easily
upgrade to 5.2.x. I am using 5.2.x locally just for Propel 1.3
development...

If it's easy to get 5.2.x on your dev server for now, that'd be
great. I am not sure I can commit yet to supporting propel 1.2 and
1.3, as it'd probably take a lot of time to figure out. If it's
really important to you, we can discuss it; I think basically we'd
need code to handle both versions in the createSkeletonFromPropel
script (I think there are only a few things related to name
generation that changed), and then you'd have to manually require the
appropriate Propel objects at the top of your phocoa modules (which
isn't too big of a deal), or port my autoload patches for 1.2 to
1.2.1...

LMK,
Alan

ctodd

unread,
Oct 26, 2007, 4:20:02 PM10/26/07
to phocoa dev

On Oct 26, 12:48 pm, Alan Pinstein <apinst...@mac.com> wrote:
> Oh right... I forgot about the 5.2.x dependency.
>
> Yeah it's a bit of a tricky state now. PHP 5.1.x had all kinds of
> issues regarding PDO and various other bugs. I think I am 5.1.6 on
> production as well for the same reason as you; although I can easily
> upgrade to 5.2.x. I am using 5.2.x locally just for Propel 1.3
> development...
>
> If it's easy to get 5.2.x on your dev server for now, that'd be
> great. I am not sure I can commit yet to supporting propel 1.2 and
> 1.3, as it'd probably take a lot of time to figure out. If it's
> really important to you, we can discuss it; I think basically we'd
> need code to handle both versions in the createSkeletonFromPropel
> script (I think there are only a few things related to name
> generation that changed), and then you'd have to manually require the
> appropriate Propel objects at the top of your phocoa modules (which
> isn't too big of a deal), or port my autoload patches for 1.2 to
> 1.2.1...

My thought is that a large portion of folks that would want to run
Phocoa will need maintainable systems. That means they are php 5.1.6
and Propel 1.2 people. I guess this is really going to be dictated by
customer demand and the state of these software packages at the time
Phocoa gets mainstream traction. Seems there's a lot of reasons to run
the newer versions, but it's not so easy for me to upgrade a
production server to these versions since it impacts a lot of people.
I'm also running PHP as a CGI for customers, so I've got to replace
every copy of php-cgi.

Chris

Alan Pinstein

unread,
Oct 26, 2007, 4:31:52 PM10/26/07
to phoco...@googlegroups.com
Hmm ok... well, let's get you running on 1.3 and 5.2.x on dev, and we
can figure out better what to do for production.

I just can't stop this instant and set up 1.2 support...

Alan

ctodd

unread,
Oct 26, 2007, 7:37:50 PM10/26/07
to phocoa dev

On Oct 26, 1:31 pm, Alan Pinstein <apinst...@mac.com> wrote:
> Hmm ok... well, let's get you running on 1.3 and 5.2.x on dev, and we
> can figure out better what to do for production.

Done. But I'm having the same problem.

> I just can't stop this instant and set up 1.2 support...

No worries.

Here's what I have installed :

CentOS 4.5

httpd-2.2.6
mysql-5.0.48
mysqlclient14-4.1.14-4.2.1
mysql-server-5.0.48
perl-DBD-MySQL-2.9004-3.1.centos4
php-5.2.4
php-cli-5.2.4
php-common-5.2.4
php-devel-5.2.4
php-gd-5.2.4
php-mbstring-5.2.4
php-mysql-5.2.4
php-pdo-5.2.4
php-pear-1.6.2-1
php-snmp-5.2.4
php-xml-5.2.4

Installed packages
============================================
Package Version State
creole 1.1.0 stable
phing 2.3.0beta1 stable
propel_generator 1.3.0beta2 beta
propel_runtime 1.3.0beta2 beta

Here's the output of the latest try. Let me know what's next.

Chris

phocoa > createSkeletonFromPropel:

Database Name: [blog]
Table Name: blog
Column name of single column that best describes the table: title
Module Name: [blog]

[php] Evaluating PHP expression: require('/home/cmiller/www/blog/


blog/conf/webapp.conf')
[exec] Executing command: /usr/bin/php /usr/local/phocoa/
framework/createModule.php blog 2>&1
[exec] Writing blog/blog.php
[exec] Done building module blog!
[exec] Executing command: /usr/bin/php /usr/local/phocoa/
framework/createSkeletonFromPropel.php --phocoaConfFile=/home/cmiller/

www/blog/blog/conf/webapp.conf --propelOutputDir=/home/cmiller/www/
blog/blog/classes --propelConfFile=/home/cmiller/www/blog/blog/conf/
blog-conf.php --databaseName=blog --tableName=blog --columnName=title

Alan Pinstein

unread,
Oct 26, 2007, 10:10:35 PM10/26/07
to phoco...@googlegroups.com
Ah ok. That looks like the autoload isn't working...

Did you "enable" propel in the app delegate? Did you run the convert-
conf target of propel-gen? That's what sets up the list of classes
for autoload in propel...

You should have a file like:

project/project/conf/project-conf.php

If you don't, run:

propel-gen project/project/propel-build convert-conf

This conf file contains the DSN, log settings, and autoload classes
used at runtime.

LMK,

Alan

ctodd

unread,
Oct 27, 2007, 5:56:15 PM10/27/07
to phocoa dev

On Oct 26, 7:10 pm, Alan Pinstein <apinst...@mac.com> wrote:
> Ah ok. That looks like the autoload isn't working...
>
> Did you "enable" propel in the app delegate?

Yes.

> Did you run the convert-
> conf target of propel-gen? That's what sets up the list of classes
> for autoload in propel...

Yes.

> You should have a file like:
>
> project/project/conf/project-conf.php

Yes. ;-)

> This conf file contains the DSN, log settings, and autoload classes
> used at runtime.

Looks like it's all there, see below. Seems like this is still a
naming/case issue. Also the comment says "file generated by Propel 1.3
convert-props", but 1.3 uses "convert-conf" as the target. Is this
statement coming from Phocoa? If so, 'nother minor fix ;-)

Chris

<?php
// This file generated by Propel 1.3.0-dev convert-props target on Fri
Oct 26 15:56:00 2007
// from XML runtime conf file /home/cmiller/www/blog/blog/propel-build/
runtime-conf.xml
return array (
'log' =>
array (
'name' => '/home/cmiller/www/blog/log/propel.log',
'ident' => 'propel-blog',
'level' => '7',
'conf' =>
array (
'mode' => '664',
),
),
'propel' =>
array (
'datasources' =>
array (
'blog' =>
array (
'adapter' => 'mysql',
'connection' =>
array (
'dsn' =>
'mysql:dbname=blog;user=blog;host=localhost;password=blog',
'phptype' => 'mysql',
'hostspec' => 'localhost',
'database' => 'blog',
'username' => 'blog',
'password' => 'blog',
),
'classes' =>
array (
),
),
'default' => 'blog',
),
'generator_version' => '1.3.0-dev',
),
);

Alan Pinstein

unread,
Oct 28, 2007, 9:38:13 AM10/28/07
to phoco...@googlegroups.com
> Looks like it's all there, see below. Seems like this is still a
> naming/case issue. Also the comment says "file generated by Propel 1.3
> convert-props", but 1.3 uses "convert-conf" as the target. Is this
> statement coming from Phocoa? If so, 'nother minor fix ;-)

Nope, that little tidbit must be a propel bug...

Aha! I see the problem... look in the "classes" array below... it's
empty!

So it seems I forgot to ask you one other question -- did you run:

propel-gen blog/blog/propel-build om convert-conf

The "om" target builds your object model, and convert-conf has to be
re-run again after that to "update" the conf file with the new classes.

Also, if you don't have propel-build/schema.xml, then you propel
doesn't know your database structure, so instead you should run:

propel-gen blog/blog/propel-build creole om convert-conf

Where we've added the "creole" target which reverse-engineers your
database to create the schema.xml file.

LMK how that goes..

Alan

ctodd

unread,
Oct 28, 2007, 3:26:14 PM10/28/07
to phocoa dev

On Oct 28, 6:38 am, Alan Pinstein <apinst...@mac.com> wrote:

> Aha! I see the problem... look in the "classes" array below... it's
> empty!
>
> So it seems I forgot to ask you one other question -- did you run:
>
> propel-gen blog/blog/propel-build om convert-conf

Yes.

> The "om" target builds your object model, and convert-conf has to be
> re-run again after that to "update" the conf file with the new classes.

OK

> Also, if you don't have propel-build/schema.xml, then you propel
> doesn't know your database structure, so instead you should run:
>
> propel-gen blog/blog/propel-build creole om convert-conf
>
> Where we've added the "creole" target which reverse-engineers your
> database to create the schema.xml file.

I've tried running this two ways, letting `phocoa newProject`
"generate a PHP interface to your database objects", and running
`propel-gen . creole om convert-conf` after fixing the
build.properties file, both with the same result.

I tried from scratch again and I've gotten further this time, not sure
at the moment what changed. Now I'm getting the following error :

[echo] +------------------------------------------+
[echo] | |
[echo] | Generating Peer-based Object Model for |
[echo] | YOUR Propel project! |
[echo] | |
[echo] +------------------------------------------+
[phingcall] Calling Buildfile '/usr/share/pear/data/propel_generator/
build-propel.xml' with target 'om-template'
[property] Loading /usr/share/pear/data/propel_generator/./
build.properties
[property] Loading /usr/share/pear/data/propel_generator/./
default.properties

propel > om-template:

[propel-om] Processing: schema.xml
PHP Fatal error: Class 'DefaultValue' not found in /usr/share/pear/
propel/engine/database/model/Column.php on line 182

Fatal error: Class 'DefaultValue' not found in /usr/share/pear/propel/
engine/database/model/Column.php on line 182
[rfallis@is2 propel-build]$ propel-gen . creole om convert-conf
Buildfile: /usr/share/pear/data/propel_generator/pear-build.xml
[resolvepath] Resolved . to /home/cmiller/www/blog/blog/propel-build/.

Is this a problem with my schema, or something else? Here's the schema
file :

<?xml version="1.0" encoding="utf-8"?>
<!--Autogenerated by CreoleToXMLSchema!-->
<database name="blog">
<table name="blog">
<vendor type="mysql">
<parameter name="Name" value="blog"/>
<parameter name="Engine" value="MyISAM"/>
<parameter name="Version" value="10"/>
<parameter name="Row_format" value="Dynamic"/>
<parameter name="Rows" value="0"/>
<parameter name="Avg_row_length" value="0"/>
<parameter name="Data_length" value="0"/>
<parameter name="Max_data_length" value="281474976710655"/>
<parameter name="Index_length" value="1024"/>
<parameter name="Data_free" value="0"/>
<parameter name="Auto_increment" value=""/>
<parameter name="Create_time" value="2007-10-26 16:07:20"/>
<parameter name="Update_time" value="2007-10-26 16:07:20"/>
<parameter name="Check_time" value=""/>
<parameter name="Collation" value="latin1_swedish_ci"/>
<parameter name="Checksum" value=""/>
<parameter name="Create_options" value=""/>
<parameter name="Comment" value=""/>
</vendor>
<column name="blog_id" type="INTEGER" required="true"
primaryKey="true" default="">
<vendor type="mysql">
<parameter name="Field" value="blog_id"/>
<parameter name="Type" value="int(11)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value="PRI"/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="post_dts" type="TIMESTAMP" required="true"
default="0000-00-00 00:00:00">
<vendor type="mysql">
<parameter name="Field" value="post_dts"/>
<parameter name="Type" value="datetime"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value="0000-00-00 00:00:00"/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="title" type="VARCHAR" size="100" required="true"
default="">
<vendor type="mysql">
<parameter name="Field" value="title"/>
<parameter name="Type" value="varchar(100)"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
<column name="post" type="LONGVARCHAR" required="true">
<vendor type="mysql">
<parameter name="Field" value="post"/>
<parameter name="Type" value="text"/>
<parameter name="Null" value="NO"/>
<parameter name="Key" value=""/>
<parameter name="Default" value=""/>
<parameter name="Extra" value=""/>
</vendor>
</column>
</table>
</database>

ctodd

unread,
Oct 28, 2007, 3:38:02 PM10/28/07
to phocoa dev

Let me rephrase that -

I tried from scratch again (I didn't get further) and I ran into this
new error from `propel-gen . creole om convert-conf`.

I haven't tried to run createSkeletonFromPropel yet, since we know
there's a database issue.

I don't recall getting a fatal error from propel-gen last time. I did
realize that I hadn't modified BaseObject.php in the latest install of
Propel, I've since fixed that. I have a feeling that Propel doesn't
like a database schema with null default values. Unless Class
'DefaultValue' means something else.

Chris

ctodd

unread,
Nov 2, 2007, 2:42:59 AM11/2/07
to phocoa dev

Turns out this is a bug involving PHP 5.2.4. Alan found this at :

http://propel.phpdb.org/trac/ticket/480

Downgrading to PHP 5.2.3 fixes this issue.

Chris

Reply all
Reply to author
Forward
0 new messages