Avoid HeadlessException when running JSF TGO component on headless environment

Article ID: 2503
Last updated: 29 May, 2018
Article ID: 2503
Last updated: 29 May, 2018
Revision: 3
Views: 727
Posted: 14 Aug, 2012
by Dean J.
Updated: 29 May, 2018
by Gargani A.

Problem(Abstract)

How to avoid HeadlessException when running JSF TGO component on headless environment?

Resolving the problem

When running your JSF JTGO application on headless environment, you must pay particular attention to not call any Swing component, which needs a display, otherwise you will get a java.awt.HeadlessException.

In particular, you should not use interactors such as IlvSelectInteractor, IlvPanInteractor or IlvZoomInteractor, but rather declare them in your JSP page using

the jvf:XXXInteractor tags, where XXX is select, pan, or zoom

.

Furthermore, the default toolbar that is being rendered by the ilog.cpl.network.renderer.IlpToolBarRenderer and ilog.cpl.equipment.renderer.IlpToolBarRenderer which contains Swing buttons should not be used. You can remove it by customizing your CSS file as follows:

Finally, the IlpNetwork and IlpEquipment components set a default style sheet, defined under IlpNetwork.DefaultConfigurationFileName property and IlpEquipment.DefaultConfigurationFileName property respectively, when you try to instanciate an IlpNetwork or an IlpEquipment without specifying a style sheet. This will automatically create a toolbar for the component. To avoid the creation of the toolbar by default, you should use the following constructor to create the IlpNetwork and IlpEquipment objects:

IlpNetwork component =

new IlpNetwork("network.css");

IlpEquipment component2 =

new IlpEquipment("equipment.css");

This article was:   Helpful | Not helpful
Report an issue
Article ID: 2503
Last updated: 29 May, 2018
Revision: 3
Views: 727
Posted: 14 Aug, 2012 by Dean J.
Updated: 29 May, 2018 by Gargani A.
Also listed in


Others in this category