Apache felix 将Servicemix从5.4.0升级到6.1.2后,依赖项管理器命令不起作用

Apache felix 将Servicemix从5.4.0升级到6.1.2后,依赖项管理器命令不起作用,apache-felix,apache-servicemix,Apache Felix,Apache Servicemix,我们在Servicemix 5.4.0()中部署了一个应用程序,最近尝试升级到Servicemix 6.1.2()。我们依赖的一件事是Felix依赖关系管理器,特别是'dm wtf'命令(请参阅)。但是,在使用更高版本的Servicemix尝试我们的代码后,我们得到以下结果:- karaf@root>dm wtf Error executing command: Cannot coerce dm(String) to any of [(CommandSession, boolean, St

我们在Servicemix 5.4.0()中部署了一个应用程序,最近尝试升级到Servicemix 6.1.2()。我们依赖的一件事是Felix依赖关系管理器,特别是'dm wtf'命令(请参阅)。但是,在使用更高版本的Servicemix尝试我们的代码后,我们得到以下结果:-

karaf@root>dm wtf
Error executing command: Cannot coerce dm(String) to any of [(CommandSession, boolean, String, boolean, boolean, boolean, String, String, String, String)]
相关版本(当我们运行列表时)为:-

有人试图让Felix使用Servicemix 6.1.2吗? 有没有人对我们如何让这个命令(或等效命令)发挥作用有什么想法?显然,Apache Felix从4.4.1降级至4.2.1,但Karaf从2.4.1升级至3.0.7,因此不确定是否需要修改功能配置:-

<feature name="example-feature" version="X.X.X">
                <bundle>mvn:org.apache.felix/org.apache.felix.metatype/1.0.10</bundle>
                <bundle>mvn:org.apache.felix/org.apache.felix.dependencymanager/3.2.0</bundle>
                <bundle>mvn:org.apache.felix/org.apache.felix.dependencymanager.shell/3.2.0</bundle>
</feature>

mvn:org.apache.felix/org.apache.felix.metatype/1.0.10
mvn:org.apache.felix/org.apache.felix.dependencymanager/3.2.0
mvn:org.apache.felix/org.apache.felix.dependencymanager.shell/3.2.0

我已对此进行调试,发现问题是由于方法DMCommand.dm()上的参数注释引起的。此方法的参数是dm命令中可用选项的名称(wtf、stats、nodeps等),这些参数上的注释定义了这些选项在DMCommand对象中的映射方式(即,如果存在“wtf”,则应将布尔值设置为true,如果不存在,则布尔值应为false)

在ServiceMix控制台中执行dm wtf命令期间,org.apache.felix.gogo.runtime.Reflective.transformParameters()通过调用java.lang.reflect.method.getParameterAnnotations()使用这些注释,将命令字符串中的选项值转换为正确值类型和值的数组(即,将字符串“wtf”转换为true)

ServiceMix 6.1.2中的问题是,对java.lang.reflect.method.getParameterAnnotations()的调用返回一个空java.lang.annotation.annotation对象数组。这意味着org.apache.felix.gogo.runtime.Reflective.transformParameters()中不会发生转换,从而导致不正确的参数类型和值(wtf选项保持为字符串,而不是更改为布尔值),这意味着我们看到了异常

Cannot coerce dm(String) to any of [(CommandSession, boolean, String, boolean, boolean, boolean, String, String, String, String)]

根据我到目前为止看到/发现的情况,我不知道您将如何解决此问题。我已经在ServiceMix 5.4.0和6.1.2上使用相同的JDK(1.7.079)对此进行了测试,因此,Karaf和Felix版本的更改似乎是一个问题。

谢谢Mike,我尝试了Servicemix 5.4.1,也发现了同样的问题,所以看起来Servicemix 5.4.0和5.4.1之间发生了一些变化,这改变了Felix依赖关系管理器的行为,但我想我们都想知道我们需要做什么你能做些什么(如果有的话)?
Cannot coerce dm(String) to any of [(CommandSession, boolean, String, boolean, boolean, boolean, String, String, String, String)]