in reply to Inline::Java stopped working

I was seeing the same message when attempting to use Inline::Java within a thread with a shared JVM i.e. SHARED_JVM => 1. The program actually worked fine, it was generating the warning either after a threads::join() or if using threads::detach() at the end of program. The solution ended up being an explicit call to Inline::Java::done() at the end of each thread. Each thread had to also start with a call to Inline::Java::reconnect_JVM().

Replies are listed 'Best First'.
Re^2: Inline::Java stopped working
by zamubal (Initiate) on Nov 17, 2015 at 15:13 UTC
    I am having the same issues. I can't figure out where to place the Inline::Java::done() call. Can someone provide some guidance on this? Here is my Perl script.
    package MY::PACKAGE; # Add the Jar file path to the CLASSPATH environment variable BEGIN { $ENV{CLASSPATH} .= ":/drive1/myjavaclass.jar"; } # Called the Java class(es) that will be used by Perl # The DIRECTORY variable should have a location where contents can be + write to use Inline ( Java => 'STUDY', STUDY => ['MyJavaClass'], AUTOSTUDY => 1, DIRECTORY => '/drive1/' ); # Used to make the PM file available in a CGI environment my $q = new CGI(); # Define the new method establishing a connection to the Java class c +onstructor sub new { my $class = shift; my $obj = MY::PACKAGE::MyJavaClass->new(); return $obj; } 1;
      Nowhere, the code you posted doesn't use threads