note 40421 deleted from ref.java by sobak
| From: | sobak@php.net | Date: | Sun, 04 Dec 2016 07:07:02 +0000 |
| Subject: | note 40421 deleted from ref.java by sobak | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-207979@lists.php.net to get a copy of this message | ||
Note Submitter: a9702466 at gmx dot net
----
The Java Servlet SAPI works fine in a non-threading
environment. If you want to use threads (normal case) you
have to do several things to get it work:
- get the patched files from
http://www.pelikan-it.com/download.html
- replace the sapi/servlet/servlet.java and
sapi/servlet/servlet.c file by the patched files
- build the php like this
./configure --with-tsrm-pthreads \
--with-servlet=/opt/resin --with-java=/opt/java \
--prefix=/opt/php-4.3.4
The primary problem is, that the request and response
objects are stored as global instance-variables of the servlet
which will be overwritten by other threads invoking the
servlet (remember: just on servlet-object for all threads!) and
all crashes. I changed the servlet to pass the request and
response objects to the java- and native-methods (where
required) to prevent the problem.
Once you have solved this problem it works fine and needs
unlike the java-extension just one jvm.