Getting an error while writing a custom velocity macro
题
When creating my own macro, and trying to add it so that anyone can use it, I get the following error:
Error number 4001 in 4: Error while parsing velocity page /templates/docdoesnotexist.vm
Wrapped Exception: Cannot start the Velocity engine
I do not change that file, but I do change xwiki/templates/macros.txt
and /macros.vm
by adding recentChanges=velocity:recentChanges:
and #macro(recentChanges)
respectively (yes, I do add working content after #macro(recentChanges)
)
解决方案
That looks like a syntax error in macros.vm. You should revert to the original macros.vm and first try to write your custom macro in a wiki page. Once it works, you can move it to macros.vm and restart the server.
macros.txt shouldn't be edited, it's a legacy file used by the older WYSIWYG editor.
不隶属于 StackOverflow