Hi,
Need some help, I have spent quite a bit of time on this apparently simple part of plugin development.
My Atlassian plugin xml has the below. Also, I have the action class RobotReportDetails extended from ViewBuildResults.
public class RobotReportDetails extends ViewBuildResults {
public String doExecute() throws Exception {
String strBuildList = super.doExecute();
return strBuildList;
}
public String getArtifactReport(){
return getSharedArtifactPath();
//return "Path to Artifact Report";
}
public String getArtifactLog(){
return "Path to Artifact Log";
}
}
atlassian-plugin.xml
<xwork key="viewRobotReport" name="View Robot Report">
<package name="RobotPlugin" extends="buildResultView">
<action name="viewRobotReport" class="isode.bamboo.RobotTestTask.RobotReportDetails">
<result name="success" type="freemarker">viewRobotReport.ftl</result>
</action>
</package>
</xwork>
<web-item key="RobotJob-${planKey}-${buildNumber}" name="RobotReport" section="results.subMenu/results" weight="80">
<label key="Robot Report"/>
<link linkId="RobotBuild-${planKey}-${buildNumber}">/build/result/viewRobotReport.action?buildKey=${planKey}&buildNumber=${buildNumber}</link>
<condition class="isode.bamboo.RobotTestTask.RobotReportDetailsViewCondition"/>
</web-item>
Console Logs..
[INFO] [talledLocalContainer] 2018-05-02 10:21:03,137 INFO [http-nio-6990-exec-2] [AccessLogFilter] admin GET http://172.20.1.30:6990/bamboo/build/result/viewRobotReport.action?buildKey=TPROJ1-TPLAN1-JOB1&buildNumber=61&_=1525252860943 148384kb
[INFO] [talledLocalContainer] 2018-05-02 10:21:03,138 ERROR [http-nio-6990-exec-2] [BambooStrutsUnknownHandler] There is no Action mapped for namespace [/build/result] and action name [viewRobotReport] associated with context path [/bamboo].
[INFO] [talledLocalContainer] 2018-05-02 10:21:03,244 INFO [http-nio-6990-exec-8] [AccessLogFilter] admin GET http://172.20.1.30:6990/bamboo/build/result/viewRobotReport.action?buildKey=TPROJ1-TPLAN1-JOB1&buildNumber=61 200988kb
[INFO] [talledLocalContainer] 2018-05-02 10:21:03,245 ERROR [http-nio-6990-exec-8] [BambooStrutsUnknownHandler] There is no Action mapped for namespace [/build/result] and action name [viewRobotReport] associated with context path [/bamboo].
[INFO] [talledLocalContainer] 2018-05-02 10:21:03,294 ERROR [http-nio-6990-exec-8] [runtime] Error executing FreeMarker template
[INFO] [talledLocalContainer] FreeMarker template error:
[INFO] [talledLocalContainer] The following has evaluated to null or missing:
[INFO] [talledLocalContainer] ==> navigationContext [in template "decorators/resultDecorator.ftl" at line 17, column 18]
[INFO] [talledLocalContainer]
[INFO] [talledLocalContainer] ----
My template file has nothing but the below
<html>
<head>
<meta name="decorator" content="result"/>
</head>
<body>
</body>
</html>
Similar question on stackoverflow
I copied the struts.xml in src/main/resources directory as suggested
When I click on the tab on the job page I get an error
Apologies, this page could not be properly decorated (data is missing)
Page Not found.
I can see that the struts.xml does not contain the below package definition
<package name="RobotPlugin" extends="buildResultView">
<action name="viewRobotReport" class="robot.RobotReport">
<result name="success"type="freemarker">viewRobotReport.ftl
</result>
</action>
</package>
Shouldn't the struts.xml be updated automatically by bamboo with the content present in atlassian-plugin.xml ?
Could anyone please help ?
Regards,
kshitij
I found what the problem was when I was looking at all the logs of atlas-run. I could the the below in the logs..
[INFO] [talledLocalContainer] 2018-05-03 13:30:07,737 ERROR [localhost-startStop-1] [BambooPluginUtils] A problem has occurred when instantiating action class [robot.RobotReport], skipping action [viewRobotReport]
[INFO] [talledLocalContainer] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'robot.RobotReport': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.atlassian.bamboo.storage.StorageLocationService com.atlassian.bamboo.build.ViewBuildResults.storageLocationService; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.atlassian.bamboo.storage.StorageLocationService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
I fixed it in the code by doing the below..
import com.atlassian.plugin.spring.scanner.annotation.imports.ComponentImport;
import com.atlassian.plugin.spring.scanner.annotation.component.Scanned;
@Scanned
public class RobotReport extends ViewBuildResults {
public RobotReport(@ComponentImport StorageLocationService storageLocationService){
Useful link
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.