Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Jfreechart cannot be displayed under Unix

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

The JFreechart part runs well under the local windows+tomcat, but after the unix+tomcat is put on the server, the chart and picture cannot be displayed normally, the picture shows a red fork, and the text on the picture cannot be displayed.

After searching for many related questions on the Internet, we finally found the root cause of the problem:

When java implements the drawing function on the * unix platform, it relies on the operating system XServer for drawing. Cannot be called when started from the terminal interface.

The detailed explanation and solution are as follows:

Http://qjmouse.javaeye.com/blog/296092

The system uses jfreechart to draw pictures, and there are problems in some * unix systems. The solutions are as follows. Other similar problems can also be solved by reference.

1. The graph cannot be displayed. The exception is: Can't connect to X11 window server using': 0.0' as

The value of the DISPLAY variable.

Reason: when java implements the drawing function on the * unix platform, it relies on the operating system XServer for drawing. Cannot be called when started from the terminal interface.

Solution: use java's headles mode without invoking operating system local resources.

Configuration: go to was console > Server > Application Server > servername > process definition >

Java virtual machine, setting the generic JVM argument to

"- Djava.awt.headless=true", restart WAS.

two。 You can draw, but it appears as a square in Chinese.

Reason: jdk uses the English font.properties description file by default

Solution: replace the font description file with the Chinese version and enter the lib directory where WAS uses JRE, such as / opt/IBM/WebSphere/AppServer/java/jre

/ lib, back up the original font.properties, rename font.properties.zh to font.properties, and restart WAS.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report