Reminder: Create & find trunk-related issues here. Legacy Trac tickets are still available. Problems? Workflow feedback? Need a module project? Open a support ticket.

OpenMRS Trunk

can't download form because of velocity error

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Should Should
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: OpenMRS 1.4.0
  • Component/s: None
  • Severity:
    3
  • Keywords:
  • Description:
    Hide

    With 1.4.x I can't download a form because of a velocity error. Here's the error:

    ERROR - FormDownloadServlet.doFormEntryGet(101) |2008-12-10 12:32:49,588| Error initializing Velocity engine
    org.apache.velocity.exception.VelocityException: Failed to initialize an instance of org.apache.velocity.runtime.log.Log4JLogChute with the current runtime configuration.
    	at org.apache.velocity.runtime.log.LogManager.createLogChute(LogManager.java:206)
    	at org.apache.velocity.runtime.log.LogManager.updateLog(LogManager.java:255)
    	at org.apache.velocity.runtime.RuntimeInstance.initializeLog(RuntimeInstance.java:783)
    	at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:250)
    	at org.apache.velocity.runtime.RuntimeSingleton.init(RuntimeSingleton.java:114)
    	at org.apache.velocity.app.Velocity.init(Velocity.java:79)
    	at org.openmrs.module.formentry.web.FormDownloadServlet.doFormEntryGet(FormDownloadServlet.java:98)
    	at org.openmrs.module.formentry.web.FormDownloadServlet.doGet(FormDownloadServlet.java:217)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    	at org.openmrs.module.web.ModuleServlet.service(ModuleServlet.java:68)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    	at org.openmrs.web.OpenmrsFilter.doFilter(OpenmrsFilter.java:124)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    	at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
    	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
    	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
    	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
    	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
    	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
    	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
    	at java.lang.Thread.run(Thread.java:619)
    Show
    With 1.4.x I can't download a form because of a velocity error. Here's the error:
    ERROR - FormDownloadServlet.doFormEntryGet(101) |2008-12-10 12:32:49,588| Error initializing Velocity engine
    org.apache.velocity.exception.VelocityException: Failed to initialize an instance of org.apache.velocity.runtime.log.Log4JLogChute with the current runtime configuration.
    	at org.apache.velocity.runtime.log.LogManager.createLogChute(LogManager.java:206)
    	at org.apache.velocity.runtime.log.LogManager.updateLog(LogManager.java:255)
    	at org.apache.velocity.runtime.RuntimeInstance.initializeLog(RuntimeInstance.java:783)
    	at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:250)
    	at org.apache.velocity.runtime.RuntimeSingleton.init(RuntimeSingleton.java:114)
    	at org.apache.velocity.app.Velocity.init(Velocity.java:79)
    	at org.openmrs.module.formentry.web.FormDownloadServlet.doFormEntryGet(FormDownloadServlet.java:98)
    	at org.openmrs.module.formentry.web.FormDownloadServlet.doGet(FormDownloadServlet.java:217)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    	at org.openmrs.module.web.ModuleServlet.service(ModuleServlet.java:68)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    	at org.openmrs.web.OpenmrsFilter.doFilter(OpenmrsFilter.java:124)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    	at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
    	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
    	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
    	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
    	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
    	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
    	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
    	at java.lang.Thread.run(Thread.java:619)
  1. Latest%20velocity%20error.txt
    (6 kB)
    Burke Mamlin
    2009-01-21 06:55:20 EST

Issue Links

Activity

Hide
Chase Yarbrough added a comment - 2008-12-10 10:47:08 EST

using lastest formentry module from 1.4.x branch and openmrs from latest 1.4.x too.

Show
Chase Yarbrough added a comment - 2008-12-10 10:47:08 EST using lastest formentry module from 1.4.x branch and openmrs from latest 1.4.x too.
Hide
Chase Yarbrough added a comment - 2008-12-10 10:47:46 EST

adding in andreas

Show
Chase Yarbrough added a comment - 2008-12-10 10:47:46 EST adding in andreas
Hide
Chase Yarbrough added a comment - 2008-12-10 11:41:28 EST

it could be related to this error i get in 1.3.2

[warn] Could not create file appender 'velocity.log'
velocity.log (Permission denied)
java.io.FileNotFoundException: velocity.log (Permission denied)
	at java.io.FileOutputStream.openAppend(Native Method)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:177)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:102)
	at org.apache.log4j.FileAppender.setFile(FileAppender.java:290)
	at org.apache.log4j.RollingFileAppender.setFile(RollingFileAppender.java:194)
	at org.apache.log4j.FileAppender.<init>(FileAppender.java:109)
	at org.apache.log4j.RollingFileAppender.<init>(RollingFileAppender.java:72)
	at org.apache.velocity.runtime.log.Log4JLogChute.initAppender(Log4JLogChute.java:114)
	at org.apache.velocity.runtime.log.Log4JLogChute.init(Log4JLogChute.java:84)
	at org.apache.velocity.runtime.log.LogManager.createLogChute(LogManager.java:150)
	at org.apache.velocity.runtime.log.LogManager.updateLog(LogManager.java:243)
	at org.apache.velocity.runtime.RuntimeInstance.initializeLog(RuntimeInstance.java:728)
	at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:240)
	at org.apache.velocity.runtime.RuntimeSingleton.init(RuntimeSingleton.java:113)
	at org.apache.velocity.app.Velocity.init(Velocity.java:83)
	at org.openmrs.module.formentry.web.FormDownloadServlet.doFormEntryGet(FormDownloadServlet.java:89)
	at org.openmrs.module.formentry.web.FormDownloadServlet.doGet(FormDownloadServlet.java:184)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at org.openmrs.module.web.ModuleServlet.service(ModuleServlet.java:68)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at org.openmrs.web.OpenmrsFilter.doFilter(OpenmrsFilter.java:124)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
	at java.lang.Thread.run(Thread.java:619)
Show
Chase Yarbrough added a comment - 2008-12-10 11:41:28 EST it could be related to this error i get in 1.3.2
[warn] Could not create file appender 'velocity.log'
velocity.log (Permission denied)
java.io.FileNotFoundException: velocity.log (Permission denied)
	at java.io.FileOutputStream.openAppend(Native Method)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:177)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:102)
	at org.apache.log4j.FileAppender.setFile(FileAppender.java:290)
	at org.apache.log4j.RollingFileAppender.setFile(RollingFileAppender.java:194)
	at org.apache.log4j.FileAppender.<init>(FileAppender.java:109)
	at org.apache.log4j.RollingFileAppender.<init>(RollingFileAppender.java:72)
	at org.apache.velocity.runtime.log.Log4JLogChute.initAppender(Log4JLogChute.java:114)
	at org.apache.velocity.runtime.log.Log4JLogChute.init(Log4JLogChute.java:84)
	at org.apache.velocity.runtime.log.LogManager.createLogChute(LogManager.java:150)
	at org.apache.velocity.runtime.log.LogManager.updateLog(LogManager.java:243)
	at org.apache.velocity.runtime.RuntimeInstance.initializeLog(RuntimeInstance.java:728)
	at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:240)
	at org.apache.velocity.runtime.RuntimeSingleton.init(RuntimeSingleton.java:113)
	at org.apache.velocity.app.Velocity.init(Velocity.java:83)
	at org.openmrs.module.formentry.web.FormDownloadServlet.doFormEntryGet(FormDownloadServlet.java:89)
	at org.openmrs.module.formentry.web.FormDownloadServlet.doGet(FormDownloadServlet.java:184)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at org.openmrs.module.web.ModuleServlet.service(ModuleServlet.java:68)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at org.openmrs.web.OpenmrsFilter.doFilter(OpenmrsFilter.java:124)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
	at java.lang.Thread.run(Thread.java:619)
Hide
Andreas Kollegger added a comment - 2008-12-10 14:56:21 EST

It is related. Velocity used to just initialize, sometimes having permissions problems when trying to create the velocity.log file (which is the default behavior). This was addressed in 1.4.x by changeset:6104 which configures Velocity to use commons logging.

It seems as if Velocity is reverting to the default behavior. Perhaps because something is set up wrong with commons logging? Anything else in the system logs which may point towards the problem?

Show
Andreas Kollegger added a comment - 2008-12-10 14:56:21 EST It is related. Velocity used to just initialize, sometimes having permissions problems when trying to create the velocity.log file (which is the default behavior). This was addressed in 1.4.x by changeset:6104 which configures Velocity to use commons logging. It seems as if Velocity is reverting to the default behavior. Perhaps because something is set up wrong with commons logging? Anything else in the system logs which may point towards the problem?
Hide
Ben Wolfe added a comment - 2008-12-10 15:29:12 EST

Andreas, the init'ing done here:
http://dev.openmrs.org/changeset/6104/openmrs-modules/formentry/branches/1.4.x/web/src/org/openmrs/module/formentry/web/FormDownloadServlet.java

won't carry over to the static calls to the VelocityContext later. I only know this because I recently went through the same pain. You need to save that "ve" object somewhere and do your template calls against that instead of against the static Velocity class.

Show
Ben Wolfe added a comment - 2008-12-10 15:29:12 EST Andreas, the init'ing done here: http://dev.openmrs.org/changeset/6104/openmrs-modules/formentry/branches/1.4.x/web/src/org/openmrs/module/formentry/web/FormDownloadServlet.java won't carry over to the static calls to the VelocityContext later. I only know this because I recently went through the same pain. You need to save that "ve" object somewhere and do your template calls against that instead of against the static Velocity class.
Hide
Andreas Kollegger added a comment - 2008-12-10 15:52:18 EST

That's a great observation, Ben. Thanks.

I've made the changes as recommended and committed changeset:6240

Show
Andreas Kollegger added a comment - 2008-12-10 15:52:18 EST That's a great observation, Ben. Thanks. I've made the changes as recommended and committed changeset:6240
Hide
Darius Jazayeri added a comment - 2008-12-10 16:51:26 EST

Andreas, can you backport this to 1.4.x?

Show
Darius Jazayeri added a comment - 2008-12-10 16:51:26 EST Andreas, can you backport this to 1.4.x?
Hide
Andreas Kollegger added a comment - 2008-12-10 20:49:06 EST

Replying to [djazayeri|comment:8]:
> Andreas, can you backport this to 1.4.x?

Actually, I need to forwardport the fix to trunk. Will do that.

Show
Andreas Kollegger added a comment - 2008-12-10 20:49:06 EST Replying to [djazayeri|comment:8]: > Andreas, can you backport this to 1.4.x? Actually, I need to forwardport the fix to trunk. Will do that.
Hide
Andreas Kollegger added a comment - 2008-12-11 15:29:30 EST

Ported to formentry trunk as part of changeset:6248

Show
Andreas Kollegger added a comment - 2008-12-11 15:29:30 EST Ported to formentry trunk as part of changeset:6248
Hide
Darius Jazayeri added a comment - 2008-12-11 16:23:28 EST

So does that mean this issue is fixed?

Show
Darius Jazayeri added a comment - 2008-12-11 16:23:28 EST So does that mean this issue is fixed?
Hide
Ben Wolfe added a comment - 2009-01-16 22:10:57 EST

Evan recently found this error and then reported that it was fixed by upgrading to the latest formentry, so I'm assuming this is fixed. Thanks Andreas.

Show
Ben Wolfe added a comment - 2009-01-16 22:10:57 EST Evan recently found this error and then reported that it was fixed by upgrading to the latest formentry, so I'm assuming this is fixed. Thanks Andreas.
Hide
Evan Waters added a comment - 2009-01-21 06:53:25 EST

When I discovered this error last time, it seemingly cropped up out of nowhere after we had been running 1.4.0.20 and formentry v 3.3.4 for about a week. At the time, upgrading to formentry 3.3.5 fixed the problem.

Well, we just started seeing the error again, or at least something very similar. We are still running 1.4.0.20 and are on version 3.3.5 of formentry.

Any ideas about why this may have happened all of a sudden? I'm attaching the log file of the error.

Show
Evan Waters added a comment - 2009-01-21 06:53:25 EST When I discovered this error last time, it seemingly cropped up out of nowhere after we had been running 1.4.0.20 and formentry v 3.3.4 for about a week. At the time, upgrading to formentry 3.3.5 fixed the problem. Well, we just started seeing the error again, or at least something very similar. We are still running 1.4.0.20 and are on version 3.3.5 of formentry. Any ideas about why this may have happened all of a sudden? I'm attaching the log file of the error.
Hide
Evan Waters added a comment - 2009-01-21 06:55:20 EST

The latest error we are seeing in version 1.4.0.20 / 3.3.5

Show
Evan Waters added a comment - 2009-01-21 06:55:20 EST The latest error we are seeing in version 1.4.0.20 / 3.3.5
Hide
Evan Waters added a comment - 2009-01-21 07:39:01 EST

... just upgraded to Build 6644 and the error has stopped again. I'll pipe up if I see it again. This is the second time it's come up after we had been running a certain version of the code and module for a few days. Hoping this time's the charm!

Show
Evan Waters added a comment - 2009-01-21 07:39:01 EST ... just upgraded to Build 6644 and the error has stopped again. I'll pipe up if I see it again. This is the second time it's come up after we had been running a certain version of the code and module for a few days. Hoping this time's the charm!
Hide
Ben Wolfe added a comment - 2009-01-26 18:39:38 EST

Ok, closing this ticket for now. Your attached error looks different than what was reported before, so if you see the error again, create a new ticket. Thanks!

Show
Ben Wolfe added a comment - 2009-01-26 18:39:38 EST Ok, closing this ticket for now. Your attached error looks different than what was reported before, so if you see the error again, create a new ticket. Thanks!

People

Dates

  • Created:
    2008-12-10 10:38:42 EST
    Updated:
    2010-07-09 17:22:27 EDT
    Resolved:
    2010-07-01 22:42:53 EDT