FreeMarker template error (DEBUG mode; use RETHROW in production!): For "?replace" left-hand operand: Expected a string or something automatically convertible to string (number, date or boolean), but this has evaluated to a sequence+hash (wrapper: f.e.dom.NodeListModel): ==> metadata [in template "generico.ftl" at line 138, column 19] ---- Tip: This XML query result can't be used as string because for that it had to contain exactly 1 XML node, but it contains 2 nodes. That is, the constructing XML query has found multiple matches. ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: ${metadata?replace("\lmetadata\g", ""... [in template "generico.ftl" at line 138, column 17] ---- Java stack trace (for programmers): ---- freemarker.core.NonStringException: [... Exception message was already printed; see it above ...] at freemarker.core.EvalUtil.coerceModelToTextualCommon(EvalUtil.java:511) at freemarker.core.EvalUtil.coerceModelToStringOrUnsupportedMarkup(EvalUtil.java:420) at freemarker.core.Expression.evalAndCoerceToStringOrUnsupportedMarkup(Expression.java:107) at freemarker.core.BuiltInForString.getTargetString(BuiltInForString.java:34) at freemarker.core.BuiltInForString._eval(BuiltInForString.java:29) at freemarker.core.Expression.eval(Expression.java:81) at freemarker.core.MethodCall._eval(MethodCall.java:58) at freemarker.core.Expression.eval(Expression.java:81) at freemarker.core.Expression.evalAndCoerceToStringOrUnsupportedMarkup(Expression.java:107) at freemarker.core.BuiltInForString.getTargetString(BuiltInForString.java:34) at freemarker.core.BuiltInForString._eval(BuiltInForString.java:29) at freemarker.core.Expression.eval(Expression.java:81) at freemarker.core.MethodCall._eval(MethodCall.java:58) at freemarker.core.Expression.eval(Expression.java:81) at freemarker.core.Expression.evalAndCoerceToStringOrUnsupportedMarkup(Expression.java:107) at freemarker.core.BuiltInForString.getTargetString(BuiltInForString.java:34) at freemarker.core.BuiltInForString._eval(BuiltInForString.java:29) at freemarker.core.Expression.eval(Expression.java:81) at freemarker.core.MethodCall._eval(MethodCall.java:58) at freemarker.core.Expression.eval(Expression.java:81) at freemarker.core.DollarVariable.calculateInterpolatedStringOrMarkup(DollarVariable.java:96) at freemarker.core.DollarVariable.accept(DollarVariable.java:59) at freemarker.core.Environment.visit(Environment.java:326) at freemarker.core.Environment.visit(Environment.java:332) at freemarker.core.Environment.visit(Environment.java:332) at freemarker.core.Environment.process(Environment.java:305) at freemarker.template.Template.process(Template.java:378) at org.springframework.web.servlet.view.freemarker.FreeMarkerView.processTemplate(FreeMarkerView.java:366) at org.springframework.web.servlet.view.freemarker.FreeMarkerView.doRender(FreeMarkerView.java:283) at org.springframework.web.servlet.view.freemarker.FreeMarkerView.renderMergedTemplateModel(FreeMarkerView.java:233) at org.springframework.web.servlet.view.AbstractTemplateView.renderMergedOutputModel(AbstractTemplateView.java:167) at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:262) at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1180) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:950) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778) at javax.servlet.http.HttpServlet.service(HttpServlet.java:635) at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source)