velocity.log files leaking until "Too many open files" errors

Solution Unverified - Updated -

Issue

  • We use Apache Velocity in our Java/JBoss application. File handles for velocity.log continue to leak and build up until we hit our file limit and see errors like the following:
java.io.FileNotFoundException: /var/lib/jbossas/bin/velocity.log (Too many open files)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:194)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:116)
    at org.apache.log.output.io.FileTarget.openFile(FileTarget.java:106)
    at org.apache.log.output.io.FileTarget.<init>(FileTarget.java:55)
    at org.apache.velocity.runtime.log.AvalonLogChute.initTarget(AvalonLogChute.java:109)
    at org.apache.velocity.runtime.log.AvalonLogChute.init(AvalonLogChute.java:88)
    at org.apache.velocity.runtime.log.LogManager.createLogChute(LogManager.java:150)
    at org.apache.velocity.runtime.log.LogManager.updateLog(LogManager.java:208)
    at org.apache.velocity.runtime.RuntimeInstance.initializeLog(RuntimeInstance.java:728)
    at org.apache.velocity.runtime.RuntimeInstance.init(RuntimeInstance.java:240)
    at org.apache.velocity.app.VelocityEngine.init(VelocityEngine.java:116)

Environment

  • Java
  • JBoss Enterprise Application Platform (EAP)

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content