Considerations and limitations for WebSphere Application Server Liberty Profile
When using Debug on server to test your application, a display issue might occur on the terminal window. You might receive the following error message:
ERROR HPS5018 An unexpected exception has occurred.
Frame unable to display: java.awt.HeadlessException.
If this error occurs in the console, you can fix this problem by following these steps.
- In the ZIETrans Projects view, open the Servers tab.
- Right-click on the WebSphere Application Server Liberty Profile server listed and click on New > Server Environment File > jvm.options.
- Add the value to the file:
-Djava.awt.headless=false
- Save and close the jvm.options file.
- Restart the server to activate the changes.
Liberty Web Profile-8:
Issue:
ZIETrans REST API deployed in liberty web profile - 8 having JAX-RS 2.1 feature which results in incorrect json output or the variable which must be ignored is also added to json response.
Reason:
Liberty JAX-RS 2.1 uses JSON-B to serialize and de-serialize JSON to objects, but JAX-RS 2.0 uses Jackson.
Resolution:
In ZIETrans REST API generated Input_Properties and Output_Properties java files.
- Change @JsonIgnore to @JsonbTransient and @jsonproperty to @jsonbproperty of JSON-B library.
- Add ‘import javax.json.bind.annotation.JsonbProperty import javax.json.bind.annotation.JsonbTransient’.
If the user writes any custom code, annotations used must be JSON-B annotations.
ZIETrans REST API generated Input_Properties and Output_Properties java files are in “Project_Name\Java Source\restfulserviceclasses”.