Hi,

I've been trying to include some java-code in an existing Catalyst app, 
which has caused me some trouble.  I've tracked it down to a simple mod_perl
issue, the reason for which escapes me.

The following module, based on the documentation example:
-----------LBR.pm------------------------------------------
package LBR;

use Apache2::RequestRec ();
use Apache2::RequestIO  ();
use Apache2::Const;

use Inline (
    Java => <<'END',
    public class JAxH {
        private String myx;
        public JAxH(String x) {
            myx = x;
        }
        public String foo() {
            return "Just Another " + myx + " Hacker";
        }
    }
END
    DEBUG => 0,
    AUTOSTUDY => 1,
    SHARED_JVM => 1,
    START_JVM => 1,
    DIRECTORY => '/tmp/inline',
    PACKAGE => 'main',
);

sub handler {
    my $r = shift;
    my $j = new JAxH('Inline') ;
    $r->content_type("text/html");
    $r->print("<html><body>", $j->foo(), "</body></html>");
    return Apache2::Const::OK;
}

1;
------------------------------------------------------------

Configured with the following httpd.conf snippet:
------------------------------------------------------------
<VirtualHost *:80>
    ServerName aberlour.balker.dk
    DocumentRoot /home/lbr/www  

    <Location />
       SetHandler modperl
       PerlResponseHandler LBR
    </Location>
</VirtualHost>
------------------------------------------------------------

This works.  But if I add "PerlLoadModule LBR" to the VirtualHost, the httpd
doesn't come back up after the second restart (it often works the first
time!)

Software versions:
FreeBSD 6.0
perl-5.8.7_2        Practical Extraction and Report Language
apache-2.2.0_5      Version 2.2 of Apache web server with prefork MPM.
mod_perl2-2.0.2,3   Embeds a Perl interpreter in the Apache2 server
jdk-1.5.0p2_3       Java Development Kit 1.5.0
p5-Inline-0.44      Write Perl subroutines in other programming languages
p5-Inline-Java-0.50.91 Write Perl subroutines and classes in Java

Rest of the configuration is fairly standard - I haven't changed the Apache
MPM or anything.

Any ideas?  I'd really hate not using PerlLoadModule on production systems.
-- 
Lars Balker Rasmussen                                        Consult::Perl

Reply via email to