Hi,
I am building a linkd data service within docker container based on jetty:alpine. I need to build custom view so I am trying to use Velocity renderer. I have constant problems with launching Velocity.
The application is launched in the following contexts:
- resource/
- elda-assets/
Is seems there is a hidden configuration because I cannot find anything about that path. Or it is taken from _velicityPath.
The error message is:
real path for /_error_pages//velocity/
The log looks like:
adalab-elda_1 | 2016-11-16 14:59:25,183 WARN [qtp2143192188-12] (VelocityRendering.java:129) - [1]: problem: real path for /_error_pages//velocity/ is null. (java.lang.RuntimeException: problem: real path for /_error_pages//velocity/ is null.)
adalab-elda_1 | 2016-11-16 14:59:25,184 ERROR [qtp2143192188-12] (RouterRestlet.java:602) - [1]: Error while sending response: 'com.epimorphics.lda.exceptions.VelocityRenderingException'
adalab-elda_1 | com.epimorphics.lda.exceptions.VelocityRenderingException
adalab-elda_1 | at com.epimorphics.lda.renderers.velocity.VelocityRendering.writeAll(VelocityRendering.java:130)
adalab-elda_1 | at com.epimorphics.lda.restlets.RouterRestlet$2.write(RouterRestlet.java:598)
adalab-elda_1 | at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:71)
adalab-elda_1 | at com.sun.jersey.core.impl.provider.entity.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:57)
adalab-elda_1 | at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:302)
adalab-elda_1 | at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1510)
adalab-elda_1 | at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
adalab-elda_1 | at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)
adalab-elda_1 | at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)
adalab-elda_1 | at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)
adalab-elda_1 | at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:927)
adalab-elda_1 | at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:875)
adalab-elda_1 | at com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:829)
adalab-elda_1 | at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
adalab-elda_1 | at com.epimorphics.lda.support.LogRequestFilter.doFilter(LogRequestFilter.java:74)
adalab-elda_1 | at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1668)
<< CUT >>
The steps I did before launching are:
1. unpack both (elda-assets, elda-comon) war files and copy:
- elda-assets/velocity into /tmp/static
- elda-common/_error_pages/ into /tmp/static
In the documentation I found that _velocityPath needs to have absolute
path to resources on the disk. That why I extracted velocity data.
2. Add following settings:
[] a api:API;
.... <cut>
; api:defaultFormatter resource:VelocityFormatter
; api:variable [ api:name "_exceptionIfEmpty"
; api:value "no" ] ,
[ api:name "_velocityPath" ;
api:value "/tmp/static/velocity, /tmp/static/_error_pages/velocity, elda-assets/velocity/"] ,
[ api:name "_resourceRoot"
; api:value "/elda-assets/" ] ,
[ api:name "_suppress_ipto"
; api:value "yes" ] # Suppress isPrimaryTopicOf
resource:Velocityformatter has just basic content:
resource:VelocityFormatter a elda:VelocityFormatter
; api:name "html"
; api:mimeType "text/html; charset=utf-8"
; elda:className "com.epimorphics.lda.renderers.VelocityRendererFactory"
.