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

Spaces in velocimacro.library hard to troubleshoot

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 1.4
    • Fix Version/s: 1.5
    • Component/s: Engine
    • Labels:
      None
    • Environment:
      N/A

      Description

      With the following velocity.properties file (note the spaces after 'TypeConversions.vm'):


      resource.loader = classpath

      1. this configuration allows you to supply template files somewhere on the classpath
        classpath.resource.loader.description = Velocity Classpath Resource Loader
        classpath.resource.loader.class = org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader

      velocimacro.library=TypeConversions.vm
      ---------

      One gets the following log entries:


      Fri Oct 27 10:42:39 CEST 2006 [info] Velocimacro : adding VMs from VM library template : TypeConversions.vm
      Fri Oct 27 10:42:39 CEST 2006 [error] ResourceManager : unable to find resource 'TypeConversions.vm ' in any resource loader.
      Fri Oct 27 10:42:39 CEST 2006 [info] Velocimacro : error using VM library template TypeConversions.vm : org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'TypeConversions.vm '


      It took me a few hours to notice that there were spaces after the '.vm' - it would maybe be better to add a trim() to VelocimacroFactory.initVelocimacro(), about line 164:


      if (lib != null && !lib.equals(""))
      {
      /*

      • let the VMManager know that the following is coming
      • from libraries - need to know for auto-load
        */

      lib = lib.trim(); // NEW

      vmManager.setRegisterFromLib( true );

      logVMMessageInfo("Velocimacro : adding VMs from " +
      "VM library template : " + lib );

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              petterm Petter Måhlén
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: