Gossamer Forum
Home : General : Perl Programming :

Can't locate Extropia/Core/App/DBApp.pm

Quote Reply
Can't locate Extropia/Core/App/DBApp.pm
Sorry, my previous threat contained HTML code as I though this would make it easier to read. Below the text only version

Hi everyone,
I'm not a programmer, but got a nice FAQ Manager running in the past. It served the purpose very well until I had to move to another server recently.

I have set the Chmod properly, but get the following error message:

Can't locate Extropia/Core/App/DBApp.pm in @INC (@INC contains: Modules Modules/CPAN . /usr/local/lib/perl/5.6.1 /usr/local/share/perl/5.6.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.6.1 /usr/share/perl/5.6.1 /usr/local/lib/site_perl) at /var/www/web114/html/cgi-bin/rbk/faq/faq.cgi line 55.
BEGIN failed--compilation aborted at /var/www/web114/html/cgi-bin/rbk/faq/faq.cgi line 55.



My code lookes like this:

1 #!/usr/bin/perl-wT
2
3 # Copyright (C) 1994 - 2001 eXtropia.com
4 #
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330,
18 # Boston, MA 02111-1307, USA.
19
20 use strict;
21 BEGIN{
22 use vars qw(@dirs);
23 @dirs = qw(Modules
24 Modules/CPAN .);
25 }
26
27 use lib @dirs;
28 # The following is only of interest to mod_perl, PerlEx,
29 # and other Perl acceleration users
30 unshift @INC, @dirs if $ENV{MOD_PERL};
31
32 my $APP_NAME = "faq";
33
34 my $GLOBAL_DATAFILES_DIRECTORY = "Datafiles";
35 my $TEMPLATES_CACHE_DIRECTORY = "$GLOBAL_DATAFILES_DIRECTORY/TemplatesCache";
36 my $APP_DATAFILES_DIRECTORY = "Datafiles/FAQ";
37
38 my $DOCUMENT_ROOT_URL = '/',
39 my $IMAGE_ROOT_URL = '/Images/Extropia',
40
41 my @VIEWS_SEARCH_PATH =
42 qw(Modules/Extropia/View/FAQ
43 Modules/Extropia/View/Default);
44
45 my @TEMPLATES_SEARCH_PATH =
46 qw(HTMLTemplates/FAQ
47 HTMLTemplates/FAQ/SSI
48 HTMLTemplates/Default);
49
50 use CGI qw(-debug);
51
52 #Carp commented out due to Perl 5.60 bug. Uncomment when using Perl 5.61.
53 #use CGI::Carp qw(fatalsToBrowser);
54
55 use Extropia::Core::App::DBApp;
56 use Extropia::Core::View;
57 use Extropia::Core::SessionManager;
58
59 my $CGI = new CGI() or
60 die("Unable to construct the CGI object" .
61 ". Please contact the webmaster.");
62
63 # turn the autoescaping off here
64 $CGI->autoEscape(undef);
65
66 my $VIEW_LOADER = new Extropia::Core::View
67 (\@VIEWS_SEARCH_PATH, \@TEMPLATES_SEARCH_PATH) or
68 die("Unable to construct the VIEW LOADER object in " . $CGI->script_name() .
69 ". Please contact the webmaster.");
70
71
72 foreach ($CGI->param()) {
73 $CGI->param($1,$CGI->param($_)) if (/(.*)\.x/);
74 }
75
76 ######################################################################
77 # SETUP #
78 ######################################################################
79
80 my @DATASOURCE_FIELD_NAMES = qw(
81 record_id
82 category
83 question
84 answer
85 username_of_poster
86 date_time_posted
87 );
88
89 my %BASIC_INPUT_WIDGET_DEFINITIONS = (
90 category => [
91 -DISPLAY_NAME => 'Category',
92 -TYPE => 'popup_menu',
93 -NAME => 'category',
94 -VALUES => [qw(
95 Installation_und_programmtechnische_Fragen
96 Umbaukosten_ermitteln_in_RBK-BiB
97 Objektkosten_ermitteln_in_RBK-BiB
98 Druckausgaben_in_RBK-BiB
99 Online-Hilfe_und_Handbuch
100 Begriffe_und_Normen
101 Sonstige_Fragen_zu_RBK-BiB
102 Fehlermeldungen_in_RBK-BiB
103 Anwenderwünsche_an_RBK-BiB
104 Allgemeine_Fragen_an_die_ZBWB_Freiburg
105 )],
106 -LABELS => {
107 'Installation_und_programmtechnische_Fragen' => 'Installation_und_programmtechnische_Fragen',
108 'Umbaukosten_ermitteln_in_RBK-BiB' => 'Umbaukosten_ermitteln_in_RBK-BiB',
109 'Objektkosten_ermitteln_in_RBK-BiB' => 'Objektkosten_ermitteln_in_RBK-BiB',
110 'Druckausgaben_in_RBK-BiB' => 'Druckausgaben_in_RBK-BiB',
111 'Online-Hilfe_und_Handbuch' => 'Online-Hilfe_und_Handbuch',
112 'Begriffe_und_Normen' => 'Begriffe_und_Normen',
113 'Sonstige_Fragen_zu_RBK-BiB' => 'Sonstige_Fragen_zu_RBK-BiB',
114 'Fehlermeldungen_in_RBK-BiB' => 'Fehlermeldungen_in_RBK-BiB',
115 'Anwenderwünsche_an_RBK-BiB' => 'Anwenderwünsche_an_RBK-BiB',
116 'Allgemeine_Fragen_an_die_ZBWB_Freiburg' => 'Allgemeine_Fragen_an_die_ZBWB_Freiburg',
117 },
118 -INPUT_CELL_COLSPAN => 2,
119 ],
120
121 question => [
122 -DISPLAY_NAME => 'Question',
123 -TYPE => 'textarea',
124 -NAME => 'question',
125 -ROWS => 2,
126 -COLS => 50,
127 -WRAP => 'VIRTUAL',
128 -INPUT_CELL_COLSPAN => 2,
129 ],
130
131 answer => [
132 -DISPLAY_NAME => 'Answer',
133 -TYPE => 'textarea',
134 -NAME => 'answer',
135 -ROWS => 20,
136 -COLS => 50,
137 -WRAP => 'VIRTUAL',
138 -INPUT_CELL_COLSPAN => 2,
139 ]
140 );
141
142 my @BASIC_INPUT_WIDGET_DISPLAY_ORDER = qw(
143 category
144 question
145 answer
146 );
147
148 my @INPUT_WIDGET_DEFINITIONS = (
149 -BASIC_INPUT_WIDGET_DEFINITIONS => \%BASIC_INPUT_WIDGET_DEFINITIONS,
150 -BASIC_INPUT_WIDGET_DISPLAY_ORDER => \@BASIC_INPUT_WIDGET_DISPLAY_ORDER
151 );
152
153
154 my @BASIC_DATASOURCE_CONFIG_PARAMS = (
155 -TYPE => 'File',
156 -CREATE_FILE_IF_NONE_EXISTS => 1,
157 -FILE => "$APP_DATAFILES_DIRECTORY/faq.dat",
158 -FIELD_DELIMITER => '|',
159 -COMMENT_PREFIX => '#',
160 -FIELD_NAMES => \@DATASOURCE_FIELD_NAMES,
161 -KEY_FIELDS => ['record_id'],
162 -FIELD_TYPES => {
163 record_id => 'Autoincrement'
164 }
165 );
166
167 my @DATASOURCE_CONFIG_PARAMS = (
168 -BASIC_DATASOURCE_CONFIG_PARAMS => \@BASIC_DATASOURCE_CONFIG_PARAMS,
169 );
170
171 ######################################################################
172 # VIEW SETUP #
173 ######################################################################
174
175 my @VALID_VIEWS = qw(
176 CSSView
177 BasicFAQView
178 DetailsRecordView
179
180 meta_tags
181 style_sheet_basic
182
183 navigation_template_top
184 freesupportnav
185 page_header_with_search_top
186 page_header_with_search_bottom
187
188 navigation_template_bottom
189 SearchView
190 );
191
192 my @VIEW_DISPLAY_PARAMS = (
193 -COLOR_FOR_EVEN_ROWS => 'E5E5E5',
194 -COLOR_FOR_ODD_ROWS => 'FFFFFF',
195 -APPLICATION_LOGO => 'logo.gif',
196 -APPLICATION_LOGO_HEIGHT => '40',
197 -APPLICATION_LOGO_WIDTH => '353',
198 -APPLICATION_LOGO_ALT => 'Microblend FAQ Manager',
199 -HTTP_HEADER_PARAMS => [-EXPIRES => '-1d'],
200 -DEFAULT_CHARSET => 'ISO-8859-1',
201 -LINK_TARGET => '_self',
202 -SCRIPT_DISPLAY_NAME => 'FAQManager',
203 -SCRIPT_NAME => $CGI->script_name(),
204 -FIELD_NAME_MAPPINGS => {
205 category => "Category",
206 question => "Question",
207 answer => "Answer"
208 },
209 -DISPLAY_FIELDS => [qw(
210 category
211 question
212 answer
213 )],
214 -SELECTED_DISPLAY_FIELDS => [qw(
215 category
216 question
217 )],
218 -SORT_FIELDS => [qw(
219 category
220 question
221 answer
222 )],
223 -FIELDS_TO_BE_DISPLAYED_AS_HTML_TAG => [qw(
224 question
225 answer
226 )],
227 -FIELDS_TO_BE_DISPLAYED_AS_MULTI_LINE_TEXT => [qw(
228 question
229 answer
230 )],
231
232 );
233
234 ######################################################################
235 # FILTER SETUP #
236 ######################################################################
237
238 my @HTMLIZE_FILTER_CONFIG_PARAMS = (
239 -TYPE => 'HTMLize',
240 -CONVERT_DOUBLE_LINEBREAK_TO_P => 1,
241 -CONVERT_LINEBREAK_TO_BR => 1,
242 );
243
244 my @CHARSET_FILTER_CONFIG_PARAMS = (
245 -TYPE => 'CharSet'
246 );
247
248 my @EMBED_FILTER_CONFIG_PARAMS = (
249 -TYPE => 'Embed',
250 -ENABLE => $CGI->param('embed') || 0
251 );
252
253 my @VIEW_FILTERS_CONFIG_PARAMS = (
254 \@HTMLIZE_FILTER_CONFIG_PARAMS,
255 \@CHARSET_FILTER_CONFIG_PARAMS,
256 \@EMBED_FILTER_CONFIG_PARAMS
257 );
258
259
260 ######################################################################
261 # ACTION/WORKFLOW SETUP #
262 ######################################################################
263
264 my @ACTION_HANDLER_LIST = qw(
265 Default::DisplayCSSViewAction
266 Default::DownloadFileAction
267
268 FAQ::DisplaySearchBasicDataViewAction
269
270 FAQ::DisplayFAQDetailsRecordViewAction
271 FAQ::DisplayFAQBasicDataViewAction
272
273 Default::DefaultAction
274 );
275
276 my @ACTION_HANDLER_ACTION_PARAMS = (
277 -ACTION_HANDLER_LIST => \@ACTION_HANDLER_LIST,
278 -BASIC_DATA_VIEW_NAME => 'BasicFAQView',
279 -CGI_OBJECT => $CGI,
280 -CSS_VIEW_URL => $CGI->script_name() . "?display_css_view=on",
281 -CSS_VIEW_NAME => "CSSView",
282 -DATASOURCE_CONFIG_PARAMS => \@DATASOURCE_CONFIG_PARAMS,
283 -DETAILS_VIEW_NAME => 'DetailsRecordView',
284 -DEFAULT_SORT_FIELD1 => 'date_time_posted',
285 -DEFAULT_SORT_FIELD2 => 'question',
286 -DEFAULT_VIEW_NAME => 'BasicFAQView',
287 -ENABLE_SORTING_FLAG => 1,
288 -HIDDEN_ADMIN_FIELDS_VIEW_NAME => 'HiddenAdminFieldsView',
289 -URL_ENCODED_ADMIN_FIELDS_VIEW_NAME => 'URLEncodedAdminFieldsView',
290 -SIMPLE_SEARCH_BOX_VIEW_NAME => 'SimpleSearchBoxView',
291 -SORT_DIRECTION => 'DESC',
292 -VIEW_FILTERS_CONFIG_PARAMS => \@VIEW_FILTERS_CONFIG_PARAMS,
293 -VIEW_DISPLAY_PARAMS => \@VIEW_DISPLAY_PARAMS,
294 -TEMPLATES_CACHE_DIRECTORY => $TEMPLATES_CACHE_DIRECTORY,
295 -VALID_VIEWS => \@VALID_VIEWS,
296 -VIEW_LOADER => $VIEW_LOADER,
297 -RECORDS_PER_PAGE_OPTS => [5, 10, 25, 50, 100],
298 -MAX_RECORDS_PER_PAGE => $CGI->param('records_per_page') || 3,
299 -DOCUMENT_ROOT_URL => $DOCUMENT_ROOT_URL,
300 -IMAGE_ROOT_URL => $IMAGE_ROOT_URL,
301 -SORT_FIELD1 => $CGI->param('sort_field1') || 'category',
302 -SORT_FIELD2 => $CGI->param('sort_field2') || 'fname',
303 -SIMPLE_SEARCH_STRING => $CGI->param('simple_search_string') || "",
304 -FIRST_RECORD_ON_PAGE => $CGI->param('first_record_to_display') || 0,
305 -LAST_RECORD_ON_PAGE => $CGI->param('first_record_to_display') || "0",
306 -KEY_FIELD => 'record_id',
307 -PAGE_TOP_VIEW => 'PageTopView',
308 -PAGE_BOTTOM_VIEW => 'PageBottomView',
309 -INPUT_WIDGET_DEFINITIONS => \@INPUT_WIDGET_DEFINITIONS,
310 );
311
312 ######################################################################
313 # LOAD APPLICATION #
314 ######################################################################
315
316 my $APP = new Extropia::Core::App::DBApp(
317 -ROOT_ACTION_HANDLER_DIRECTORY => "ActionHandler",
318 -ACTION_HANDLER_ACTION_PARAMS => \@ACTION_HANDLER_ACTION_PARAMS,
319 -ACTION_HANDLER_LIST => \@ACTION_HANDLER_LIST,
320 -VIEW_DISPLAY_PARAMS => \@VIEW_DISPLAY_PARAMS
321 ) or die("Unable to construct the application object in " .
322 $CGI->script_name() . ". Please contact the webmaster.");
323
324 print $APP->execute();
325

The site is this one:
http://www.microblend.de/cgi-bin/rbk/faq/faq.cgi

If I call the site through HTTP I get the 500 Internal Server Error message.

If you can help me I'll be super happy.

Wendelin
Quote Reply
Re: [wendelin] Can't locate Extropia/Core/App/DBApp.pm In reply to
You don't have a header printed anywhere? Try this near the top of the script....


print "Content-type: text/html \n\n";

...without a header, it doesn't matter how good the script is.. it won't run :p

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Can't locate Extropia/Core/App/DBApp.pm In reply to
When on the other Server I didn't have any other lines too. After reading your reply I did this:

#!/usr/bin/perl-wT
print "Content-type: text/html \n\n";
# Copyright (C) 1994 - 2001 eXtropia.com
....
But same situation.

Any other suggestion??

In Reply To:
You don't have a header printed anywhere? Try this near the top of the script....


print "Content-type: text/html \n\n";

...without a header, it doesn't matter how good the script is.. it won't run :p

Cheers
Quote Reply
Re: [wendelin] Can't locate Extropia/Core/App/DBApp.pm In reply to
Hi,

You are missing this file: Extropia/Core/App/DBApp.pm. Make sure it exists, and it's permissions are set properly.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Can't locate Extropia/Core/App/DBApp.pm In reply to
It is actually there, and when I had the whole application running just as the same package it was running fine. By the way, the same problem occurs also with all other Perl scripts on that new server.

What now?

:-)

Wendelin
Quote Reply
Re: [wendelin] Can't locate Extropia/Core/App/DBApp.pm In reply to
Try adding at the top:

use lib '/full/path/to/directory';

where it's the full path to the directory that contains the Extropia directory.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Can't locate Extropia/Core/App/DBApp.pm In reply to
I have added this line to my code, but the result remains frustrating:

use strict;
BEGIN{
use vars qw(@dirs);
@dirs = qw(Modules
Modules/CPAN .);
}
Code:
use lib '/Extropia/Core/App';
use lib @dirs;
# The following is only of interest to mod_perl, PerlEx,
# and other Perl acceleration users
unshift @INC, @dirs if $ENV{MOD_PERL};
...
Code:

same result....

the file itself is attached...

any more idea??