Plugin Operation Failed with Velocity ParseErrorException

Still need help?

The Atlassian Community is here for you.

Ask the community


  1. Certain plugin operations always fail with a ParseErrorException as below, both in the browser and in the atlassian-confluence.log:

    Sample error from the Copy Space plugin
    2011-02-01 17:21:16,485 ERROR [TP-Processor22] [opensymphony.webwork.dispatcher.VelocityResult] doExecute Unable to 
    render Velocity Template, '/templates/extra/copyspace/copyspaceoptions.vm'
     -- space: 9633795 | url: /spaces/copyspaceoptions.action | userName: mbuford | referer: | action: copyspaceoptions
    org.apache.velocity.exception.ParseErrorException: Invalid arg #0 in directive 
    #bodytag/templates/extra/copyspace/copyspaceoptions.vm[line 36, column 21]
    	at org.apache.velocity.Template.process(
    	at com.atlassian.confluence.util.velocity.ConfigurableResourceManager.loadResource(
    	at com.atlassian.confluence.util.velocity.ConfigurableResourceManager.getResource(
    	at org.apache.velocity.runtime.RuntimeInstance.getTemplate(
    	at org.apache.velocity.runtime.RuntimeInstance.getTemplate(
    	at com.opensymphony.webwork.dispatcher.VelocityResult.getTemplate(
  2. The plugin is installed by placing it in <confluence install>/confluence/WEB-INF/lib folder


The plugin is not compatible with the latest version of Velocity, and it is avoiding the compatibility layer provided for plugins installed in the regular way (through the UI).

According to Migrating to Velocity 1.5 the version of Velocity used since Confluence 2.8 does not accept the bodytag directive's syntax below because the first argument TextField is not surrounded in quotes. However, plugins have a special resourceloader applied that should fix the broken syntax. They are not applied to plugins loaded from WEB-INF/lib for performance reasons.

Using the stack trace from the Copy Space plugin above as an example. The offending line was:

#bodytag( TextField "label='space-name'" "name='newName'" "size=40" )


This work around is provided only for educational purposes. Since it will cause a performance issue, please follow the advice provided in the Resolution section.

There is a compatibility layer configured in the file. By default it includes this line:


But if you install the plugin through WEB-INF/lib it does not use the "confplugin" resource loader, it uses the "confclass" resource loader, which does not use the velocity13 compatibility mode.

If one very much wanted to run the plugin from WEB-INF/lib, it can be done by extracting the file from WEB-INF/lib/confluence.jar and placing it in WEB-INF/classes. Then adding this line:



  1. Stop Confluence
  2. Move the plugin out of the WEB-INF/lib directory
  3. Restart Confluence
  4. Go to Admin Console -> Plugins and upload the jar to the system. This will install the plugin into Confluence's database and it will have the compatibility layer applied.

Related Content

Last modified on Mar 30, 2016

Was this helpful?

Provide feedback about this article
Powered by Confluence and Scroll Viewport.