Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-804

RuntimeInstance throws exception on init() but stay with "initializing" state

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7
    • Fix Version/s: 2.0
    • Component/s: Engine
    • Labels:
      None
    • Environment:
      Linux

      Description

      init() throws an exception and below is the cause:

      Caused by: java.io.FileNotFoundException: velocity.log (Permission denied)

      That's ok, I just need to change the permissions on webapps directory from my tomcat. But I needed to restart the server because the "initializing" param is true yet.
      This is my sugestion to fix that (just a try{}funally{}):

      public synchronized void init()
      throws Exception
      {

      if (!initialized && !initializing)
      {
      try

      { initializing = true; log.trace("*******************************************************************"); log.debug("Starting Apache Velocity v@build.version@ (compiled: @build.time@)"); log.trace("RuntimeInstance initializing."); initializeProperties(); initializeLog(); initializeResourceManager(); initializeDirectives(); initializeEventHandlers(); initializeParserPool(); initializeIntrospection(); /* * initialize the VM Factory. It will use the properties * accessable from Runtime, so keep this here at the end. */ vmFactory.initVelocimacro(); log.trace("RuntimeInstance successfully initialized."); }

      finally

      { initializing = false; }

      initialized = true;
      }

        Activity

        Hide
        maschiojv Felipe Maschio added a comment -

        Really? no one will fix it? I had a lot of problems because it.

        Show
        maschiojv Felipe Maschio added a comment - Really? no one will fix it? I had a lot of problems because it.
        Hide
        claude Claude Brisson added a comment -

        Commited. Thanks for the suggestion.

        Show
        claude Claude Brisson added a comment - Commited. Thanks for the suggestion.

          People

          • Assignee:
            Unassigned
            Reporter:
            maschiojv Felipe Maschio
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 5m
              5m
              Remaining:
              Remaining Estimate - 5m
              5m
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development