Failed to load custom .vm files with SDK 4.2.1

Today I installed latest SDK and I am able to compile our custom plugins. When I run on my local environment I am getting tons of errors. I see most of the errors are related to .vm files. Can someone help me please??

[INFO] [talledLocalContainer] 2013-06-13 17:33:14,418 http-bio-2990-exec-10 ERROR admin 1053x731x1 fo6h5g 10.105.180.29 /secure/AdminAction.jspa [velocity] Left side of addition operation is not a valid type. Currently only integers (1,2,3...) and Integer type is supported. admin.vm [line 86, column 51

[INFO] [talledLocalContainer] 2013-06-13 17:33:14,418 http-bio-2990-exec-10 ERROR admin 1053x731x1 fo6h5g 10.105.180.29 /secure/AdminAction.jspa [velocity] Left side ( "-" ) of addition operation has null value. Operation not possible. admin.vm [line 86, column 57]

[INFO] [talledLocalContainer] 2013-06-13 17:33:14,436 http-bio-2990-exec-10 ERROR admin 1053x731x1 fo6h5g 10.105.180.29 /secure/AdminAction.jspa [velocity] Left side ( $vn ) of addition operation has null value. Operation not possible. admin.vm [line 86, column 63]

[INFO] [talledLocalContainer] 2013-06-13 17:33:14,436 http-bio-2990-exec-10 ERROR admin 1053x731x1 fo6h5g 10.105.180.29 /secure/AdminAction.jspa [velocity] RHS of #set statement is null. Context will not be modified. admin.vm [line 86, column 26]

[INFO] [talledLocalContainer] 2013-06-13 17:33:14,440 http-bio-2990-exec-10 WARN admin 1053x731x1 fo6h5g 10.105.180.29 /secure/AdminAction.jspa [velocity] org.apache.velocity.runtime.exception.ReferenceException: reference : template = admin.vm [line 87,column 50] : $id is not a valid reference.

[INFO] [talledLocalContainer] at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:277)

[INFO] [talledLocalContainer] at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:55)

[INFO] [talledLocalContainer] at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:166)

[INFO] [talledLocalContainer] at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:114)

[INFO] [talledLocalContainer] at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:230)

[INFO] [talledLocalContainer] at org.apache.velocity.Template.merge(Template.java:256)

[INFO] [talledLocalContainer] at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:422)

[INFO] [talledLocalContainer] at com.atlassian.velocity.DefaultVelocityManager.getEncodedBody(DefaultVelocityManager.java:77)

[INFO] [talledLocalContainer] at com.atlassian.jira.plugin.webwork.JiraPluginWebworkVelocityServlet.service(JiraPluginWebworkVelocityServlet.java:57)

[INFO] [talledLocalContainer] at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)

[INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)

[INFO] [talledLocalContainer] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)

[INFO] [talledLocalContainer] at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46)

[INFO] [talledLocalContainer] at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66)

[INFO] [talledLocalContainer] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:25)

[INFO] [talledLocalContainer] at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:74)

[INFO] [talledLocalContainer] at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:42)

[INFO] [talledLocalContainer] at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:77)

[INFO] [talledLocalContainer] at com.atlassian.plugin.servlet.filter.ServletFilterModuleContainerFilter.doFilter(ServletFilterModuleContainerFilter.java:63)

4 answers

1 accepted

0 votes
Answer accepted

Updated atlassian sdk and restarted the server. Now the issue was resolved.

Srinivas

So this is a custom vm file? You have errors in it for sure at least in regards to $id?

$id is not a valid reference.

I would check that all your variables are actually available to the velocity context (Or change them to $!id so they go to null?)


yes this vm file was working before I upgraged atlassian SDK 4.2.1. Yes all the variables are available to velocity context.

Hi Atlassians,

Any help please??

Srinivas

I think you'll have to post some of the vm file for us to help you further

Here is the sample vm code. It worked before I updaded the SDK version 4.0 and tested on JIRA 4.4.5 and 5.2.5 versions
<table   class="aui aui-table-rowhover"  id="project-config-versions-table" >
			<thead>
				<tr>
				<th>&nbsp</th>
				<th>$i18n.getText('version.label')</th>
				<th>$i18n.getText('qualifier.label')</th>
				<th>$i18n.getText('release.date.label')</th>
				<th>$i18n.getText('code.freeze.date.label')</th>
				<th>$i18n.getText('feature.complete.date.label')</th>
				<!--<th>$i18n.getText('confluence.url.label')</th>-->
				
				<th>&nbsp</th>
				</tr>
			</thead>
			<tbody>
			 #set ($projectKey = $action.projectKey)
			 #foreach ($versionName in $action.versions)
			 #set ($vn = $versionName.replace(' ','-'))
			 #set ($formid = $projectKey + "-" + $vn)
			
			
			
			<tr class="jira-restfultable-row jira-restfultable-readonly">
				<td> </td>
				<td  class="project-config-version-name"><a href="/plugins/servlet/xproduct/releaseinfo?version=$versionName&strProjectKey=$projectKey&flag=details">$versionName</a></td>
				#set ($id = $projectKey + "-" + $vn + "-qualifier")
				<td><select name=$id id=$id class="select"/></td>
				<td>
					#set ($id = $projectKey + "-" + $vn + "-releasedate")
					#set ($divid = $id + "-div")
					#set ($triggerid = $id + "-trigger")
					<div class="project-config-date-field" id=$divid>
                      <input id=$id name=$id type="text" class="text short-field" value="" title="Select a date" />
                      <a href="#" id=$triggerid title="Select a date"> <span class="aui-icon icon-date">Select a date</span></a>
                    </div>
				</td>
				
                <td><input type="button" class="button" value="Save" id=$formid></td>
             </tr>
			 #set ($id = $projectKey + "-" + $vn + "-version")
			 <input type="hidden" id=$id value=$versionName />
			 
			 #end
			 </tbody>
		</table>

got tons of similar exceptions while loading this vm file.

2013-06-13 22:56:34,378 http-bio-2990-exec-5 ERROR admin 1376x719x1 1ytwv50 10.98.39.62 /secure/AdminAction.jspa [velocity] Left side of addition operation is not a valid type. Currently only integers (1,2,3...) and Integer type is supported. admin.vm [line 86, column 51]
2013-06-13 22:56:34,379 http-bio-2990-exec-5 ERROR admin 1376x719x1 1ytwv50 10.98.39.62 /secure/AdminAction.jspa [velocity] Left side ( "-" ) of addition operation has null value. Operation not possible. admin.vm [line 86, column 57]
2013-06-13 22:56:34,379 http-bio-2990-exec-5 ERROR admin 1376x719x1 1ytwv50 10.98.39.62 /secure/AdminAction.jspa [velocity] Left side ( $vn ) of addition operation has null value. Operation not possible. admin.vm [line 86, column 63]
2013-06-13 22:56:34,389 http-bio-2990-exec-5 ERROR admin 1376x719x1 1ytwv50 10.98.39.62 /secure/AdminAction.jspa [velocity] RHS of #set statement is null. Context will not be modified. admin.vm [line 86, column 26]
2013-06-13 22:56:34,390 http-bio-2990-exec-5 WARN admin 1376x719x1 1ytwv50 10.98.39.62 /secure/AdminAction.jspa [velocity] org.apache.velocity.runtime.exception.ReferenceException: reference : template = admin.vm [line 87,column 50] : $id is not a valid reference.
  at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:277)
  at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:55)
  at org.apache.velocity.runtime.directive.Foreach.render(Foreach.java:166)
  at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:114)

Hi Colin, Any update please..

-Srinivas

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Thursday in Summit

Find a your Summit 2019 Buddy!

Can you believe there's less than one month until Summit 2019? It's time to start planning your agendas, not to mention packing ... In the meantime, introduce yourselves on this thread so that you ...

194 views 12 6
Read article

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