Discussion:
Maypole::Application still broken in 2.09?
Matt Adams
2005-02-01 19:58:50 UTC
Permalink
Hi there:

Just wondering if Marcus R. or Simon F. (or anyone else) had any other
suggestions as to why Maypole::Application is still broken in 2.09.

Maybe it's not... maybe it's me?

Here's the problem (same as before -- just slightly edited).

I recently upgraded to Maypole 2.09 and discovered that it is not compatible
with the Maypole app I have been using. I'm hoping that those of you who are
more familiar with the Maypole-innards will be able to shed some light on why
I'm having the problems I am.

It would appear that the neat stuff in Maypole::Application 2.09 is still
causing problems for my poor Maypole-powered application.

If I downgrade to Maypole::Application 2.07 everything works fine.

I don't think my Maypole app is all that odd. Here's how it begins:

BEGIN {
package MyApp;
use MyApp::Constants;
$ENV{MAYPOLE_CONFIG} = BINPATH . '/MyApp.yaml';
}

package MyApp;

use Maypole::Application qw(
-Debug
Config::YAML
Authentication::Abstract
-Setup
);

But unfortunately this doesn't work out too well with Maypole::Application 2.09
which still gives me the same error as in 2.08:

MyApp...Debugging enabled
MyApp...Loaded plugin: Maypole::Plugin::Authentication::Abstract
MyApp...Loaded plugin: Maypole::Plugin::Config::YAML
MyApp...No DSN set in config
[error] Can't locate object method "new" via package "Class::DBI::Loader::"
(perhaps you forgot to load "Class::DBI::Loader::"?) at
/.../lib/Class/DBI/Loader.pm line 77.
BEGIN failed--compilation aborted at /.../MyApp.pm line 36.
Compilation failed in require at (eval 10) line 3.
[error] Can't call method "_table2class" on an undefined value at
/.../lib/Maypole/Model/CDBI.pm line 250.

Can someone give me some pointers as to a) how to fix my app so that it is
compliant with Maypole::Application 2.09 and/or b) what exactly was the purpose
of the neat code in Maypole::Application 2.09?

FWIW, I'm using a PERL5LIB path modified by my Apache configuration.


Thanks!

Matt
--
Matt Adams <***@morcor.com>
Development Specialist
Morcor Solutions Inc. <http://www.morcor.com/>
(613) 354-2912 x228

GnuPG public key at <http://staff.morcor.com/~madams/>
Key fingerprint: BED5 B4F7 CCF5 D7B5 7C56 0505 9A0A A0FB C937 5975
Dave Howorth
2005-02-01 23:38:57 UTC
Permalink
Post by Matt Adams
Just wondering if Marcus R. or Simon F. (or anyone else) had any other
suggestions as to why Maypole::Application is still broken in 2.09.
I suspect you'll have to wait for Simon for a definitive answer.
Post by Matt Adams
Maybe it's not... maybe it's me?
Here's the problem (same as before -- just slightly edited).
I recently upgraded to Maypole 2.09 and discovered that it is not
compatible with the Maypole app I have been using. I'm hoping that
those of you who are more familiar with the Maypole-innards will be able
to shed some light on why I'm having the problems I am.
It would appear that the neat stuff in Maypole::Application 2.09 is
still causing problems for my poor Maypole-powered application.
If I downgrade to Maypole::Application 2.07 everything works fine.
BEGIN {
package MyApp;
use MyApp::Constants;
$ENV{MAYPOLE_CONFIG} = BINPATH . '/MyApp.yaml';
}
package MyApp;
use Maypole::Application qw(
-Debug
Config::YAML
Authentication::Abstract
-Setup
);
But unfortunately this doesn't work out too well with
MyApp...Debugging enabled
MyApp...Loaded plugin: Maypole::Plugin::Authentication::Abstract
MyApp...Loaded plugin: Maypole::Plugin::Config::YAML
This looks a little odd. One of the things fixed in 2.09 was to make
sure that the plugins really are loaded in the order they are declared
(this wasn't the case in some previous releases). Now these messages
aren't in the same order as in your use statement. So are you sure these
messages are really being output by 2.09?

If so, they seem to be showing a 2.09 bug. A complete simple test case
would be very helpful.
Post by Matt Adams
MyApp...No DSN set in config
[error] Can't locate object method "new" via package
"Class::DBI::Loader::" (perhaps you forgot to load
"Class::DBI::Loader::"?) at /.../lib/Class/DBI/Loader.pm line 77.
I guess your config might be relevant to understanding what's going on
here? (Not by me, I don't use either the YAML or CDBI-Loader :)

Cheers, Dave
Post by Matt Adams
BEGIN failed--compilation aborted at /.../MyApp.pm line 36.
Compilation failed in require at (eval 10) line 3.
[error] Can't call method "_table2class" on an undefined value at
/.../lib/Maypole/Model/CDBI.pm line 250.
Can someone give me some pointers as to a) how to fix my app so that it
is compliant with Maypole::Application 2.09 and/or b) what exactly was
the purpose of the neat code in Maypole::Application 2.09?
FWIW, I'm using a PERL5LIB path modified by my Apache configuration.
Thanks!
Matt
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.3 - Release Date: 31/01/05
Simon Flack
2005-02-02 19:22:15 UTC
Permalink
Post by Dave Howorth
Post by Matt Adams
Just wondering if Marcus R. or Simon F. (or anyone else) had any other
suggestions as to why Maypole::Application is still broken in 2.09.
I suspect you'll have to wait for Simon for a definitive answer.
Post by Matt Adams
Maybe it's not... maybe it's me?
Here's the problem (same as before -- just slightly edited).
I recently upgraded to Maypole 2.09 and discovered that it is not
compatible with the Maypole app I have been using. I'm hoping that
those of you who are more familiar with the Maypole-innards will be
able to shed some light on why I'm having the problems I am.
It would appear that the neat stuff in Maypole::Application 2.09 is
still causing problems for my poor Maypole-powered application.
If I downgrade to Maypole::Application 2.07 everything works fine.
BEGIN {
package MyApp;
use MyApp::Constants;
$ENV{MAYPOLE_CONFIG} = BINPATH . '/MyApp.yaml';
}
package MyApp;
use Maypole::Application qw(
-Debug
Config::YAML
Authentication::Abstract
-Setup
);
But unfortunately this doesn't work out too well with
MyApp...Debugging enabled
MyApp...Loaded plugin: Maypole::Plugin::Authentication::Abstract
MyApp...Loaded plugin: Maypole::Plugin::Config::YAML
This looks a little odd. One of the things fixed in 2.09 was to make
sure that the plugins really are loaded in the order they are declared
(this wasn't the case in some previous releases). Now these messages
aren't in the same order as in your use statement. So are you sure these
messages are really being output by 2.09?
Indeed. It looks like it has loaded the plugins in sort() order, which
was the case pre 2.09.

Matt, could you check the debug output of:

#!/usr/bin/perl
use Maypole::Application 2.09 qw(-Debug Config::YAML
Authentication::Abstract);
Post by Dave Howorth
If so, they seem to be showing a 2.09 bug. A complete simple test case
would be very helpful.
Post by Matt Adams
MyApp...No DSN set in config
[error] Can't locate object method "new" via package
"Class::DBI::Loader::" (perhaps you forgot to load
"Class::DBI::Loader::"?) at /.../lib/Class/DBI/Loader.pm line 77.
I guess your config might be relevant to understanding what's going on
here? (Not by me, I don't use either the YAML or CDBI-Loader :)
Cheers, Dave
Post by Matt Adams
BEGIN failed--compilation aborted at /.../MyApp.pm line 36.
Compilation failed in require at (eval 10) line 3.
[error] Can't call method "_table2class" on an undefined value at
/.../lib/Maypole/Model/CDBI.pm line 250.
Can someone give me some pointers as to a) how to fix my app so that
it is compliant with Maypole::Application 2.09 and/or b) what exactly
was the purpose of the neat code in Maypole::Application 2.09?
FWIW, I'm using a PERL5LIB path modified by my Apache configuration.
I wonder whether it's picking up an older version of Maypole. It would
be good to check which version of Maypole::Application is being used. Do
you have Apache::Status installed?

Simon
Matt Adams
2005-02-04 21:30:30 UTC
Permalink
Hi Simon:

Sorry it took so long to get back to you. Things have been crazy at the work place.

Just to reiterate, here is my Maypole app configuration:

BEGIN {
package MyApp;
use MyApp::Constants;
$ENV{MAYPOLE_CONFIG} = BINPATH . '/MyApp.yaml';
}

package MyApp;

use Maypole::Application qw(
-Debug
Config::YAML
Authentication::Abstract
-Setup
);
Post by Simon Flack
Post by Dave Howorth
Post by Matt Adams
But unfortunately this doesn't work out too well with
MyApp...Debugging enabled
MyApp...Loaded plugin: Maypole::Plugin::Authentication::Abstract
MyApp...Loaded plugin: Maypole::Plugin::Config::YAML
This looks a little odd. One of the things fixed in 2.09 was to make
sure that the plugins really are loaded in the order they are declared
(this wasn't the case in some previous releases). Now these messages
aren't in the same order as in your use statement. So are you sure
these messages are really being output by 2.09?
Whoops. I should have looked at the output closer. You're right:
Maypole::Application 2.09 gets the order straight. 2.08 doesn't.

However, I still get the same error with 2.09 that I did with 2.08.

The error (slightly edited to remove long paths) is:

MyApp...Debugging enabled
MyApp...Loaded plugin: Maypole::Plugin::Config::YAML
MyApp...Loaded plugin: Maypole::Plugin::Authentication::Abstract
MyApp...No DSN set in config
[error] Can't locate object method "new" via package "Class::DBI::Loader::"
(perhaps you forgot to load "Class::DBI::Loader::"?) at Class/DBI/Loader.pm line 77.
BEGIN failed--compilation aborted at MyApp.pm line 36.
Compilation failed in require at (eval 17) line 3.
[error] Can't call method "_table2class" on an undefined value at
Maypole/Model/CDBI.pm line 250.
Post by Simon Flack
Indeed. It looks like it has loaded the plugins in sort() order, which
was the case pre 2.09.
#!/usr/bin/perl
use Maypole::Application 2.09 qw(-Debug Config::YAML
Authentication::Abstract);
Yes. The output (slightly edited to remove unsightly paths) of this command is:

Debugging enabled at Maypole/Application.pm line 24.
Loaded plugin: Maypole::Plugin::Config::YAML at Maypole/Application.pm line 31.
Loaded plugin: Maypole::Plugin::Authentication::Abstract at
Maypole/Application.pm line 31.
Post by Simon Flack
Post by Dave Howorth
If so, they seem to be showing a 2.09 bug. A complete simple test case
would be very helpful.
I guess your config might be relevant to understanding what's going on
here? (Not by me, I don't use either the YAML or CDBI-Loader :)
My YAML config file is:

--- #YAML:1.0
dsn: dbi:mysql:myapp
model: MyApp::Model::CDBI
pass: user
rows_per_page: 10
uri_base: http://bugs:8000/
user: user
datetime: '%a, %b %e, %Y at %l:%M %p'

FWIW, I'm using a PERL5LIB path modified by my Apache configuration.
And few of my Perl modules are in the standard location but that doesn't seem to
(and shouldn't) matter since the PERL5LIB path includes them all.
Post by Simon Flack
I wonder whether it's picking up an older version of Maypole. It would
be good to check which version of Maypole::Application is being used. Do
you have Apache::Status installed?
Nope. It appears to be picking up the correct version of Maypole. I only have
one installed. Things work if I use Maypole::Application 2.07 but not if I use
Maypole::Application 2.08 or 2.09.


Thanks for your help!

Matt
--
Matt Adams <***@morcor.com>
Development Specialist
Morcor Solutions Inc. <http://www.morcor.com/>
(613) 354-2912 x228

GnuPG public key at <http://staff.morcor.com/~madams/>
Key fingerprint: BED5 B4F7 CCF5 D7B5 7C56 0505 9A0A A0FB C937 5975
Dave Howorth
2005-02-04 22:31:34 UTC
Permalink
Post by Matt Adams
BEGIN {
package MyApp;
use MyApp::Constants;
$ENV{MAYPOLE_CONFIG} = BINPATH . '/MyApp.yaml';
}
package MyApp;
use Maypole::Application qw(
-Debug
Config::YAML
Authentication::Abstract
-Setup
);
MyApp...Debugging enabled
MyApp...Loaded plugin: Maypole::Plugin::Config::YAML
MyApp...Loaded plugin: Maypole::Plugin::Authentication::Abstract
MyApp...No DSN set in config
[error] Can't locate object method "new" via package
"Class::DBI::Loader::" (perhaps you forgot to load
"Class::DBI::Loader::"?) at Class/DBI/Loader.pm line 77.
BEGIN failed--compilation aborted at MyApp.pm line 36.
Compilation failed in require at (eval 17) line 3.
[error] Can't call method "_table2class" on an undefined value at
Maypole/Model/CDBI.pm line 250.
--- #YAML:1.0
dsn: dbi:mysql:myapp
model: MyApp::Model::CDBI
pass: user
rows_per_page: 10
uri_base: http://bugs:8000/
user: user
datetime: '%a, %b %e, %Y at %l:%M %p'
FWIW, I'm using a PERL5LIB path modified by my Apache configuration.
And few of my Perl modules are in the standard location but that doesn't
seem to (and shouldn't) matter since the PERL5LIB path includes them all.
It appears to be picking up the correct version of Maypole. I
only have one installed. Things work if I use Maypole::Application 2.07
but not if I use Maypole::Application 2.08 or 2.09.
Hi Matt,

I just noticed one more oddity. Your 'reference' version of Maypole is
2.07. Now that was never actually released to CPAN because of problems
that emerged with the pre-release. So I guess it's worth asking whether
you see your problem with an earlier released version?

That said, you may need to do some more investigation anyway. I
mentioned that I didn't use YAML and it's clear from Simon's answer that
he doesn't! Nobody else has stepped up to say that they DO use YAML and
report either that they can repeat your problem or that it works for
them. So there's a real lack of information to diagnose the problem.

I'd suggest you step though the problem in the debugger using
Maypole::CLI. The relevant bits of Maypole::Application,
Maypole::Plugin::Config::YAML and Maypole::Model::CDBI are small enough
that this should be fairly easy. That way you can find out just what is
going wrong and in which module.

Cheers, Dave
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.4 - Release Date: 01/02/05
Matt Adams
2005-02-04 21:32:20 UTC
Permalink
Do you have Apache::Status installed?
Yes I do but it doesn't appear to do me any good unless Maypole loads correctly.


Cheers

Matt
--
Matt Adams <***@morcor.com>
Development Specialist
Morcor Solutions Inc. <http://www.morcor.com/>
(613) 354-2912 x228

GnuPG public key at <http://staff.morcor.com/~madams/>
Key fingerprint: BED5 B4F7 CCF5 D7B5 7C56 0505 9A0A A0FB C937 5975
Loading...