OSGi Karaf Spring Boot 2.1.4-发布错误

时间:2019-04-24 11:21:38

标签: spring-boot osgi apache-karaf osgi-bundle maven-bundle-plugin

我正在尝试使用Spring Boot 2.1.4,Java 8,OSGi版本5.0.0和Apache Karaf 4.1.3来构建OSGi Karaf应用程序。

我创建了以下project in GitHub,它在使用Spring Boot 1.5.9时可以正常运行。

但是当我将Spring引导版本从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

非常感谢您的帮助。

1 个答案:

答案 0 :(得分:3)

我认为该错误是因为新的Spring Boot捆绑包或依赖项是maven捆绑包插件版本3.3.0尚无法处理的多发行jar。 将maven包插件版本更新为4.1.0为我解决了该问题。

See this PR