JIRA Velocity Email Error - Since moving to 6.4.5

Hi

Since moving to 6.4.5 we are getting error with an velocity email any ideas what I need to change ?

#disable_html_escaping()
#set ($componentManagerClass = $constantsManager.getClass().getClassLoader().findClass('com.atlassian.jira.ComponentManager'))
#set ($method = $componentManagerClass.getDeclaredMethod('getInstance', null))
#set ($componentManager = $method.invoke(null, null))
#set ($allComments = $componentManager.getCommentManager())
#set ( $comms = ${allComments.getComments($issue)}  )
#set ( $rSorter = $comms.size() - 2  ) ##dont include latest comment as this is for comment event notifications which will put latest comment at the top top top
 
#set ( $rNew = $comms.size() - 1 )
#set ( $a = $comms.get($rNew) )
<table border="0" cellpadding="5" cellspacing="0" style="text-align:left;" >
                <tr>
   <td><b><font size="4" color="#4181FF" face="Arial">Latest Update:</font></b></td>
                       <td><font face="Arial">$a.getBody()</font></td>
                </tr>
                <tr>
                        <td> </td>
                        <td> </td>
                </tr>
                <tr>
                        <td><b><font size="4" color="#4181FF" face="Arial">Description of Maintenance:</b></font></td>
                        <td><font face="Arial">$issue.getDescription()</font></td>
                </tr>
                <tr>
                        <td><b><font size="4" color="#4181FF" face="Arial">Maintenance Start Time:</b></font></td>
                        <td><font face="Arial">$dateformatter.formatDMYHMS($issue.getCustomFieldValue("customfield_11524"))</font></td>
                </tr>
                <tr>
                        <td><b><font size="4" color="#4181FF" face="Arial">Maintenance End Time:</b></font></td>
                        <td><font face="Arial">$dateformatter.formatDMYHMS($issue.getCustomFieldValue("customfield_11525"))</font></td>
                </tr>
 
                <tr>
                        <td><b><font size="4" color="#4181FF" face="Arial">Maintenance Manager:</b></font></td>
                  <tr>
                        <td><b><font size="4" color="#4181FF" face="Arial">Maintenance Manager:</b></font></td>
                        <td><font face="Arial">$a.getAuthorFullName()</font></td>
                </tr>
                <tr>
                        <td><b><font size="4" color="#4181FF" face="Arial">Reference:</b></font></td>
                        <td><font face="Arial">$issue.getKey()</font></td>
                </tr>
</table>
 
 
<br>
</br>
 
#if($rSorter >= 0)
<tr valign="top">
    <td  id="email-fields">
        <table border="0" cellpadding="0" cellspacing="0" style="padding:0;text-align:left;width:100%;" width="100%">
                    <b><font size="4" color="#4181FF" face="Arial">History of Actions Taken</font size="4" color="#4181FF" face="Arial"></b>
 
        <br>
        </br>
 
            #foreach($d in [$rSorter .. 0])
                #set ( $c = $comms.get($d) )
 
                <tr valign="top">
                    <td colspan="0" style="color:${textColour};font-family:${textFontFamily};font-size:${textSize};padding:0 0 10px 0;width:100%;">
                        <div><font face="Arial"><b>$c.getAuthorFullName()</b>: $c.getCreated() - $c.getBody()</font></div>
 
                        </div>
                        <div style="color:${textSubtleColour};padding:4px 0 0 0;">#visibility()</div>
                    </td>
                </tr>
 
            #end
            </table>
        </td>
    </tr>
#end

      

 Error message -

An error occurred whilst rendering this message. Please contact the administrators, and inform them of this bug. Details: ------- org.apache.velocity.exception.MethodInvocationException: Invocation of method 'findClass' in class org.apache.catalina.loader.WebappClassLoader threw exception java.lang.LinkageError: loader (instance of org/apache/catalina/loader/WebappClassLoader): attempted duplicate class definition for name: "com/atlassian/jira/ComponentManager" at getEncodedBodyFromContent[line 3, column 78] at org.apache.velocity.runtime.parser.node.ASTMethod.handleInvocationException(ASTMethod.java:351) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:284) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:262) at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:507) at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:71) at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:142) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:336) at org.apache.velocity.runtime.RuntimeInstance.render(RuntimeInstance.java:1276) at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1215) at org.apache.velocity.runtime.RuntimeInstance.evaluate(RuntimeInstance.java:1164) at org.apache.velocity.app.VelocityEngine.evaluate(VelocityEngine.java:219) at com.atlassian.velocity.DefaultVelocityManager.getEncodedBodyForContent(DefaultVelocityManager.java:205) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497)

1 answer

1 accepted

Accepted Answer
0 votes

I've fixed this issue by using the JETI plugin

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Tuesday in Jira

Looking for anyone who made the switch to Data Center

The Jira Marketing team is putting together an ebook on migrating to Data Center. We're looking for pro tips on how you staffed your project team and organized your Proof of Concept. Share yo...

47 views 0 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you