Why the error:

I managed to break the working BeerDB example by preloading my Maypole application class. If seems to work better if the class is loaded in each thread at first invocation. This works for setting the correct include lib with a PerlRequire in the httpd.conf:

use File::Basename; use lib dirname(__FILE__); #use BeerDB; 1; __END__

If I don't pre-load it, there is no output in the error log for warnings. Maybe this is the way Apache2 with threads is supposed to work. Maybe the threads in Apache2 + mod_perl 2 isn't very compatible yet. Maybe it's the usual caveats that go with using Perl threads. It make sense to have each thread keep it's own set of objects for everything, as similar to forking as possible.

If this still would turn out to not work, it would be a bit of a downer becuase the nice promise of Apache2 was that it would work fine on Windows. It's not that I'd want to deploy it on Windows, but for development it would be convenient.

Anyway, this messed up a lot of things, but I could not see at all what was wrong because I got the bogus 404 message.

Why no error message:

The root cause is that the TT process() doesn't work in my setup for some reason that broke with the threads thing (beer/list not found), and there is no way to see this, anywhere.

Lots of debug output pinpointed this to the fact that View::Maypole::Base::error() thinks there can't be a template error if there are no $r->{objects}.

# This is a rough test to see whether or not we're a template +or # a static page return -1 unless @{ $r->{objects} || [] };

I'm not sure what's supposed to happen to not get a 404 if there are no objects, but that's what I get now. A 500 Internal Server Error would seem to be more appropriate, although perhaps uglier.

/J


In reply to Re: Maypole::CLI works, but Apache says 404 (solved, kinda) by jplindstrom
in thread Maypole::CLI works, but Apache says 404 by jplindstrom

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.