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
Accepted answer

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
Posted 30m ago in Featured Groups

Want to know how Atlassians monitor their enterprise deployments?

At Atlassian, we believe in our own products – that's why we use them, even at the enterprise level. Doing so gives us first-hand experience of how they perform at scale; to do this, we monitor each ...

5 views 0 0
View post

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