Details
Description
While evaluating template with Velocity I am affecting:
java.lang.NullPointerException
org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:1103)
org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:1086)
org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1199)
org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1165)
org.apache.velocity.app.Velocity.evaluate(Velocity.java:191)
pl.pollub.cafe.zeusx.modules.report.ReportController.generateWorkersSchedule(ReportController.java:300)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.doInvokeMethod(HandlerMethodInvoker.java:421)
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:136)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:326)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:313)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
pl.pollub.cafe.zeusx.commons.spring.FlashScopeFilter.doFilterInternal(FlashScopeFilter.java:33)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
exception.
Code which is being executed:
try
catch (Exception e1)
{ e1.printStackTrace(); }then
try
{ Velocity.evaluate( context, writer, "string", template.getSzablon()); }catch (ParseErrorException e)
{ e.printStackTrace(); } catch (MethodInvocationException e) { e.printStackTrace(); }catch (ResourceNotFoundException e)
{ e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); }This code does not on production server, but works on development machines. I have tried using VelocityEngine instetad of Velocity Signleton but no luck.
I also tried initializing Velocity during servlet startup but nothing changed. Any help appreciated
Attachments
Issue Links
- duplicates
-
VELOCITY-750 org.apache.velocity.runtime.RuntimeInstance initialization is not ThreadSafe
- Closed