FAQ
hi guys

i thought i upgrade my server's catalyst runtime package to the latest
one.

When I tried running my app, i got this error:


Could not load class
(Catalyst::Plugin::Upload::Image::Magick::Thumbnail::Fixed) because :
You are trying to modify Catalyst::Request::Upload, which has been made
immutable, this is not supported. Try subclassing
Catalyst::Request::Upload, rather than monkeypatching it at
/usr/local/lib/perl5/site_perl/5.8.9/MooseX/Emulate/Class/Accessor/Fast.pm
line 107
Catalyst::Component::mk_accessors('Catalyst::Request::Upload',
'_thumbnail_fixed', '_thumbnail_temp') called at
/usr/local/lib/perl5/site_perl/5.8.9/Catalyst/Plugin/Upload/Image/Magick/Thumbnail/Fixed.pm
line 108
require Catalyst/Plugin/Upload/Image/Magick/Thumbnail/Fixed.pm called
at /usr/local/lib/perl5/site_perl/5.8.9/x86_64-linux/Class/MOP.pm line 136

...

This is what part of my lib/MyApp.pm looks like:

use Catalyst qw(
-Debug
ConfigLoader
Static::Simple

StackTrace

Authentication
Authentication::Store::DBIC
Authentication::Credential::Password

Authorization::ACL
Authorization::Roles

Cache
Cache::Store::FastMmap

FormValidator

Session
Session::Store::FastMmap
Session::State::Cookie
Upload::Image::Magick
Upload::Image::Magick::Thumbnail::Fixed
);



Anyway, i went to lib/MyApp.pm and removed '
Upload::Image::Magick::Thumbnail::Fixed' and ran the app. Bear in mind I
still had ' Upload::Image::Magick' there.


When I tried to run script/myApp_server.pl again, I got this error:

Could not load class (Catalyst::Plugin::Upload::Image::Magick) because :
You are trying to modify Catalyst::Request::Upload, which has been made
immutable, this is not supported. Try subclassing
Catalyst::Request::Upload, rather than monkeypatching it at
/usr/local/lib/perl5/site_perl/5.8.9/MooseX/Emulate/Class/Accessor/Fast.pm
line 107
Catalyst::Component::mk_accessors('Catalyst::Request::Upload',
'_image') called at
/usr/local/lib/perl5/site_perl/5.8.9/Catalyst/Plugin/Upload/Image/Magick.pm
line 50
require Catalyst/Plugin/Upload/Image/Magick.pm called at
/usr/local/lib/perl5/site_perl/5.8.9/x86_64-linux/Class/MOP.pm line 136
eval {...} called at
/usr/local/lib/perl5/site_perl/5.8.9/x86_64-linux/Class/MOP.pm line 136
Class::MOP::_try_load_one_class('Catalyst::Plugin::Upload::Image::Magick') called at /usr/local/lib/perl5/site_perl/5.8.9/x86_64-linux/Class/MOP.pm line 99
...


" Try subclassing Catalyst::Request::Upload," --> What does it mean and
how do I go about doing it?
Then again, another question would be, "is it a core issue? ".



thank you for your time. I look forward to hearing some comments.

K. akimoto

Search Discussions

  • Chisel Wright at Apr 30, 2009 at 1:58 pm

    On Thu, Apr 30, 2009 at 11:40:47PM +1000, kakimoto@tpg.com.au wrote:
    Could not load class
    (Catalyst::Plugin::Upload::Image::Magick::Thumbnail::Fixed) because :
    You are trying to modify Catalyst::Request::Upload, which has been made
    immutable, this is not supported. Try subclassing
    Catalyst::Request::Upload, rather than monkeypatching it at
    /usr/local/lib/perl5/site_perl/5.8.9/MooseX/Emulate/Class/Accessor/Fast.pm
    line 107
    Yeah, I stumbled across this the other day and added output to the RT
    ticket: https://rt.cpan.org/Ticket/Display.html?idE188

    I had a quick look but wasn't sure how to resolve the issue (properly).

    Chiz
    --
    Chisel Wright
    e: chisel@herlpacker.co.uk
    w: http://www.herlpacker.co.uk/

    Pink is my favourite crayon
  • Tomas Doran at Apr 30, 2009 at 2:05 pm

    kakimoto@tpg.com.au wrote:
    " Try subclassing Catalyst::Request::Upload," --> What does it mean and
    how do I go about doing it?
    Then again, another question would be, "is it a core issue? ".
    Catalyst::Plugin::Upload::Image::Magick contains code which says
    Catalyst::Request::Upload->mk_accessors('_image');

    This is the plugin changing the core framework class, and is nasty
    action at a distance.

    That plugin is broken:

    http://rt.cpan.org/Public/Bug/Display.html?idE188

    Cheers
    t0m
  • Chisel Wright at Apr 30, 2009 at 2:17 pm

    On Thu, Apr 30, 2009 at 03:05:35PM +0100, Tomas Doran wrote:
    Catalyst::Plugin::Upload::Image::Magick contains code which says
    Catalyst::Request::Upload->mk_accessors('_image');

    This is the plugin changing the core framework class, and is nasty
    action at a distance.

    That plugin is broken
    Yeah, I'd already come to that conclusion.

    Any suggestions for a sane(r) approach? As it's a plugin I've used I
    might be able to find some tuits to experiment with an implementation.

    Chisel
    --
    Chisel Wright
    e: chisel@herlpacker.co.uk
    w: http://www.herlpacker.co.uk/

    It's not dead, it's just resting!
  • Matt S Trout at Apr 30, 2009 at 10:35 pm

    On Thu, Apr 30, 2009 at 03:17:03PM +0100, Chisel Wright wrote:
    On Thu, Apr 30, 2009 at 03:05:35PM +0100, Tomas Doran wrote:
    Catalyst::Plugin::Upload::Image::Magick contains code which says
    Catalyst::Request::Upload->mk_accessors('_image');

    This is the plugin changing the core framework class, and is nasty
    action at a distance.

    That plugin is broken
    Yeah, I'd already come to that conclusion.

    Any suggestions for a sane(r) approach? As it's a plugin I've used I
    might be able to find some tuits to experiment with an implementation.
    CatalystX::RoleApplicator I guess.

    --
    Matt S Trout Catalyst and DBIx::Class consultancy with a clue
    Technical Director and a commit bit: http://shadowcat.co.uk/catalyst/
    Shadowcat Systems Limited
    mst (@) shadowcat.co.uk http://shadowcat.co.uk/blog/matt-s-trout/
  • K. Akimoto at Apr 30, 2009 at 11:22 pm

    Any suggestions for a sane(r) approach? As it's a plugin I've used I
    might be able to find some tuits to experiment with an
    implementation.
    Are there many of us using ImageMAgick in their apps?

    I'm just tempted to use Catalyst::Request and
    Image::Magick::Thumbnail::Fixed or Image::Resize directly (ie not as a
    Catalyst plugin).
  • Kieren Diment at Apr 30, 2009 at 11:34 pm

    On 01/05/2009, at 9:22 AM, kakimoto@tpg.com.au wrote:

    Any suggestions for a sane(r) approach? As it's a plugin I've used I
    might be able to find some tuits to experiment with an
    implementation.
    Are there many of us using ImageMAgick in their apps?

    I'm just tempted to use Catalyst::Request and
    Image::Magick::Thumbnail::Fixed or Image::Resize directly (ie not as a
    Catalyst plugin).
    Makes much more sense for the simple case. For the more complex case
    put it in the Model, or render up an obect as an appropriate image
    type in the view, like Catalyst::View::GD or
    Catalyst::View::Graphics::Primitive.
  • Jay Shirley at Apr 30, 2009 at 11:36 pm

    On Fri, May 1, 2009 at 8:22 AM, wrote:

    Any suggestions for a sane(r) approach? As it's a plugin I've used I
    might be able to find some tuits to experiment with an
    implementation.
    Are there many of us using ImageMAgick in their apps?

    I'm just tempted to use Catalyst::Request and
    Image::Magick::Thumbnail::Fixed or Image::Resize directly (ie not as a
    Catalyst plugin).

    I wouldn't touch something like this as a plugin, period.

    My method is to have what essentially amounts as a file type dispatcher
    which takes incoming uploads passed in, then redirects to whatever is the
    most appropriate model class.

    I have a Model::Upload, as well as Model::Upload::Image and
    Model::Upload::Video -- in the controller, I just do:
    $c->model('Upload')->process( $upload );

    Put all the important bits in the model, and let it go from there.
    Depending upon how you associate stuff with the users and the DB changes.
    My method is to actually allow multiple Models, so I have a User processor
    that runs after the Image/Video processor -- and that is what stores the
    associations in the DB.

    I am also actively trying to release this set of modules, but ... still some
    kinks to work out before it is releasable. However, this strategy has
    worked very well for me.

    -J
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090501/d90f2215/attachment.htm
  • K. Akimoto at May 1, 2009 at 3:01 am

    My method is to have what essentially amounts as a file type
    dispatcher
    which takes incoming uploads passed in, then redirects to whatever is
    the
    most appropriate model class.
    Yep, I think I get what you mean. This is such that multiple
    controllers can make use of the upload method in your BASE model class.
    Right?

    thank you

    K. akimoto
  • Jay Shirley at May 1, 2009 at 3:52 am
    On Fri, May 1, 2009 at 12:01 PM, wrote:
    My method is to have what essentially amounts as a file type
    dispatcher
    which takes incoming uploads passed in, then redirects to whatever is
    the
    most appropriate model class.
    Yep, I think I get what you mean. This is such that multiple
    controllers can make use of the upload method in your BASE model class.
    Right?
    Yup, and also so I can easily use my file techniques outside of the main
    application (in another application) and from the command line.

    -J
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090501/6fa9734f/attachment.htm
  • Malloy at May 3, 2009 at 9:35 am
    I'm very sorry to hear that.
    On Thu, Apr 30, 2009 at 9:40 PM, wrote:


    hi guys

    i thought i upgrade my server's catalyst runtime package to the latest
    one.

    When I tried running my app, i got this error:


    Could not load class
    (Catalyst::Plugin::Upload::Image::Magick::Thumbnail::Fixed) because :
    You are trying to modify Catalyst::Request::Upload, which has been made
    immutable, this is not supported. Try subclassing
    Catalyst::Request::Upload, rather than monkeypatching it at
    /usr/local/lib/perl5/site_perl/5.8.9/MooseX/Emulate/Class/Accessor/Fast.pm
    line 107
    Catalyst::Component::mk_accessors('Catalyst::Request::Upload',
    '_thumbnail_fixed', '_thumbnail_temp') called at

    /usr/local/lib/perl5/site_perl/5.8.9/Catalyst/Plugin/Upload/Image/Magick/Thumbnail/Fixed.pm
    line 108
    require Catalyst/Plugin/Upload/Image/Magick/Thumbnail/Fixed.pm
    called
    at /usr/local/lib/perl5/site_perl/5.8.9/x86_64-linux/Class/MOP.pm line 136

    ...

    This is what part of my lib/MyApp.pm looks like:

    use Catalyst qw(
    -Debug
    ConfigLoader
    Static::Simple

    StackTrace

    Authentication
    Authentication::Store::DBIC
    Authentication::Credential::Password

    Authorization::ACL
    Authorization::Roles

    Cache
    Cache::Store::FastMmap

    FormValidator

    Session
    Session::Store::FastMmap
    Session::State::Cookie
    Upload::Image::Magick
    Upload::Image::Magick::Thumbnail::Fixed
    );



    Anyway, i went to lib/MyApp.pm and removed '
    Upload::Image::Magick::Thumbnail::Fixed' and ran the app. Bear in mind I
    still had ' Upload::Image::Magick' there.


    When I tried to run script/myApp_server.pl again, I got this error:

    Could not load class (Catalyst::Plugin::Upload::Image::Magick) because :
    You are trying to modify Catalyst::Request::Upload, which has been made
    immutable, this is not supported. Try subclassing
    Catalyst::Request::Upload, rather than monkeypatching it at
    /usr/local/lib/perl5/site_perl/5.8.9/MooseX/Emulate/Class/Accessor/Fast.pm
    line 107
    Catalyst::Component::mk_accessors('Catalyst::Request::Upload',
    '_image') called at
    /usr/local/lib/perl5/site_perl/5.8.9/Catalyst/Plugin/Upload/Image/Magick.pm
    line 50
    require Catalyst/Plugin/Upload/Image/Magick.pm called at
    /usr/local/lib/perl5/site_perl/5.8.9/x86_64-linux/Class/MOP.pm line 136
    eval {...} called at
    /usr/local/lib/perl5/site_perl/5.8.9/x86_64-linux/Class/MOP.pm line 136

    Class::MOP::_try_load_one_class('Catalyst::Plugin::Upload::Image::Magick')
    called at /usr/local/lib/perl5/site_perl/5.8.9/x86_64-linux/Class/MOP.pm
    line 99
    ...


    " Try subclassing Catalyst::Request::Upload," --> What does it mean and
    how do I go about doing it?
    Then again, another question would be, "is it a core issue? ".



    thank you for your time. I look forward to hearing some comments.

    K. akimoto



    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive:
    http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/


    --
    Jack Malloy
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090503/16f1eab8/attachment.htm
  • Kieren Diment at May 3, 2009 at 10:28 am

    On 03/05/2009, at 7:35 PM, Malloy wrote:

    I'm very sorry to hear that.
    Why?

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedApr 30, '09 at 1:40p
activeMay 3, '09 at 10:28a
posts12
users7
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2021 Grokbase