我正在使用新的基于 Java 的导出服务器通过向服务器发送 POST 请求将输入 JSON 转换为 SVG。
最初,我通过运行 jetty 在本地机器上进行了一些测试,我能够向 localhost:8080/export 发送 POST 请求并取回 SVG。
我现在已经构建了 was 文件并将其部署在 Tomcat 服务器上,导出服务器在端口 8080 上运行。我可以打开演示页面 (http://:8080/highcharts-export-web),但是当我单击“生成图像”或通过客户端发送 POST 请求我看到一条消息“抱歉,服务器目前正在处理太多请求。请重试。”
我尝试远程调试并在 Java 中看到池异常,如果我做错了什么,请告诉我。下面是我的 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