尝试在Karaf.I中加载蓝图容器时遇到问题 出现以下异常
无法初始化bean cxf org.osgi.service.blueprint.container.ComponentDefinitionException: 无法初始化bean cxf 在org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:593) 在org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:703) 在org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:666) 在org.apache.aries.blueprint.di.AbstractRecipe $ 1.call(AbstractRecipe.java:81) 在java.util.concurrent.FutureTask.run(FutureTask.java:266) 在org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:90) 在org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:360) 在org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:190) 在org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:716) 在org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:413) 在org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:278) 在org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:299) 在org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:268) 在org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:264) 在org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:254) 在org.apache.aries.util.tracker.hook.BundleHookBundleTracker $ Tracked.customizerModified(BundleHookBundleTracker.java:500)处 在org.apache.aries.util.tracker.hook.BundleHookBundleTracker $ Tracked.customizerModified(BundleHookBundleTracker.java:433)处 在org.apache.aries.util.tracker.hook.BundleHookBundleTracker $ AbstractTracked.track(BundleHookBundleTracker.java:725) 在org.apache.aries.util.tracker.hook.BundleHookBundleTracker $ Tracked.bundleChanged(BundleHookBundleTracker.java:463) 在org.apache.aries.util.tracker.hook.BundleHookBundleTracker $ BundleEventHook.event(BundleHookBundleTracker.java:422) 在org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1179) 在org.apache.felix.framework.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:730) 在org.apache.felix.framework.EventDispatcher.fireBundleEvent(EventDispatcher.java:485) 在org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4579) 在org.apache.felix.framework.Felix.startBundle(Felix.java:2174) 在org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998) 在org.apache.felix.framework.BundleImpl.start(BundleImpl.java:984) 在org.apache.karaf.features.internal.service.BundleInstallSupportImpl.startBundle(BundleInstallSupportImpl.java:161) 在org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1116) 在org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:997) 在org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1025) 在org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda $ doProvisionInThread $ 13(FeaturesServiceImpl.java:964) 在java.util.concurrent.FutureTask.run(FutureTask.java:266) 在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:624) 在java.lang.Thread.run(Thread.java:748)导致原因:org.apache.cxf.bus.extension.ExtensionException:无法创建 扩展类org.apache.cxf.ws.policy.PolicyEngineImpl的对象。 在org.apache.cxf.bus.extension.Extension.load(Extension.java:241) 在org.apache.cxf.bus.osgi.CXFExtensionBundleListener $ OSGiExtension.load(CXFExtensionBundleListener.java:145) 在org.apache.cxf.bus.extension.ExtensionManagerImpl.loadAndRegister(ExtensionManagerImpl.java:208) 在org.apache.cxf.bus.extension.ExtensionManagerImpl.initialize(ExtensionManagerImpl.java:116) 在org.apache.cxf.bus.extension.ExtensionManagerBus.doInitializeInternal(ExtensionManagerBus.java:264) 在org.apache.cxf.bus.extension.ExtensionManagerBus.initialize(ExtensionManagerBus.java:254) 在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处 在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 在java.lang.reflect.Method.invoke(Method.java:498) 在org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:331) 在org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:838) 在org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:591) ... 35更多原因:java.lang.ClassCastException:无法将org.apache.cxf.service.factory.FactoryBeanListenerManager强制转换为 org.apache.cxf.service.factory.FactoryBeanListenerManager 在java.lang.Class.cast(Class.java:3369) 在org.apache.cxf.bus.extension.ExtensionManagerImpl.getBeanOfType(ExtensionManagerImpl.java:317) 在org.apache.cxf.bus.blueprint.BlueprintBeanLocator.getBeanOfType(BlueprintBeanLocator.java:99) 在org.apache.cxf.bus.extension.ExtensionManagerBus.getExtension(ExtensionManagerBus.java:185) 在org.apache.cxf.ws.policy.PolicyEngineImpl.setBus(PolicyEngineImpl.java:109) 在org.apache.cxf.ws.policy.PolicyEngineImpl。(PolicyEngineImpl.java:92) 在sun.reflect.NativeConstructorAccessorImpl.newInstance0(本机方法)处 在sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) 在sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 在java.lang.reflect.Constructor.newInstance(Constructor.java:423) 在org.apache.cxf.bus.extension.Extension.load(Extension.java:217) ...还有47个
我正在将cxf版本从2.6.0升级到3.1.11
blueprint.xml
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
xmlns:camel-cxf="http://camel.apache.org/schema/blueprint/cxf"
xmlns:cxfcore="http://cxf.apache.org/blueprint/core"
xmlns:jaas="http://karaf.apache.org/xmlns/jaas/v1.0.0"
xmlns:jaxws="http://cxf.apache.org/blueprint/jaxws"
xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
<jaxws:endpoint id="translationManager" implementor="com.aaa.xxx.translation.ws.service.TranslationManagerImpl" address="/translationManager"/>
</blueprint>