Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

Error loading data from schema

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


ksmclane at us

Apr 4, 2012, 7:28 AM

Post #1 of 6 (398 views)
Permalink
Error loading data from schema

I am getting the following error: Caught exception in
dbms::Controller::AccountView->list "Can't call method "all" on an
undefined value at
/tmp/catalyst/dbms/script/../lib/dbms/Controller/AccountView.pm line 7."

this is the referenced sub:

sub list : Local {
my ($self, $c) = @_;
$c->stash(accounts => $c->model('dbms::ACCOUNT_VIEW')->all);
$c->stash(template => 'accountview/list.tt2');
}

I have seen quite a few posts about this error but no real explanations of
what is causing the issue. I created a view in the DB containing the data
I need to display on the page. The error is occurring at this line:
$c->stash(accounts => $c->model('dbms::ACCOUNT_VIEW')->all); which I have
tried several different things. If I remove the ->all I get no error and
my header row appears. I cannot find anything that tells me specifically
what this should be composed of. Any pointers to help figure this out are
appreciated.

Regards


fobispo at isc

Apr 4, 2012, 7:44 AM

Post #2 of 6 (385 views)
Permalink
Re: Error loading data from schema [In reply to]

The error is because $c->model('dbms::ACCOUNT_VIEW') is not defined.

Did you create the view after creating the model? if so, try re-running the create script so it can pick up the changes.

Also, to avoid fatal errors, you should attempt to load the model first, and then send to the template a data structure only if it loads properly.



On Apr 4, 2012, at 7:28 AM, Kenneth S Mclane wrote:

> I am getting the following error: Caught exception in dbms::Controller::AccountView->list "Can't call method "all" on an undefined value at /tmp/catalyst/dbms/script/../lib/dbms/Controller/AccountView.pm line 7."
>
> this is the referenced sub:
>
> sub list : Local {
> my ($self, $c) = @_;
> $c->stash(accounts => $c->model('dbms::ACCOUNT_VIEW')->all);
> $c->stash(template => 'accountview/list.tt2');
> }
>
> I have seen quite a few posts about this error but no real explanations of what is causing the issue. I created a view in the DB containing the data I need to display on the page. The error is occurring at this line: $c->stash(accounts => $c->model('dbms::ACCOUNT_VIEW')->all); which I have tried several different things. If I remove the ->all I get no error and my header row appears. I cannot find anything that tells me specifically what this should be composed of. Any pointers to help figure this out are appreciated.
>
> Regards
>
> _______________________________________________
> List: Catalyst [at] lists
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst [at] lists/
> Dev site: http://dev.catalyst.perl.org/

Francisco Obispo
email: fobispo [at] isc
Phone: +1 650 423 1374 || INOC-DBA *3557* NOC
PGP KeyID = B38DB1BE


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


ksmclane at us

Apr 4, 2012, 8:07 AM

Post #3 of 6 (383 views)
Permalink
Re: Error loading data from schema [In reply to]

From:
Francisco Obispo <fobispo [at] isc>
To:
The elegant MVC web framework <catalyst [at] lists>
Date:
04/04/2012 09:47 AM
Subject:
Re: [Catalyst] Error loading data from schema



The error is because $c->model('dbms::ACCOUNT_VIEW') is not defined.

Did you create the view after creating the model? if so, try re-running
the create script so it can pick up the changes.

Also, to avoid fatal errors, you should attempt to load the model first,
and then send to the template a data structure only if it loads properly.



On Apr 4, 2012, at 7:28 AM, Kenneth S Mclane wrote:

> I am getting the following error: Caught exception in
dbms::Controller::AccountView->list "Can't call method "all" on an
undefined value at
/tmp/catalyst/dbms/script/../lib/dbms/Controller/AccountView.pm line 7."
>
> this is the referenced sub:
>
> sub list : Local {
> my ($self, $c) = @_;
> $c->stash(accounts => $c->model('dbms::ACCOUNT_VIEW')->all);
> $c->stash(template => 'accountview/list.tt2');
> }
>
> I have seen quite a few posts about this error but no real explanations
of what is causing the issue. I created a view in the DB containing the
data I need to display on the page. The error is occurring at this line:
$c->stash(accounts => $c->model('dbms::ACCOUNT_VIEW')->all); which I have
tried several different things. If I remove the ->all I get no error and
my header row appears. I cannot find anything that tells me specifically
what this should be composed of. Any pointers to help figure this out are
appreciated.
>
> Regards
>

Thanks for the quick response. I did create it after but I also re-ran the
script and it pulled it in. I found my error, I was using the wrong schema
name, hence the object didn't exist. Now it is giving me "Couldn't render
template "accountview/list.tt2: file error - config/main: not found", so I
need to go track that one down. If I can get this one page working I'll be
able to create all the pages I need then add auth and CRUD and I'm in
business.


edencardim at gmail

Apr 4, 2012, 9:11 AM

Post #4 of 6 (379 views)
Permalink
Re: Error loading data from schema [In reply to]

>>>>> "Kenneth" == Kenneth S Mclane <ksmclane [at] us> writes:

Kenneth> I am getting the following error: Caught exception in
Kenneth> dbms::Controller::AccountView->list "Can't call method "all" on
Kenneth> an undefined value at
Kenneth> /tmp/catalyst/dbms/script/../lib/dbms/Controller/AccountView.pm
Kenneth> line 7."

Kenneth> this is the referenced sub:

Kenneth> sub list : Local { my ($self, $c) = @_; $c->stash(accounts =>
Kenneth> $c->model('dbms::ACCOUNT_VIEW')->all); $c->stash(template =>
Kenneth> 'accountview/list.tt2'); }

Kenneth> I have seen quite a few posts about this error but no real
Kenneth> explanations of what is causing the issue. I created a view in
Kenneth> the DB containing the data I need to display on the page. The
Kenneth> error is occurring at this line: $c->stash(accounts => $c->
Kenneth> model('dbms::ACCOUNT_VIEW')->all); which I have tried several
Kenneth> different things. If I remove the ->all I get no error and my
Kenneth> header row appears. I cannot find anything that tells me
Kenneth> specifically what this should be composed of. Any pointers to
Kenneth> help figure this out are appreciated.

When the app loads, you should get a list of loaded components, please show us
that list.

--
Eden Cardim Need help with your Catalyst or DBIx::Class project?
Code Monkey http://www.shadowcat.co.uk/catalyst/
Shadowcat Systems Ltd. Want a managed development or deployment platform?
http://edencardim.com http://www.shadowcat.co.uk/servers/

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


ksmclane at us

Apr 4, 2012, 10:11 AM

Post #5 of 6 (382 views)
Permalink
Re: Error loading data from schema [In reply to]

From:
Eden Cardim <edencardim [at] gmail>
To:
The elegant MVC web framework <catalyst [at] lists>
Date:
04/04/2012 11:13 AM
Subject:
Re: [Catalyst] Error loading data from schema



>>>>> "Kenneth" == Kenneth S Mclane <ksmclane [at] us> writes:

Kenneth> I am getting the following error: Caught exception in
Kenneth> dbms::Controller::AccountView->list "Can't call method "all"
on
Kenneth> an undefined value at
Kenneth>
/tmp/catalyst/dbms/script/../lib/dbms/Controller/AccountView.pm
Kenneth> line 7."

Kenneth> this is the referenced sub:

Kenneth> sub list : Local { my ($self, $c) = @_; $c->stash(accounts =>
Kenneth> $c->model('dbms::ACCOUNT_VIEW')->all); $c->stash(template =>
Kenneth> 'accountview/list.tt2'); }

Kenneth> I have seen quite a few posts about this error but no real
Kenneth> explanations of what is causing the issue. I created a view
in
Kenneth> the DB containing the data I need to display on the page. The
Kenneth> error is occurring at this line: $c->stash(accounts => $c->
Kenneth> model('dbms::ACCOUNT_VIEW')->all); which I have tried several
Kenneth> different things. If I remove the ->all I get no error and my
Kenneth> header row appears. I cannot find anything that tells me
Kenneth> specifically what this should be composed of. Any pointers to
Kenneth> help figure this out are appreciated.

When the app loads, you should get a list of loaded components, please
show us
that list.

[debug] Debug messages enabled
[debug] Statistics enabled
[debug] Loaded plugins:
.----------------------------------------------------------------------------.
| Catalyst::Plugin::ConfigLoader 0.30 |
'----------------------------------------------------------------------------'

[debug] Loaded dispatcher "Catalyst::Dispatcher"
[debug] Loaded engine "Catalyst::Engine"
[debug] Found home "/tmp/catalyst/dbms"
[debug] Loaded Config "/tmp/catalyst/dbms/dbms.conf"
[debug] Loaded components:
.-----------------------------------------------------------------+----------.
| Class | Type
|
+-----------------------------------------------------------------+----------+
| dbms::Controller::AccountView |
instance |
| dbms::Controller::Root |
instance |
| dbms::Model::ORANGES |
instance |
| dbms::Model::ORANGES::Account | class
|
| dbms::Model::ORANGES::AccountView | class
|
| dbms::Model::ORANGES::Alert | class
|
| dbms::Model::ORANGES::Assignment | class
|
| dbms::Model::ORANGES::Assignments | class
|
| dbms::Model::ORANGES::CfgAssignments | class
|
| dbms::Model::ORANGES::Check | class
|
| dbms::Model::ORANGES::Compliance | class
|
| dbms::Model::ORANGES::Contact | class
|
| dbms::Model::ORANGES::Department | class
|
| dbms::Model::ORANGES::File | class
|
| dbms::Model::ORANGES::Fixtime | class
|
| dbms::Model::ORANGES::Frequency | class
|
| dbms::Model::ORANGES::Latest | class
|
| dbms::Model::ORANGES::Manager | class
|
| dbms::Model::ORANGES::Metrics | class
|
| dbms::Model::ORANGES::Priv | class
|
| dbms::Model::ORANGES::Progress | class
|
| dbms::Model::ORANGES::Report | class
|
| dbms::Model::ORANGES::Retention | class
|
| dbms::Model::ORANGES::Schedule | class
|
| dbms::Model::ORANGES::Server | class
|
| dbms::Model::ORANGES::Status | class
|
| dbms::Model::ORANGES::Subsystem | class
|
| dbms::Model::ORANGES::Ticket | class
|
| dbms::Model::ORANGES::Upload | class
|
| dbms::View::HTML |
instance |
| dbms::View::accountview |
instance |
'-----------------------------------------------------------------+----------'

[debug] Loaded Private actions:
.----------------------+--------------------------------------+--------------.
| Private | Class | Method |
+----------------------+--------------------------------------+--------------+
| /default | dbms::Controller::Root | default |
| /end | dbms::Controller::Root | end |
| /index | dbms::Controller::Root | index |
| /accountview/list | dbms::Controller::AccountView | list |
'----------------------+--------------------------------------+--------------'

[debug] Loaded Path actions:
.-------------------------------------+--------------------------------------.
| Path | Private |
+-------------------------------------+--------------------------------------+
| /accountview/list/... | /accountview/list |
'-------------------------------------+--------------------------------------'

[info] dbms powered by Catalyst 5.90011
HTTP::Server::PSGI: Accepting connections at http://0:3000/

Strange, I do not see it listed, yet it got created and works when I call
the /index.


edencardim at gmail

Apr 4, 2012, 1:34 PM

Post #6 of 6 (371 views)
Permalink
Re: Error loading data from schema [In reply to]

| dbms::Model::ORANGES::AccountView | class |

Kenneth> Strange, I do not see it listed, yet it got created and works
Kenneth> when I call the /index.

You probably want $c->model('ORANGES::AccountView');

--
Eden Cardim Need help with your Catalyst or DBIx::Class project?
Code Monkey http://www.shadowcat.co.uk/catalyst/
Shadowcat Systems Ltd. Want a managed development or deployment platform?
http://edencardim.com http://www.shadowcat.co.uk/servers/

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

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.