Getting org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "name"

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "name"

HareKrishna
I am trying to using thymeleaf email template.
I am getting the following exception
org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "name" (registrationEmail:9)
        at org.thymeleaf.spring3.expression.SpelVariableExpressionEvaluator.evaluate(SpelVariableExpressionEvaluator.java:108)
        at org.thymeleaf.standard.expression.VariableExpression.executeVariable(VariableExpression.java:116)
        at org.thymeleaf.standard.expression.SimpleExpression.executeSimple(SimpleExpression.java:394)
        at org.thymeleaf.standard.expression.Expression.execute(Expression.java:231)
        at org.thymeleaf.standard.expression.StandardExpressionExecutor.executeExpression(StandardExpressionExecutor.java:70)
        at org.thymeleaf.standard.expression.StandardExpressionExecutor.executeExpression(StandardExpressionExecutor.java:58)
        at org.thymeleaf.standard.expression.StandardExpressionProcessor.executeExpression(StandardExpressionProcessor.java:124)
        at org.thymeleaf.standard.expression.StandardExpressionProcessor.processExpression(StandardExpressionProcessor.java:164)
        at org.thymeleaf.standard.processor.attr.AbstractStandardTextChildModifierAttrProcessor.getText(AbstractStandardTextChildModifierAttrProcessor.java:60)
        at org.thymeleaf.processor.attr.AbstractTextChildModifierAttrProcessor.getModifiedChildren(AbstractTextChildModifierAttrProcessor.java:59)
        at org.thymeleaf.processor.attr.AbstractChildrenModifierAttrProcessor.processAttribute(AbstractChildrenModifierAttrProcessor.java:58)
        at org.thymeleaf.processor.attr.AbstractAttrProcessor.doProcess(AbstractAttrProcessor.java:74)
        at org.thymeleaf.processor.AbstractProcessor.process(AbstractProcessor.java:212)
        at org.thymeleaf.dom.Node.applyNextProcessor(Node.java:914)
        at org.thymeleaf.dom.Node.processNode(Node.java:869)
        at org.thymeleaf.dom.NestableNode.computeNextChild(NestableNode.java:638)
        at org.thymeleaf.dom.NestableNode.doAdditionalProcess(NestableNode.java:620)
        at org.thymeleaf.dom.Node.processNode(Node.java:888)
        at org.thymeleaf.dom.NestableNode.computeNextChild(NestableNode.java:638)
        at org.thymeleaf.dom.NestableNode.doAdditionalProcess(NestableNode.java:620)
        at org.thymeleaf.dom.Node.processNode(Node.java:888)
        at org.thymeleaf.dom.NestableNode.computeNextChild(NestableNode.java:638)
        at org.thymeleaf.dom.NestableNode.doAdditionalProcess(NestableNode.java:620)
        at org.thymeleaf.dom.Node.processNode(Node.java:888)
        at org.thymeleaf.dom.NestableNode.computeNextChild(NestableNode.java:638)
        at org.thymeleaf.dom.NestableNode.doAdditionalProcess(NestableNode.java:620)
        at org.thymeleaf.dom.Node.processNode(Node.java:888)
        at org.thymeleaf.dom.Document.process(Document.java:93)
        at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1243)
        at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1148)
        at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1095)
        at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1008)
        at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:982)
        at com.optimal.wallet.service.impl.ConsumerEmailServiceImpl.sendRegistrationEmail(ConsumerEmailServiceImpl.java:66)
        at com.optimal.wallet.web.webapp.RegistrationController.registerCustomer(RegistrationController.java:199)
        at com.optimal.wallet.web.webapp.RegistrationController.createProfile(RegistrationController.java:121)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:219)
        at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:132)
        at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:745)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:686)
        at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:838)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
        at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:183)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
        at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
Caused by: java.lang.NullPointerException
        at org.thymeleaf.spring3.expression.Themes.<init>(Themes.java:53)
        at org.thymeleaf.spring3.expression.SpelVariableExpressionEvaluator.computeExpressionObjects(SpelVariableExpressionEvaluator.java:165)
        at org.thymeleaf.spring3.expression.SpelVariableExpressionEvaluator.evaluate(SpelVariableExpressionEvaluator.java:88)
        ... 93 more


I got the example that is posted on your site and ran it in STS
I am getting the same exception. org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "name" (email-simple.html:8)
Can you please help me in resolving this issue?
Reply | Threaded
Open this post in threaded view
|

Re: Getting org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "name"

Emanuel
Administrator
The same error was explored in this thread here: http://forum.thymeleaf.org/Help-needed-with-TemplateProcessingException-Exception-evaluating-SpringEL-expression-td4026209.html  There's a fix for it which is currently in the 2.0.18-SNAPSHOT version of Thymeleaf-Spring3, as well as a workaround mentioned in that thread.
Reply | Threaded
Open this post in threaded view
|

Re: Getting org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "name"

HareKrishna
Hi Emmanuel,

Thank you for the reply.
I had gone through the link that you have mentioned.
I cannot use the normal templateEngine as I am using Spring3TemplateEngine for resolving other HTML templates.Actually I am using a combination of tiles, thymeleaf and spring.

Is 2.0.18 available now?
Can I use it instead of 2.0.17?

Even the example mentioned on thymeleaf .org site gives the same error.
http://sourceforge.net/projects/thymeleaf/files/thymeleafexamples-springmail/20130609/thymeleafexamples-springmail-20130609-sources.zip/download

can you please have a look at it and propose some solution?
Reply | Threaded
Open this post in threaded view
|

Re: Getting org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "name"

Emanuel
Administrator
2.0.18 is not out yet, but a snapshot version (2.0.18-SNAPSHOT) is available on Maven which contains the fix.
Reply | Threaded
Open this post in threaded view
|

Re: Getting org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "name"

HareKrishna
Hi Emmanuel,

Thanks for your quick reply.
Maven repo has 2.1.0-m1 . I tried the example provided with that and it worked.
Can you provide an example as to how to use ClassloaderTemplateResolver?
FileTemplateResolver with absolute path is able to resolve it but ClassloaderTemplateResolver doesn't seem to find the email template I am refering to.

Thanks in advance.
Reply | Threaded
Open this post in threaded view
|

Re: Getting org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "name"

jpfss
In reply to this post by HareKrishna
The "name" ,"tittle" and so on is Reserved words! You can chang other word and I do it succeed´╝ü