We are using velocity1.4 to implement templating in our system. The system is running fine since deploy. Recently, there is a serious problem that causing the web panel down. We did setup multiple host in resin to point to different panel. When the error happen, only the host having the problem down but others are ok.
Host Setting in resin.conf
Expand|Select|Wrap|Line Numbers
- <host id="api.abc.com" root-directory="/www/sw/api">
- <web-app id="/" document-directory="/www/sw/api">
- <servlet-mapping url-pattern="/servlet/*" servlet-name="invoker"/>
- </web-app>
- </host>
Expand|Select|Wrap|Line Numbers
- public int doEndTag() throws JspException {
- try {
- logger.info("Velocity File Resource Loaded:"+Velocity.FILE_RESOURCE_LOADER_PATH);
- VelocityContext myVelocityContext = null;
- Velocity.setProperty(Velocity.FILE_RESOURCE_LOADER_PATH, velpath);
- Velocity.init();
- if (ctx == null) {
- myVelocityContext = new VelocityContext();
- }
- else {
- myVelocityContext = ctx;
- }
- Template template = null;
- template = Velocity.getTemplate(veltemplate, "UTF-8");
- StringWriter myStringWriter = new StringWriter();
- template.merge(myVelocityContext, myStringWriter);
- pageContext.getOut().print(myStringWriter);
- return EVAL_PAGE;
- }
- catch (Exception e) {
- e.printStackTrace();
- throw new JspException("Exception; TEMPLATE_CLASSPATH; exception="
- + e.getMessage());
- }
- }
Please help...