spring-boot - OSGi Karaf Spring Boot 2.1.4-发布错误
问题描述
我正在尝试使用带有 Java 8、OSGi 版本 5.0.0 和 Apache Karaf 4.1.3 的 Spring Boot 2.1.4 构建一个 OSGi Karaf 应用程序。
我在 GitHub中创建了以下项目,当我使用 Spring Boot 1.5.9 时,它可以正常构建和运行。
但是当我将 Spring boot 版本从 1.5.9-RELEASE 更改为 2.1.4-RELEASE 并尝试这样做时mvn clean install
,我从 maven-bundle-plugin 收到以下错误
[WARNING] Bundle com.nemesis:osgi-spring-boot-demo-bundle:bundle:0.0.1-SNAPSHOT : Export com.nemesis.osgi.springboot, has 4, private references [com.nemesis.osgi.springboot.controller, org.springframework.context.annotation, org.springframework.boot, org.springframework.boot.autoconfigure],
[ERROR] Bundle com.nemesis:osgi-spring-boot-demo-bundle:bundle:0.0.1-SNAPSHOT : Exception: java.lang.ArrayIndexOutOfBoundsException: 19
[ERROR] Bundle com.nemesis:osgi-spring-boot-demo-bundle:bundle:0.0.1-SNAPSHOT : Invalid class file META-INF/versions/9/module-info.class (java.lang.ArrayIndexOutOfBoundsException: 19)
[ERROR] Bundle com.nemesis:osgi-spring-boot-demo-bundle:bundle:0.0.1-SNAPSHOT : Classes found in the wrong directory: {META-INF/versions/9/org/apache/logging/log4j/util/StackLocator.class=org.apache.logging.log4j.util.StackLocator, META-INF/versions/9/org/apache/logging/log4j/util/internal/DefaultObjectInputFilter.class=org.apache.logging.log4j.util.internal.DefaultObjectInputFilter, META-INF/versions/9/org/apache/logging/log4j/util/ProcessIdUtil.class=org.apache.logging.log4j.util.ProcessIdUtil}
[ERROR] Bundle com.nemesis:osgi-spring-boot-demo-bundle:bundle:0.0.1-SNAPSHOT : Exception: java.lang.ArrayIndexOutOfBoundsException: 19
[ERROR] Bundle com.nemesis:osgi-spring-boot-demo-bundle:bundle:0.0.1-SNAPSHOT : Invalid class file module-info.class (java.lang.ArrayIndexOutOfBoundsException: 19)
[ERROR] Bundle com.nemesis:osgi-spring-boot-demo-bundle:bundle:0.0.1-SNAPSHOT : Exception: java.lang.ArrayIndexOutOfBoundsException: 19
[ERROR] Bundle com.nemesis:osgi-spring-boot-demo-bundle:bundle:0.0.1-SNAPSHOT : Exception: java.lang.ArrayIndexOutOfBoundsException: 19
[ERROR] Bundle com.nemesis:osgi-spring-boot-demo-bundle:bundle:0.0.1-SNAPSHOT : Exception: java.lang.ArrayIndexOutOfBoundsException: 19
任何帮助深表感谢。
解决方案
我认为错误是因为新的 Spring Boot 包或依赖项是 Maven 包插件版本 3.3.0 尚无法处理的多版本 jar。将 maven bundle 插件版本更新到 4.1.0 为我解决了这个问题。
推荐阅读
- react-native - 参考错误:无法在带有提取的反应本机中找到变量
- haskell - 如何计算有序 [Char] 中 Char 的出现次数?
- php - jquery/ajax,检查用户名可用性
- android - 关闭应用程序后不显示选择图像表单库
- bamboo - 如何覆盖默认计划分支配置?
- r - 分组匹配
- kubernetes - Kubernetes 不会在重新部署时更新 Docker 映像
- c++ - 插入新键时会改变现有键值的地址吗?
- android - Ionic4 无法在 android 设备上对 REST api 进行 https 调用
- android - 对于不同的 xml 布局,我可以有多个 RecyclerViewAdapter 类,其中包含他们自己的 recyclerView?