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

Spaces in velocimacro.library hard to troubleshoot

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 1.4
    • 1.5
    • Engine
    • None
    • 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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment