Highcharts - 导出服务器不生成图像

时间:2016-01-29 10:41:42

标签: highcharts server export highstock

我已按照http://www.highcharts.com/docs/export-module/setting-up-the-server中提到的所有步骤为highcharts设置了导出服务器。

我的测试环境是Windows服务器,tomcat 8.0.30,Phantom 2.0和Java 1.8.0_71。在mvn install和mvn clean包期间没有问题,我的应用程序已成功部署。

导出服务器URL为:http://localhost:9090/highcharts-export-web/并且highcharts导出服务器页面打开正常但是当我点击"预览"按钮,我得到"内部服务器错误"。当我查看tomcat日志时,我看到以下错误:

[ERROR] [http-nio-9090-exec-4 01:35:42](SVGConverter.java:requestServer:136)ja va.net.SocketTimeoutException:读取超时

当我查看任务管理器时,大约有15个PhantomJS.exe实例正在运行。另外,我只能在C:\ tomcat \ webapps \ highcharts-export-web \ resources \ js目录中看到两个文件。这些是codemirror-compressed.js和jquery-1.11.0.min.js。好像所有的js文件都被压缩了。下面是我的app-convert.properties文件:



#### phantomjs properties ####

# the host and port phantomjs listens to
host = 127.0.0.1
port = 7777

# location of the phantomjs executable, could be for example /usr/local/bin/phantomjs
#exec = /usr/local/bin/phantomjs
exec = C:\\phantomjs-2.0.0-windows\\bin\\phantomjs.exe

# specify here an alternative location (the whole path!) for the script that starts an Phantomjs server. F.eks /home/bert/scripts/my-highcharts-convert.js
# Leave empty if you're using the script bundled with the export-server.
script =

#### connect properties used to connect with phantomjs running as HTTP-server ####
# all values in milliseconds

# specifies the timeout when reading from phantomjs when a connection is established
readTimeout = 60000

# timeout to be used when opening a communications link to the phantomjs server
connectTimeout = 10000

# the whole request to the phantomjs server is scheduled, max timeout can last to this value. This is because in java you can't rely on the above two timeouts.
maxTimeout = 65000

#### Pool properties ####

# number of phantomjs servers you can run in the pool.
poolSize = 10

# The pool is implemented as a BlockingQueue. When asking for a phantom server connection and nothing is available, it waits for the number of milliseconds defined by maxWait
maxWait = 6000

# Keep files in the temp folder for a certain retentionTime, defined in miliseconds
retentionTime = 60000




1 个答案:

答案 0 :(得分:0)

将Highcharts导出服务器移动到单独的GitHub存储库后,您必须在部署之前将Highcharts javascript文件复制到导出服务器项目

将highcharts.js,highcharts-more.js,funnel.js(如果要导出漏斗图表)等文件复制到文件夹highcharts-export-convert/src/main/resources/phantomjs

另请阅读:第2.3段。 COPY HIGHCHARTS JS TO THE MAVEN CONVERT MODULE