You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Jira插件开发集成Spring Integration启动报错及可行性咨询

问题描述

启动报错信息

[INFO] [talledLocalContainer]     
[INFO] [talledLocalContainer]     1 plugin failed to load during JIRA startup.
[INFO] [talledLocalContainer]     
[INFO] [talledLocalContainer]           abcbcbabqbasbsad  failed to load.
[INFO] [talledLocalContainer]                   Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.atlassian.com/schema/atlassian-scanner/2]
[INFO] [talledLocalContainer]     Offending resource: URL [bundle://189.0:0/META-INF/spring/plugin-context.xml]

plugin-context.xml配置

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:int="http://www.springframework.org/schema/integration"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:atlassian-scanner="http://www.atlassian.com/schema/atlassian-scanner/2"
       xmlns:beans="http://www.springframework.org/schema/c"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
        http://www.springframework.org/schema/integration
        https://www.springframework.org/schema/integration/spring-integration.xsd
        http://www.atlassian.com/schema/atlassian-scanner/2
        http://www.atlassian.com/schema/atlassian-scanner/2/atlassian-scanner.xsd
        http://www.springframework.org/schema/context
        https://www.springframework.org/schema/context/spring-context.xsd">
    <atlassian-scanner:scan-indexes/>
    <context:component-scan base-package="com.my.plugin"/>
    <beans:bean id="myMessageGroupStore" class="com.my.plugin.service.MyMessageGroupStore"/>
</beans>

pom.xml相关依赖

<dependency>
     <groupId>org.springframework.integration</groupId>
     <artifactId>spring-integration-core</artifactId>
     <version>5.2.11.RELEASE</version>
</dependency>
<dependency>
    <groupId>com.atlassian.plugin</groupId>
    <artifactId>atlassian-spring-scanner-annotation</artifactId>
    <version>${atlassian.spring.scanner.version}</version>
    <scope>provided</scope>
</dependency>

自定义Bean代码

@Service
@NoArgsConstructor
@AllArgsConstructor
public class ServerMessageGroupStore extends AbstractMessageGroupStore {

    @Autowired
    private ActiveObjects ao;
...
}
修复步骤

1. 补充Atlassian Scanner运行时依赖

报错核心是缺少处理atlassian-scanner命名空间的处理器,当前仅引入了注解定义包,需添加运行时处理依赖。在pom.xml中加入:

<dependency>
    <groupId>com.atlassian.plugin</groupId>
    <artifactId>atlassian-spring-scanner-runtime</artifactId>
    <version>${atlassian.spring.scanner.version}</version>
    <scope>compile</scope>
</dependency>

注意确保${atlassian.spring.scanner.version}与Jira版本兼容(如Jira 8.x适配scanner 2.x版本)。

2. 移除冗余Bean配置(可选优化)

由于已通过@Service注解标记Bean,且配置了context:component-scan自动扫描,可删除plugin-context.xml中手动声明的myMessageGroupStore Bean,避免重复注册。

3. 校验Spring Integration版本兼容性

Jira内置特定版本的Spring框架,需保证引入的Spring Integration版本与之匹配:

  • Jira 8.x内置Spring 5.x,当前使用的5.2.11.RELEASE版本兼容;
  • 若为Jira 7.x,需将Spring Integration降级至4.x版本。
    Spring Integration依赖需保持compile scope(Jira不自带该组件),打包时注意避免依赖冲突。
Jira插件中使用Spring Integration的可行性

完全可以在Jira插件中使用Spring Integration,需注意以下几点:

  • 严格匹配Spring Integration与Jira内置Spring的版本;
  • 避免使用Jira未兼容的Spring高级特性;
  • 自定义Integration组件通过@Service等注解配合组件扫描,确保被Atlassian Spring容器正确管理。

内容的提问来源于stack exchange,提问作者Oleksandr H

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.19 22:53:14