CNI from apache module

Lars Andersen lars@jatak.com
Mon Feb 18 10:08:00 GMT 2002


The news section mentions that it is possible to interface an apache module to java thru CNI (I guess?).

I have tried the same thing :

In the module initializer I initiate the VM :

JvCreateJavaVM (NULL);


And in the request handler the java-code is called

JvAttachCurrentThread (NULL, NULL);
< CNI calls >
JvDetachCurrentThread ();


Everything compiles and links nicely, but apache crashes upon initializing the Java VM.
The same code works when linked as a stand-alone app.

I suspect JvCreateJavaVM (NULL); should be placed somewhere else, in the apache server startup perhaps?

Regards

Lars Andersen






More information about the Java mailing list