|
From: Chris W. <ch...@cw...> - 2002-08-23 14:55:42
|
* Eric Reeves (er...@1s...) [020823 10:50]:
> It appears I've hit another road block, and I can't figure out what I'm
> doing wrong.
>
> I've created a .sql file containing my SQL structure, and a data file
> containing the initial object data. When I attempt to run an install_sql
> on my generated package, I get the following errors:
> ...
> Data:
> * Error: Can't locate object method "new" via
> package "Intranet::NMS" (perhaps you forgot to load
> "Intranet::NMS"?) at
> /usr/local/lib/perl5/site_perl/5.6.1/OpenInteract/SQL
> Install.pm line 264.
>
> Why is method 'new' being called from my class, Intranet::NMS?
> Basing off of the fruit example, there is no 'new' method, and data
> gets installed fine. So, I'm sure I've gone wrong somewhere. .
But there *is* a new method -- OpenInteract::SQLInstall will create a
new SPOPS object for every entry in the data file, fill it with the
entry's information and call save() on it to save it to the table.
Make sure that your class name in your SPOPS configuration and your
data file match up. For instance, looking at the base_theme package we
have:
base_theme/data/install_theme.dat:
----------------------------------------
$theme = [
{ spops_class => 'OpenInteract::Theme',
field_order => [ qw/ theme_id title description parent credit / ] },
... ];
base_theme/conf/spops.perl:
----------------------------------------
$spops = {
'theme' => {
class => 'OpenInteract::Theme',
When you install the package to your website, the 'OpenInteract::'
gets rewritten to your website package, which looks like 'Intranet::'
in your case. (Yes, this is confusing. It's going away in the next
version but that won't be for a little while yet.)
Other things to look for:
- Is your 'NMS' object using any code classes? Are these
syntactically ok? (What does a 'oi_manage check_package' do when you
run it in the development package directory?)
- Is your NMS object configured ok?
> Security:
> * Error: Cannot create SPOPS object!
> Basic: DBD::Pg::st execute failed: ERROR: Cannot
> insert a duplicate key into unique index
> sys_security_object_id_key at
> /usr/local/lib/perl5/site_perl/5.6.1/SPOPS/SQLInterfa
> ce.pm line 288.
These errors I wouldn't worry about; they just indicate you've
installed the security previously and it won't install again.
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988
|