Date: Fri, 29 Mar 2024 12:30:35 +0000 (UTC) Message-ID: <1485845993.27.1711715435930@ecf6ae09e6d6> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_26_124652972.1711715435930" ------=_Part_26_124652972.1711715435930 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Current image captchas tests are not very accessible, and this is a majo=
r concern for us.
There is currently no consensus around this issue, but some solutions are =
rising.
See :
Question :
Argh! :
com.octo.captcha.CaptchaException: java.lang.InternalError: Can"t connec=
t to X11 window server using ":0.0" as the value of the DISPLAY variable.
Or
java.awt.HeadlessException:
No X11 DISPLAY variable was
set, but this program performed an operation which requires it.
Answer :
You have correcly find out what is wrong : by default, you need a XServer =
to use jcaptcha. the java Toolkit use it to build images.
First of all if jcaptcha running on a 1.4 or higher JDK be sure you run = your jvm with the:
-Djava.= awt.headless=3Dtrue=20
option.
This should solve the problem.
Otherwise,
The captcha team (in fact mathieu) had a thought about this and designed a=
ToolkitFactory helper class.
It provides a way to avoid the installation of a xserver. This trick is do=
cumented
in the javadoc.
Extract:
/** * Description: This Factory is used in order to switch from the * java.awt.Toolkit component to other implementation like <a href=3D"ht= tp://www.eteks.com/pja/en/">PJA Toolkit</a>. By default this facto= ry * return the java.awt.Toolkit object. But if the the parameter * <code>toolkit.implementation</code> is fixed as a parameter = of the virtual machine with * the value of the class name of another implementation of Toolkit, this * factory return an implementation of this class. For exemple if you set t= o * your virtual machine <code>-Dtoolkit.implementation=3Dcom.eteks.aw= t.PJAToolkit</code>, the * factory returns an implementation of com.eteks.awt.PJAToolkit */
See also :
Image generation is a very heavy process : it cost a lot of CPU and RAM.=
A particular attention has been given to performance in the devellopement =
and test process of JCaptcha.
In order to achieve transparency on this subject, the framework is heavily=
load tested, and tests results are provided in the source distribution.
The tests are currently run on various plateforms including wintel, linux,=
and sparc/ux.
We encourage you to run and publish the load tests on your own production =
platform...
Load tests concerns :
jcaptc= ha.load.test.exclude=3D**/*LoadTest*.*
The jcaptcha service provide some jmx facilities.
A manageable service provides :
TODO : refactor the FAQ