|
From: Jason P. <jas...@gm...> - 2008-08-05 06:22:15
|
I am not entirely sure if this is your problem, but I have seen
similar errors in the past with some of my data. Freemarker does not
like NULLs sometimes, so it would be beter practice to explicitly
define cases to handle NULL values in the database, which it seems to
be the basis of this error. I use something like..
if len($feature.name.value) = 0 then
..(Do whatever process is necessary for null values such as
substituting "No infomaiton available") for the NULLs...
else
...(This will handle non-null values)
end
This is a bit of a script kiddy way to do this, and there are perhaps
better ways to test for NULL values, but these types of structures
work for me.
The strange thing is that the $feature.name.value property is not
inclued in the freemarker template you show below. Anyway, as a first
start, check the NULL values and be sure there are none, and if there
are, then define cases to deal with them.
Hope this helps.
On Fri, Aug 1, 2008 at 3:37 AM, chris1211 <ch...@po...> wrote:
>
> I upgraded to the latest stable geoserver now im getting a error
> Exp: Expression feature.name is undefined on line 17, column 15 in
> content.ftl. The problematic instruction: ---------- ==>
> ${feature.name.value} [on line 17, column 13 in content.ftl] ---------- Java
> backtrace for programmers: ----------
> freemarker.core.InvalidReferenceException: Expression feature.name is
> undefined on line 17, column 15 in content.ftl. at
> freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124) at
> freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:134)
> at freemarker.core.Dot._getAsTemplateModel(Dot.java:78) at
> freemarker.core.Expression.getAsTemplateModel(Expression.java:89) at
> freemarker.core.Expression.getStringValue(Expression.java:93) at
> freemarker.core.DollarVariable.accept(DollarVariable.java:76) at
> freemarker.core.Environment.visit(Environment.java:196) at
> freemarker.core.MixedContent.accept(MixedContent.java:92) at
> freemarker.core.Environment.visit(Environment.java:196) at
> freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:160) at
> freemarker.core.Environment.visit(Environment.java:351) at
> freemarker.core.IteratorBlock.accept(IteratorBlock.java:95) at
> freemarker.core.Environment.visit(Environment.java:196) at
> freemarker.core.MixedContent.accept(MixedContent.java:92) at
> freemarker.core.Environment.visit(Environment.java:196) at
> freemarker.core.Environment.process(Environment.java:176) at
> freemarker.template.Template.process(Template.java:232) at
> org.vfny.geoserver.wms.responses.featureInfo.HTMLTableFeatureInfoResponse.writeTo(HTMLTableFeatureInfoResponse.java:112)
> at
> org.vfny.geoserver.wms.responses.GetFeatureInfoResponse.writeTo(GetFeatureInfoResponse.java:175)
> at org.geoserver.ows.adapters.ResponseAdapter.write(ResponseAdapter.java:60)
> at org.geoserver.ows.Dispatcher.response(Dispatcher.java:629) at
> org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:192) at
> org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:139)
> at
> org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
> at
> org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:684)
> at
> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625)
> at
> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:392)
> at
> org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:347)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at
> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:459) at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1054)
> at
> org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
> at
> org.geoserver.filters.ReverseProxyFilter.doFilter(ReverseProxyFilter.java:170)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
> at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:73) at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
> at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:41) at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
> at
> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
> at
> org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
> at
> org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
> at
> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
> at
> org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
> at
> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
> at
> org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
> at
> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
> at
> org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:178)
> at
> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
> at
> org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:229)
> at
> org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
> at
> org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
> at
> org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
> at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
> at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:358)
> at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:231)
> at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:629)
> at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:453) at
> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:149)
> at
> org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:123)
> at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
> at org.mortbay.jetty.Server.handle(Server.java:303) at
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:452) at
> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:721)
> at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:509) at
> org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209) at
> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:349) at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:320)
> at
> org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
> java.io.IOException: Error occured processing content template content.ftl
> for topp:NQA_N0R_0 Error occured processing content template content.ftl for
> topp:NQA_N0R_0 Expression feature.name is undefined on line 17, column 15 in
> content.ftl.
>
> content.ftl is
>
> <style type="text/css">
> <!--
> .svrthund {
> color: #000000;
> font-weight: bold;
> }
> -->
> </style>
> <table width="100%" border="1" bgcolor="#ffffff">
> <tr bgcolor="#FFFF00">
> <td width="229">Thunderstorm Warnings</td>
> <td width="185"><div align="center" >WFO</div></td>
> <td width="548"><div align="center" >Statement Link (New
> Window)</div></td>
> </tr>
> <#list features as feature>
> <tr>
> <td>Exp:${feature.expire.value}</td>
> <td>${feature.wfo.value}</td>
> <td> javascript:; Click to View Statement in New Window </td>
> </tr>
> </#list>
> </table>
>
> any idea's? this is happening on different layers
> --
> View this message in context: http://www.nabble.com/Freemarker-template-error-and-log-tp18766708p18766708.html
> Sent from the GeoServer - User mailing list archive at Nabble.com.
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Geoserver-users mailing list
> Geo...@li...
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
|