[Catalyst] Error while going through tutorial using Oracle

Jason Crummack jason.crummack at easysoft.com
Fri Aug 18 00:51:32 CEST 2006


Alex Boster wrote:

Hi Alex,

For oracle I think you need to set the sequence name for auto-increments

e.g.

__PACKAGE__->load_components (qw/PK::Auto Core/);
__PACKAGE__->sequence ('{NAME OF YOUR SEQUENCE HERE}');

I think that's right

Jason

> I am part way through the tutorial using Oracle and have gotten stuck.  
> I have create sequences and before insert triggers to replace mySQL's 
> autoincrements.  However, I now get:
>
> |Caught exception in MyApp::Controller::Books->url_create "Can't use an undefined value as a HASH reference at /u01/glue/share/perl5/lib/site_perl/5.8.8/DBIx/Class/ResultSource.pm line 197."||
>
> |when I try out the formless submission example.  On a suggestion, I removed the "PK::Auto" from the load_components bit of the table modules (i.e., from:
>
> __PACKAGE__->load_components(qw/PK::Auto Core/);
> ).  This had no affect.
>
> Any pointers?  Server output and error page follows.
>
> Thanks,
> AB
>
> Server stderr/stdout:
>
> [Template::Provider] creating cache of unlimited slots for [ 
> CODE(0x9f829a4) ]
> [debug] Debug messages enabled
> [debug] Loaded plugins:
> .----------------------------------------------------------------------------.
> | Catalyst::Plugin::ConfigLoader  
> 0.12                                       |
> | Catalyst::Plugin::StackTrace  
> 0.06                                         |
> | Catalyst::Plugin::Static::Simple  
> 0.14                                     |
> '----------------------------------------------------------------------------'
>
> [debug] Loaded dispatcher "Catalyst::Dispatcher"
> [debug] Loaded engine "Catalyst::Engine::HTTP"
> [debug] Found home "/home/aboster/dev/catalyst/MyApp"
> [debug] Loaded Config "/home/aboster/dev/catalyst/MyApp/myapp.yml"
> [debug] Loaded components:
> .-----------------------------------------------------------------+----------.
> | Class                                                           | 
> Type     |
> +-----------------------------------------------------------------+----------+
> | MyApp::Controller::Books                                        | 
> instance |
> | MyApp::Controller::Root                                         | 
> instance |
> | MyApp::Model::MyAppDB                                           | 
> instance |
> | MyApp::Model::MyAppDB::Author                                   | 
> class    |
> | MyApp::Model::MyAppDB::Book                                     | 
> class    |
> | MyApp::Model::MyAppDB::BookAuthor                               | 
> class    |
> | MyApp::View::TT                                                 | 
> instance |
> '-----------------------------------------------------------------+----------'
>
> [debug] Loaded Private actions:
> .----------------------+--------------------------------------+--------------.
> | Private              | Class                                | 
> Method       |
> +----------------------+--------------------------------------+--------------+
> | /default             | MyApp::Controller::Root              | 
> default      |
> | /end                 | MyApp::Controller::Root              | 
> end          |
> | /books/url_create    | MyApp::Controller::Books             | 
> url_create   |
> | /books/index         | MyApp::Controller::Books             | 
> index        |
> | /books/list          | MyApp::Controller::Books             | 
> list         |
> '----------------------+--------------------------------------+--------------'
>
> [debug] Loaded Path actions:
> .-------------------------------------+--------------------------------------.
> | Path                                | 
> Private                              |
> +-------------------------------------+--------------------------------------+
> | /books/list                         | 
> /books/list                          |
> | /books/url_create                   | 
> /books/url_create                    |
> '-------------------------------------+--------------------------------------'
>
> [info] MyApp powered by Catalyst 5.7001
> You can connect to your server at http://darkwind003.989studios.com:3000
> [info] *** Request 1 (0.200/s) [1065] [Thu Aug 17 10:32:58 2006] ***
> [debug] "GET" request for "books/url_create/TCPIP_Illustrated_Vol-2/5/4" 
> from "172.31.30.76"
> [debug] Path is "books/url_create"
> [debug] Arguments are "TCPIP_Illustrated_Vol-2/5/4"
> [error] Caught exception in MyApp::Controller::Books->url_create "Can't 
> use an undefined value as a HASH reference at 
> /u01/glue/share/perl5/lib/site_perl/5.8.8/DBIx/Class/ResultSource.pm 
> line 197."
> [info] Request took 1.681834s (0.595/s)
> .----------------------------------------------------------------+-----------.
> | Action                                                         | 
> Time      |
> +----------------------------------------------------------------+-----------+
> | /books/url_create                                              | 
> 1.656821s |
> | /end                                                           | 
> 0.000262s |
> '----------------------------------------------------------------+-----------'
>
> Error page:
>
> |Caught exception in MyApp::Controller::Books->url_create "Can't use an 
> undefined value as a HASH reference at 
> /u01/glue/share/perl5/lib/site_perl/5.8.8/DBIx/Class/ResultSource.pm 
> line 197."|
>
>
>     Stack Trace
>     <http://darkwind003:3000/books/url_create/TCPIP_Illustrated_Vol-2/5/4#>
>
> Package 	Line 	File
> MyApp::Controller::Books 	66 
> /home/aboster/dev/catalyst/MyApp/lib/MyApp/Controller/Books.pm
>
> | 63: 64: # Call create() on the book model object. Pass the table 65: # 
> columns/field values we want to set as hash values * 66: my $book = 
> $c->model('MyAppDB::Book')->create({ * 67: title => $title, 68: rating 
> => $rating 69: }); |
>
>
>     Request
>     <http://darkwind003:3000/books/url_create/TCPIP_Illustrated_Vol-2/5/4#>
>
> bless({
>   action           => "books/url_create",
>   address          => "172.31.30.76",
>   arguments        => ["TCPIP_Illustrated_Vol-2", 5, 4],
>   base             => bless(do{\(my $o = "http://darkwind003:3000/")}, "URI::http"),
>   body_parameters  => {},
>   captures         => [],
>   cookies          => {},
>   headers          => bless({
>                         "accept" => "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5",
>                         "accept-charset" => "ISO-8859-1,utf-8;q=0.7,*;q=0.7",
>                         "accept-encoding" => "gzip,deflate",
>                         "accept-language" => "en-us,en;q=0.5",
>                         connection => "keep-alive",
>                         host => "darkwind003:3000",
>                         "keep-alive" => 300,
>                         "user-agent" => "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.2) Gecko/20060419 CentOS/1.5.0.2-3.c4.centos Firefox/1.5.0.2",
>                       }, "HTTP::Headers"),
>   hostname         => "sceapdsd-172-31-30-76.989studios.com",
>   match            => "books/url_create",
>   method           => "GET",
>   parameters       => {},
>   path             => "books/url_create/TCPIP_Illustrated_Vol-2/5/4",
>   protocol         => "HTTP/1.0",
>   query_parameters => {},
>   secure           => 0,
>   uploads          => {},
>   uri              => bless(do{\(my $o = "http://darkwind003:3000/books/url_create/TCPIP_Illustrated_Vol-2/5/4")}, "URI::http"),
>   user             => undef,
> }, "Catalyst::Request")
>
>
>     Response
>     <http://darkwind003:3000/books/url_create/TCPIP_Illustrated_Vol-2/5/4#>
>
> bless({
>   body    => "",
>   cookies => {},
>   headers => bless({
>                "content-type" => "text/html; charset=utf-8",
>                "x-catalyst"   => "5.7001",
>              }, "HTTP::Headers"),
>   status  => 200,
> }, "Catalyst::Response")
>
>
>     Stash
>     <http://darkwind003:3000/books/url_create/TCPIP_Illustrated_Vol-2/5/4#>
>
> {}
>
>
>     Config
>     <http://darkwind003:3000/books/url_create/TCPIP_Illustrated_Vol-2/5/4#>
>
> do {
>   my $a = {
>     home => "/home/aboster/dev/catalyst/MyApp",
>     name => "MyApp",
>     root => bless({
>           dirs => ["", "home", "aboster", "dev", "catalyst", "MyApp", "root"],
>           file_spec_class => undef,
>           volume => "",
>         }, "Path::Class::Dir"),
>     stacktrace => { context => 3, verbose => 0 },
>     static => {
>           debug => 1,
>           dirs => [],
>           ignore_dirs => [],
>           ignore_extensions => ["tmpl", "tt", "tt2", "html", "xhtml"],
>           include_path => ['fix'],
>           mime_types => {},
>           no_logs => 1,
>         },
>   };
>   $a->{static}{include_path}[0] = $a->{root};
>   $a;
> }
>
>
>   MyApp on Catalyst 5.7001
>
>
>
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
>
>
>   




More information about the Catalyst mailing list