Highcharts-Export Server 2.0.1 Errors Under Windows

前端 未结 2 707
一整个雨季
一整个雨季 2021-01-27 11:03

EDIT: Solution was to place all phatomJS related scripts into the Scripts directory and make sure none of the items are read-only for Windows. My scripts and ph

相关标签:
2条回答
  • 2021-01-27 11:38

    Your first example above indicates you are configuring to point at jetty 9.0.0.M3 (9.0.3.v20130506 is latest) but your second example shows you using the jetty-maven-plugin 8.1.2 (8.1.10.v20130312 is the latest) which does not make use of any jetty distribution, it uses an embedded instance of jetty that it wires up and starts via the maven plugin.

    You need to decide how you are going to run jetty, either via a distribution (your first example) or via the maven plugin (org.eclipse.jetty:jetty-maven-plugin:9.0.3.v20130506 is probably one you should use) and configure your 'exec =' property accordingly.

    0 讨论(0)
  • 2021-01-27 11:40

    You're getting a Beancreation exception because the @PostConstruct afterBeanInit method is failing.

    When you leave the 'script' property in the app.properties file empty, it tries to load the highcharts-convert file with the ClassLoader. See here.

    As stated in the app.properties file, this is only tested in Tomcat. Clearly this isn't working out of the box for Jetty. Perhaps, because the ClassLoader is different, or maybe you have to deploy the application as an exploded war?

    But the easy way, is to specify the 'script' property in the app.properties file. Note that the mandatory files used by the highcharts-convert.js script must also be present in the same folder.

    Code Sample of the property file, used by me under windows with Jetty.

    #### 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 = phantomjs
    
    # location of convert script used by phantomjs, optional to leave the script property    empty, than it's using the script located in: /WEB-INF/phantomjs/highcharts-convert.js. This is tested in TOMCAT, but specify a path if resource loading isn't working with the classloader (f.e. with Jetty server), script = a/path/to/my/phantomjs-script.js
    script = C:/Users/gert/SRC/highcharts.com/exporting-server/java/highcharts-export/target/highcharts-export/WEB-INF/phantomjs/highcharts-convert.js
    

    After I changed the app.properties file, I build the war with mvn clean package

    and copied the war file to the Jetty webapps folder. and it worked.

    0 讨论(0)
提交回复
热议问题