Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register

Ticket #1165 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

can't download form because of velocity error

Reported by: catullus Assigned to: akollegger
Priority: major Milestone: (Completed) OpenMRS 1.4
Component: OpenMRS Code Base Keywords:
Cc: djazayeri, bwolfe, akollegger Introductory Ticket: 0
Code Review Status:

Description

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)

Attachments

Latest velocity error.txt (6.5 kB) - added by mkulumadzi on 01/21/09 06:55:20.
The latest error we are seeing in version 1.4.0.20 / 3.3.5

Change History

12/10/08 10:47:08 changed by catullus

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

12/10/08 10:47:46 changed by catullus

  • cc changed from djazayeri, bwolfe to djazayeri, bwolfe, akollegger.

adding in andreas

12/10/08 11:41:28 changed by catullus

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)

12/10/08 11:41:59 changed by catullus

  • type changed from task to defect.

12/10/08 14:56:21 changed by akollegger

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?

12/10/08 15:29:12 changed by bwolfe

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.

12/10/08 15:52:18 changed by akollegger

  • owner changed from somebody to akollegger.

That's a great observation, Ben. Thanks.

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

(follow-up: ↓ 9 ) 12/10/08 16:51:26 changed by djazayeri

Andreas, can you backport this to 1.4.x?

(in reply to: ↑ 8 ) 12/10/08 20:49:06 changed by akollegger

Replying to djazayeri:

Andreas, can you backport this to 1.4.x?

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

12/11/08 15:29:30 changed by akollegger

Ported to formentry trunk as part of changeset:6248

12/11/08 16:23:28 changed by djazayeri

So does that mean this issue is fixed?

01/16/09 22:10:57 changed by bwolfe

  • status changed from new to closed.
  • resolution set to fixed.

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.

01/21/09 06:53:25 changed by mkulumadzi

  • status changed from closed to reopened.
  • resolution deleted.

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.

01/21/09 06:55:20 changed by mkulumadzi

  • attachment Latest velocity error.txt added.

The latest error we are seeing in version 1.4.0.20 / 3.3.5

01/21/09 07:39:01 changed by mkulumadzi

... 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!

01/26/09 18:39:38 changed by bwolfe

  • status changed from reopened to closed.
  • resolution set to fixed.

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!