我正在将 spring-DM 迁移到 ariesblueprint
使用 java11 和 karaf 4.2.14
同时,aries blueprint 面临找不到合适的context.xml 值的转换器的问题,context.xml 定义了Apache Mina 的defaultLocalAddress。
15:25:43.199 ERROR [features-3-thread-1] Unable to start container for blueprint bundle test/0.0.1.SNAPSHOT
org.osgi.service.blueprint.container.ComponentDefinitionException: Error setting property: PropertyDescriptor <name: defaultLocalAddress, getter: class org.apache.mina.transport.socket.nio.NioSocketAcceptor.getDefaultLocalAddress(), setter: [class org.apache.mina.transport.socket.nio.NioSocketAcceptor.setDefaultLocalAddress(class java.net.InetSocketAddress), class org.apache.mina.core.service.AbstractIoAcceptor.setDefaultLocalAddress(class java.net.SocketAddress)]
at org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:818) ~[!/:1.10.3]
at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:784) ~[!/:1.10.3]
at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:765) ~[!/:1.10.3]
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:699) ~[!/:1.10.3]
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:666) ~[!/:1.10.3]
at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:81) ~[!/:1.10.3]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:90) ~[!/:1.10.3]
at org.apache.aries.blueprint.di.RefRecipe.internalCreate(RefRecipe.java:62) ~[!/:1.10.3]
at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:108) ~[!/:1.10.3]
at org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:810) ~[!/:1.10.3]
at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:784) ~[!/:1.10.3]
at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:765) ~[!/:1.10.3]
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:699) ~[!/:1.10.3]
at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:666) ~[!/:1.10.3]
at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:81) ~[!/:1.10.3]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:90) ~[!/:1.10.3]
at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:360) ~[!/:1.10.3]
at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:190) ~[!/:1.10.3]
at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:737) ~[!/:1.10.3]
at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:433) [!/:1.10.3]
at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:298) [!/:1.10.3]
at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:335) [!/:1.10.3]
at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:288) [!/:1.10.3]
at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:284) [!/:1.10.3]
at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:274) [!/:1.10.3]
at org.apache.aries.blueprint.container.BlueprintExtender.addingBundle(BlueprintExtender.java:237) [!/:1.10.3]
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerAdding(BundleHookBundleTracker.java:487) [!/:1.10.3]
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerAdding(BundleHookBundleTracker.java:433) [!/:1.10.3]
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.trackAdding(BundleHookBundleTracker.java:749) [!/:1.10.3]
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.trackInitial(BundleHookBundleTracker.java:674) [!/:1.10.3]
at org.apache.aries.util.tracker.hook.BundleHookBundleTracker.open(BundleHookBundleTracker.java:159) [!/:1.10.3]
at org.apache.aries.util.tracker.RecursiveBundleTracker.open(RecursiveBundleTracker.java:106) [!/:1.10.3]
at org.apache.aries.blueprint.container.BlueprintExtender$2.serviceFound(BlueprintExtender.java:138) [!/:1.10.3]
at org.apache.aries.util.tracker.SingleServiceTracker.update(SingleServiceTracker.java:174) [!/:1.10.3]
at org.apache.aries.util.tracker.SingleServiceTracker.findMatchingReference(SingleServiceTracker.java:132) [!/:1.10.3]
at org.apache.aries.util.tracker.SingleServiceTracker.access$200(SingleServiceTracker.java:32) [!/:1.10.3]
at org.apache.aries.util.tracker.SingleServiceTracker$1.serviceChanged(SingleServiceTracker.java:61) [!/:1.10.3]
at org.apache.felix.framework.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:990) [org.apache.felix.framework-5.6.12.jar:?]
at org.apache.felix.framework.EventDispatcher.fireEventImmediately(EventDispatcher.java:838) [org.apache.felix.framework-5.6.12.jar:?]
at org.apache.felix.framework.EventDispatcher.fireServiceEvent(EventDispatcher.java:545) [org.apache.felix.framework-5.6.12.jar:?]
at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4595) [org.apache.felix.framework-5.6.12.jar:?]
at org.apache.felix.framework.Felix.registerService(Felix.java:3587) [org.apache.felix.framework-5.6.12.jar:?]
at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:348) [org.apache.felix.framework-5.6.12.jar:?]
at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:322) [org.apache.felix.framework-5.6.12.jar:?]
at org.apache.aries.proxy.impl.ProxyManagerActivator.start(ProxyManagerActivator.java:66) [!/:1.1.12]
at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:697) [org.apache.felix.framework-5.6.12.jar:?]
at org.apache.felix.framework.Felix.activateBundle(Felix.java:2240) [org.apache.felix.framework-5.6.12.jar:?]
at org.apache.felix.framework.Felix.startBundle(Felix.java:2146) [org.apache.felix.framework-5.6.12.jar:?]
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998) [org.apache.felix.framework-5.6.12.jar:?]
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:984) [org.apache.felix.framework-5.6.12.jar:?]
at org.apache.karaf.features.internal.service.BundleInstallSupportImpl.startBundle(BundleInstallSupportImpl.java:165) [!/:?]
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1154) [!/:?]
at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:1044) [!/:?]
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1063) [!/:?]
at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:998) [!/:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: org.osgi.service.blueprint.container.ComponentDefinitionException: No converter available to convert value :8000 into a form applicable for the setters of property defaultLocalAddress
at org.apache.aries.blueprint.utils.ReflectionUtils$MethodPropertyDescriptor.internalSet(ReflectionUtils.java:672) ~[!/:1.10.3]
at org.apache.aries.blueprint.utils.ReflectionUtils$PropertyDescriptor.set(ReflectionUtils.java:418) ~[!/:1.10.3]
at org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:816) ~[!/:1.10.3]
... 60 more
它是我的 network-context.xml 的一部分。
<bean id="ioAcceptor" class="org.apache.mina.transport.socket.nio.NioSocketAcceptor">
<property name="defaultLocalAddress" value=":8000"/>
<property name="handler" ref="minaHandler"/>
<property name="reuseAddress" value="true"/>
<property name="filterChainBuilder" ref="filters"/>
</bean>
它在 SpringDM 中运行良好。
这句话本身似乎没有改变,所以我就照原样使用它。
有什么我忘记了或做了什么愚蠢的事吗?
如果这个问题很奇怪或愚蠢,请告诉我。