Velocity
  1. Velocity
  2. VELOCITY-86

Error during startup: Can't find 'VM_global_library.vm'.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3-rc1
    • Fix Version/s: None
    • Component/s: Engine
    • Labels:
      None
    • Environment:
      Operating System: other
      Platform: All

      Description

      When Velocity starts, an error indicating VM_global_library.vm cannot be found
      is generated at "error" level. It does not seem to prevent proper behavior and
      I couldn't tell from querying BugZilla whether this problem has been addressed.

      Andy Riedel
      ariedel@xadra.com

      2002-06-17 18:26:02,312 [main] INFO VelocityEngine -
      **************************************************************
      2002-06-17 18:26:02,322 [main] INFO VelocityEngine - Starting Jakarta Velocity
      v1.3-rc1
      2002-06-17 18:26:02,332 [main] INFO VelocityEngine - RuntimeInstance
      initializing.
      2002-06-17 18:26:02,342 [main] INFO VelocityEngine - Default Properties File:
      org\apache\velocity\runtime\defaults\velocity.properties
      2002-06-17 18:26:02,352 [main] INFO VelocityEngine - Trying to use logger
      class org.apache.velocity.runtime.log.SimpleLog4JLogSystem
      2002-06-17 18:26:02,362 [main] INFO VelocityEngine - Using logger class
      org.apache.velocity.runtime.log.SimpleLog4JLogSystem
      2002-06-17 18:26:02,382 [main] INFO VelocityEngine - Default ResourceManager
      initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl)
      2002-06-17 18:26:02,402 [main] INFO VelocityEngine - Resource Loader
      Instantiated: org.apache.velocity.runtime.resource.loader.FileResourceLoader
      2002-06-17 18:26:02,412 [main] INFO VelocityEngine - FileResourceLoader :
      initialization starting.
      2002-06-17 18:26:02,422 [main] INFO VelocityEngine - FileResourceLoader :
      adding path '../../skins/default'
      2002-06-17 18:26:02,432 [main] INFO VelocityEngine - FileResourceLoader :
      initialization complete.
      2002-06-17 18:26:02,452 [main] INFO VelocityEngine - ResourceCache :
      initialized. (class org.apache.velocity.runtime.resource.ResourceCacheImpl)
      2002-06-17 18:26:02,462 [main] INFO VelocityEngine - Default ResourceManager
      initialization complete.
      2002-06-17 18:26:02,472 [main] INFO VelocityEngine - Loaded System Directive:
      org.apache.velocity.runtime.directive.Literal
      2002-06-17 18:26:02,492 [main] INFO VelocityEngine - Loaded System Directive:
      org.apache.velocity.runtime.directive.Macro
      2002-06-17 18:26:02,502 [main] INFO VelocityEngine - Loaded System Directive:
      org.apache.velocity.runtime.directive.Parse
      2002-06-17 18:26:02,522 [main] INFO VelocityEngine - Loaded System Directive:
      org.apache.velocity.runtime.directive.Include
      2002-06-17 18:26:02,532 [main] INFO VelocityEngine - Loaded System Directive:
      org.apache.velocity.runtime.directive.Foreach
      2002-06-17 18:26:02,712 [main] INFO VelocityEngine - Created: 20 parsers.
      2002-06-17 18:26:02,722 [main] INFO VelocityEngine - Velocimacro :
      initialization starting.
      2002-06-17 18:26:02,732 [main] INFO VelocityEngine - Velocimacro : adding VMs
      from VM library template : VM_global_library.vm
      2002-06-17 18:26:02,753 [main] ERROR VelocityEngine - ResourceManager : unable
      to find resource 'VM_global_library.vm' in any resource loader.
      2002-06-17 18:26:02,763 [main] INFO VelocityEngine - Velocimacro : error
      using VM library template VM_global_library.vm :
      org.apache.velocity.exception.ResourceNotFou
      ndException: Unable to find resource 'VM_global_library.vm'
      2002-06-17 18:26:02,783 [main] INFO VelocityEngine - Velocimacro : VM library
      template macro registration complete.
      2002-06-17 18:26:02,793 [main] INFO VelocityEngine - Velocimacro : allowInline
      = true : VMs can be defined inline in templates
      2002-06-17 18:26:02,823 [main] INFO VelocityEngine - Velocimacro :
      allowInlineToOverride = false : VMs defined inline may NOT replace previous VM
      definitions
      2002-06-17 18:26:02,823 [main] INFO VelocityEngine - Velocimacro :
      allowInlineLocal = false : VMs defined inline will be global in scope if
      allowed.
      2002-06-17 18:26:02,833 [main] INFO VelocityEngine - Velocimacro : messages
      on : VM system will output logging messages
      2002-06-17 18:26:02,853 [main] INFO VelocityEngine - Velocimacro : autoload
      off : VM system will not automatically reload global library macros
      2002-06-17 18:26:02,863 [main] INFO VelocityEngine - Velocimacro :
      initialization complete.
      2002-06-17 18:26:02,873 [main] INFO VelocityEngine - Velocity successfully
      started.

        Activity

        Hide
        Geir Magnusson Jr added a comment -

        You are right here - this is output as an error and it shouldn't be, as it isn't.
        Velocity is trying to find the default VM library, and when it can't it reports as
        an error. We can fix that by just checking to see if the library that isn't
        found is the default, and squelch that error message.

        Show
        Geir Magnusson Jr added a comment - You are right here - this is output as an error and it shouldn't be, as it isn't. Velocity is trying to find the default VM library, and when it can't it reports as an error. We can fix that by just checking to see if the library that isn't found is the default, and squelch that error message.
        Hide
        Nathan Bubna added a comment -
            • Bug 11111 has been marked as a duplicate of this bug. ***
        Show
        Nathan Bubna added a comment - Bug 11111 has been marked as a duplicate of this bug. ***
        Hide
        Matthew Sgarlata added a comment -

        At the very least, could the logged message be at WARN level rather than ERROR
        level? I have no idea what this error means, but Velocity is working just fine
        despite this "error", so I think the level should be reduced to WARN.

        Thanks,

        Matt

        Show
        Matthew Sgarlata added a comment - At the very least, could the logged message be at WARN level rather than ERROR level? I have no idea what this error means, but Velocity is working just fine despite this "error", so I think the level should be reduced to WARN. Thanks, Matt
        Hide
        Mike Kienenberger added a comment -

        VM_global_library.vm is a file containing macros globally shared among all
        templates. You're right in that this should be logged as either WARNING or
        INFO since there's no requirement to have such a file.

        Show
        Mike Kienenberger added a comment - VM_global_library.vm is a file containing macros globally shared among all templates. You're right in that this should be logged as either WARNING or INFO since there's no requirement to have such a file.
        Hide
        Will Glass-Husain added a comment -

        Anyone want to make a patch?

        Ideally, there'd be no error at all if you specify a different macro file, and
        an INFO message otherwise.

        Show
        Will Glass-Husain added a comment - Anyone want to make a patch? Ideally, there'd be no error at all if you specify a different macro file, and an INFO message otherwise.
        Hide
        Shinobu Kawai added a comment -

        The hard part is how to figure in VelocimacroFactory, if the
        velocimacro.library property was set in an overridden velocity.property or the
        default.

        Show
        Shinobu Kawai added a comment - The hard part is how to figure in VelocimacroFactory, if the velocimacro.library property was set in an overridden velocity.property or the default.
        Hide
        Shinobu Kawai added a comment -

        > Comment #5
        If you specify a different macro file, and it didn't exist, shouldn't it be an
        error?

        I'm thinking there are 4 patterns:
        1. No macro file specified, and VM_global_library.vm exists.
        2. No macro file specified, and VM_global_library.vm doesn't exist.
        3. Macro file specified, and exists.
        4. Macro file specified, and doesn't exist.

        1 and 3 should work fine, 2 should give an info, and 4 an error.

        Show
        Shinobu Kawai added a comment - > Comment #5 If you specify a different macro file, and it didn't exist, shouldn't it be an error? I'm thinking there are 4 patterns: 1. No macro file specified, and VM_global_library.vm exists. 2. No macro file specified, and VM_global_library.vm doesn't exist. 3. Macro file specified, and exists. 4. Macro file specified, and doesn't exist. 1 and 3 should work fine, 2 should give an info, and 4 an error.
        Hide
        Shinobu Kawai added a comment -

        Created an attachment (id=14099)
        patch based on Comment #7

        I moved the default velocimacro library template from the default
        velocity.properties to RuntimeConstants.

        Now, VelocimacroFactory will check if there are any set, and if not, try the
        default.

        Do we need a test for this? (What do we test for?)

        Show
        Shinobu Kawai added a comment - Created an attachment (id=14099) patch based on Comment #7 I moved the default velocimacro library template from the default velocity.properties to RuntimeConstants. Now, VelocimacroFactory will check if there are any set, and if not, try the default. Do we need a test for this? (What do we test for?)
        Hide
        Will Glass-Husain added a comment -

        Patch applied. This seemed basic enough to me to do eyeball testing and patch
        without a unit test. Thanks Andy for reporting this, and thanks Shinobu for
        the patch. Revision #149352.

        Show
        Will Glass-Husain added a comment - Patch applied. This seemed basic enough to me to do eyeball testing and patch without a unit test. Thanks Andy for reporting this, and thanks Shinobu for the patch. Revision #149352.
        Hide
        Henning Schmiedehausen added a comment -

        Close all resolved issues for older releases.

        Show
        Henning Schmiedehausen added a comment - Close all resolved issues for older releases.

          People

          • Assignee:
            Unassigned
            Reporter:
            Andy Riedel
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development