...
com.octo.captcha.CaptchaException: java.lang.InternalError: Can"t connect to X11
window server using ":0.0" as the value of the DISPLAY variable.
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.
The captcha team (in fact mathieu) had a thought about this and designed a
ToolkitFactory helper class.
it It provides a way to avoid the installation of a xserver. This trick is documented
in the javadoc.
Extract:
Code Block | ||
---|---|---|
| ||
/** * Description: This Factory is used in order to switch from the * java.awt.Toolkit component to other implementation like <a [href="http://www.eteks.com/pja/en/">PJA Toolkit]Toolkit</a>. By default this factory * 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 to * your virtual machine <code>-Dtoolkit.implementation=com.eteks.awt.PJAToolkit</code>, the * factory returns an implementation of com.eteks.awt.PJAToolkit */ |
...