我正在使用新的基于Java的导出服务器通过向服务器发送POST请求将输入JSON转换为SVG。highcharts导出 - Java方法
最初我通过运行jetty在本地机器上做了一些测试,我能够发送POST请求到localhost:8080/export并取回SVG。
我现在已经构建了was文件并已将其部署到Tomcat服务器上,导出服务器正在端口8080上运行。我可以调出演示页面(http://:8080/highcharts-export-web) ,但是当我点击“生成图像”或通过客户端发送POST请求时,我看到msg“对不起,服务器正在处理太多请求,请重试。”
我试着远程调试,发现Java中有一个Pool异常,如果我做错了任何事,请让我知道。下面是我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/bin/phantomjs
# name of the convert script used by phantomjs
script = highcharts-convert.js
#### 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 = 6000
# timeout to be used when opening a communications link to the phantomjs server
connectTimeout = 500
# 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 = 6500
#### Pool properties ####
# number of phantomjs servers you can run in the pool.
poolSize = 2
# 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 = 500
我想通了,phantomJS运行不正常。我在CentOS上运行服务器并将phantomJS复制到/ usr/local/bin,但在CentOS上这样做是不够的,您必须安装2个额外的软件包。我做了sudo yum安装freetype和sudo yum安装fontconfig和viola它开始工作。 – user2317558
嗨,很高兴听到你得到它的工作! –