java - Highcharts-Export Server 2.0.1 Errors Under Windows -
edit: solution place phatomjs related scripts scripts directory , make sure none of items read-only windows. scripts , phantomjs.exe exist here: c:\jetty-distribution-9.0.0.m3\webapps\root\scripts\phantomjs
.
the app.properties
file has config:
# location of phantomjs executable, example /usr/local/bin/phantomjs exec = c:/jetty-distribution-9.0.0.m3/webapps/root/scripts/phantomjs/phantomjs.exe # location of convert script used phantomjs, optional leave script property empty, it's using script located in: /web-inf/phantomjs/highcharts-convert.js. tested in tomcat, specify path if resource loading isn't working classloader (f.e. jetty server), script = a/path/to/my/phantomjs-script.js script = c:/jetty-distribution-9.0.0.m3/webapps/root/scripts/phantomjs/highcharts-convert.js
i can export via demo loaded here http://localhost:8080/highcharts-export/demo
, call via our web site using url: 'http://localhost:8080/highcharts-export/'
edit: has got working app.properties file working under windows , jetty?
i have resolved of these issues listed below making modification app.properties:
# location of phantomjs executable, example /usr/local/bin/phantomjs exec = "c:\\jetty-distribution-9.0.0.m3\\webapps\\root\\scripts\\phantomjs\\phantomjs.exe" # location of convert script used phantomjs, optional leave script property empty, it's using script located in: /web-inf/phantomjs/highcharts-convert.js. tested in tomcat, specify path if resource loading isn't working classloader (f.e. jetty server), script = a/path/to/my/phantomjs-script.js script = /web-inf/phantomjs/highcharts-convert.js
other variants of exec
value same results:
c:\\jetty-distribution-9.0.0.m3\\webapps\\root\\scripts\\phantomjs\\phantomjs.exe c:/jetty-distribution-9.0.0.m3/webapps/root/scripts/phantomjs/phantomjs.exe c:\jetty-distribution-9.0.0.m3\webapps\root\scripts\phantomjs\phantomjs.exe
i can demo @ http://localhost:8080/highcharts-export/demo
butlooking @ output of jetty flooded things like:
[error] [pool-1-thread-1 02:55:19] (taskutils.java:handleerror:95) unexpected error occurred in sche duled task. java.lang.runtimeexception: error, phantomjs couldnot start @ com.highcharts.export.server.server.<init>(server.java:56) @ com.highcharts.export.pool.serverobjectfactory.create(serverobjectfactory.java:36) @ com.highcharts.export.pool.serverobjectfactory.create(serverobjectfactory.java:14) @ com.highcharts.export.pool.abstractpool.createobject(abstractpool.java:26) @ com.highcharts.export.pool.abstractpool.poolcleaner(abstractpool.java:66) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ org.springframework.scheduling.support.scheduledmethodrunnable.run(scheduledmethodrunnabl e.java:64) @ org.springframework.scheduling.support.delegatingerrorhandlingrunnable.run(delegatingerro rhandlingrunnable.java:53) @ java.util.concurrent.executors$runnableadapter.call(unknown source) @ java.util.concurrent.futuretask$sync.innerrunandreset(unknown source) @ java.util.concurrent.futuretask.runandreset(unknown source) @ java.util.concurrent.scheduledthreadpoolexecutor$scheduledfuturetask.access$301(unknown s ource) @ java.util.concurrent.scheduledthreadpoolexecutor$scheduledfuturetask.run(unknown source) @ java.util.concurrent.threadpoolexecutor.runworker(unknown source) @ java.util.concurrent.threadpoolexecutor$worker.run(unknown source) @ java.lang.thread.run(unknown source)
original question below: follow this question. can (according maven @ least) build latest highcharts-export server. have modified app.properties file this:
# location of phantomjs executable, example /usr/local/bin/phantomjs exec = c:/jetty-distribution-9.0.0.m3/webapps/root/scripts/phantomjs
regardless of configuration location of phatomjs error listed below.
however, when load jetty following error , unable work around this.
c:\hc-exporter>mvn jetty:run [info] scanning projects... [warning] [warning] problems encountered while building effective model com.highcharts.expor t:highcharts-export:war:2.0.1 [warning] 'build.plugins.plugin.version' org.apache.maven.plugins:maven-eclipse-plugin missin g. @ line 150, column 12 [warning] [warning] highly recommended fix these problems because threaten stability of build. [warning] [warning] reason, future maven versions might no longer support building such malformed pro jects. [warning] [info] [info] ------------------------------------------------------------------------ [info] building highcharts-export 2.0.1 [info] ------------------------------------------------------------------------ [info] [info] >>> jetty-maven-plugin:8.1.2.v20120308:run (default-cli) @ highcharts-export >>> [info] [info] --- maven-resources-plugin:2.5:resources (default-resources) @ highcharts-export --- [debug] execute contextualize [info] using 'utf-8' encoding copy filtered resources. [info] copying 2 resources [info] [info] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ highcharts-export --- [info] nothing compile - classes date [info] [info] --- maven-resources-plugin:2.5:testresources (default-testresources) @ highcharts-export --- [debug] execute contextualize [info] using 'utf-8' encoding copy filtered resources. [info] skip non existing resourcedirectory c:\hc-exporter\src\test\resources [info] [info] --- maven-compiler-plugin:2.5.1:testcompile (default-testcompile) @ highcharts-export --- [info] no sources compile [info] [info] <<< jetty-maven-plugin:8.1.2.v20120308:run (default-cli) @ highcharts-export <<< [info] [info] --- jetty-maven-plugin:8.1.2.v20120308:run (default-cli) @ highcharts-export --- [info] configuring jetty project: highcharts-export [info] webappsourcedirectory c:\hc-exporter\src\main\webapp not exist. defaulting c:\hc-expo rter\src\main\webapp [info] reload mechanic: manual [info] classes = c:\hc-exporter\target\classes [info] added scan target:c:\hc-exporter\src\main\webapp\web-inf\pages [info] added scan target:c:\hc-exporter\src\main\webapp\resources [info] context path = /export [info] tmp directory = c:\hc-exporter\target\tmp [info] web defaults = org/eclipse/jetty/webapp/webdefault.xml [info] web overrides = none [info] web.xml file = file:/c:/hc-exporter/src/main/webapp/web-inf/web.xml [info] webapp directory = c:\hc-exporter\src\main\webapp 2013-05-21 09:00:07.656:info:oejs.server:jetty-8.1.2.v20120308 2013-05-21 09:00:07.987:info:oejpw.plusconfiguration:no transaction manager found - if webapp r equires one, please configure one. 2013-05-21 09:00:09.162:info:/export:no spring webapplicationinitializer types detected on classpath 2013-05-21 09:00:09.477:info:oejsh.contexthandler:started o.m.j.p.jettywebappcontext{/export,file:/c :/hc-exporter/src/main/webapp/},file:/c:/hc-exporter/src/main/webapp/ 2013-05-21 09:00:09.478:info:oejsh.contexthandler:started o.m.j.p.jettywebappcontext{/export,file:/c :/hc-exporter/src/main/webapp/},file:/c:/hc-exporter/src/main/webapp/ 2013-05-21 09:00:09.482:info:oejsh.contexthandler:started o.m.j.p.jettywebappcontext{/export,file:/c :/hc-exporter/src/main/webapp/},file:/c:/hc-exporter/src/main/webapp/ 2013-05-21 09:00:09.532:info:/export:initializing spring root webapplicationcontext [error] [main 09:00:10] (contextloader.java:initwebapplicationcontext:307) context initialization fa iled org.springframework.beans.factory.beancreationexception: error creating bean name 'serverobject factory': invocation of init method failed; nested exception java.lang.nullpointerexception at...
you're getting beancreation exception because @postconstruct afterbeaninit method failing.
when leave 'script' property in app.properties file empty, tries load highcharts-convert file classloader. see here.
as stated in app.properties file, tested in tomcat. isn't working out of box jetty. perhaps, because classloader different, or maybe have deploy application exploded war?
but easy way, specify 'script' property in app.properties file. note mandatory files used highcharts-convert.js script must present in same folder.
code sample of property file, used me under windows jetty.
#### phantomjs properties #### # host , port phantomjs listens host = 127.0.0.1 port = 7777 # location of phantomjs executable, example /usr/local/bin/phantomjs exec = phantomjs # location of convert script used phantomjs, optional leave script property empty, it's using script located in: /web-inf/phantomjs/highcharts-convert.js. tested in tomcat, specify path if resource loading isn't working classloader (f.e. 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 changed app.properties file, build war mvn clean package
and copied war file jetty webapps folder. , worked.
Comments
Post a Comment