簡體   English   中英

無法修復“名稱空間[/ build / result]沒有映射任何操作”。 將操作添加到Bamboo名稱空間的正確方法是什么?

[英]Can't fix “There is no Action mapped for namespace [/build/result] ”. What is the correct way of adding action to bamboo namespace?

我正在使用Atlassian-SDK開發Bamboo插件。 此插件將向Bamboo Jobs頁面添加一個新標簽 ,該標簽將在同一標簽中顯示HTML報告(以工件形式顯示)。

我的Atlassian-plugin.xml看起來像

<xwork key="viewRobotReport" name="View Robot Report">
    <package name="RobotPlugin" extends="buildResultView">
    <action name="viewRobotReport" class="robot.RobotReport">
    <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}&amp;buildNumber=${buildNumber}
    </link>
    <condition class="robot.RobotReportViewCondition"/>
</web-item>

我正在從ViewBuildResults擴展我的類RobotReport,以便可以獲取工件詳細信息。

單擊選項卡后,出現錯誤

 Apologies, this page could not be properly decorated (data is missing) 

該頁面的URL是172.xx.x.x0:6990 / bamboo / build / result / viewRobotReport.action?buildKey = TPRO1-TPLAN1-JOB1&buildNumber = 1

從日志中,我可以看到以下錯誤

[INFO] [talledLocalContainer] 2018-05-02 13:41:48,724 INFO [http-nio-6990-exec-12] [AccessLogFilter] admin GET http://172.20.1.30:6990/bamboo/build/result/viewRobotReport.action?buildKey=TPRO1-TPLAN1-JOB1&buildNumber=1&_=1525264904397 177957kb
[INFO] [talledLocalContainer] 2018-05-02 13:41:48,725 ERROR [http-nio-6990-exec-12] [BambooStrutsUnknownHandler] There is no Action mapped for namespace [/build/result] and action name [viewRobotReport] associated with context path [/bamboo].
[INFO] [talledLocalContainer] 2018-05-02 13:41:48,788 INFO [http-nio-6990-exec-9] [AccessLogFilter] admin GET http://172.20.1.30:6990/bamboo/build/result/viewRobotReport.action?buildKey=TPRO1-TPLAN1-JOB1&buildNumber=1 76808kb
[INFO] [talledLocalContainer] 2018-05-02 13:41:48,789 ERROR [http-nio-6990-exec-9] [BambooStrutsUnknownHandler] There is no Action mapped for namespace [/build/result] and action name [viewRobotReport] associated with context path [/bamboo].
[INFO] [talledLocalContainer] 2018-05-02 13:41:48,819 ERROR [http-nio-6990-exec-9] [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] 

我了解到BambooStruts無法在/ bamboo的名稱空間/ build / result中找到動作。

我的freemarker模板僅包含此位。

<html>
    <head>
        <meta name="decorator" content="result"/>
    </head>
    <body>
    </body>
</html>

在Bamboo的/ build / result命名空間中添加動作(viewRobotReport)的正確方法是什么?

Bamboo開發者論壇沒有實施此准則。 它在某處提到“ setter注入”,但不確定是什么。

任何微小的提示將不勝感激。 提前致謝。

當我查看atlas-run的所有日志時,我發現了問題所在。 我可以在日志中的以下內容。

[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)}

我通過執行以下操作將其固定在代碼中。

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){

有用的鏈接

https://community.developer.atlassian.com/t/spring-autowiring-issues-when-extending-viewbuildresults/14766/2

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM