尝试在Karaf中加载蓝图容器时遇到问题。我正在跟踪异常
Unable to initialize bean cxf
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to initialize bean cxf at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:593) at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:703) at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:666) at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:81) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:90) at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:360) at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:190) at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:716) at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:413) at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:278) at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:299) at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:268) at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:264) at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:254) at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500) at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433) at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725) at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463) at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422) at org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1179) at org.apache.felix.framework.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:730) at org.apache.felix.framework.EventDispatcher.fireBundleEvent(EventDispatcher.java:485) at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4579) at org.apache.felix.framework.Felix.startBundle(Felix.java:2174) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:984) at org.apache.karaf.features.internal.service.BundleInstallSupportImpl.startBundle(BundleInstallSupportImpl.java:161) at org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1116) at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:997) at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1025) at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:964) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: org.apache.cxf.bus.extension.ExtensionException: Could not create object of extension class org.apache.cxf.ws.policy.PolicyEngineImpl. at org.apache.cxf.bus.extension.Extension.load(Extension.java:241) at org.apache.cxf.bus.osgi.CXFExtensionBundleListener$OSGiExtension.load(CXFExtensionBundleListener.java:145) at org.apache.cxf.bus.extension.ExtensionManagerImpl.loadAndRegister(ExtensionManagerImpl.java:208) at org.apache.cxf.bus.extension.ExtensionManagerImpl.initialize(ExtensionManagerImpl.java:116) at org.apache.cxf.bus.extension.ExtensionManagerBus.doInitializeInternal(ExtensionManagerBus.java:264) at org.apache.cxf.bus.extension.ExtensionManagerBus.initialize(ExtensionManagerBus.java:254) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:331) at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:838) at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:591) ... 35 more Caused by: java.lang.ClassCastException: Cannot cast org.apache.cxf.service.factory.FactoryBeanListenerManager to org.apache.cxf.service.factory.FactoryBeanListenerManager at java.lang.Class.cast(Class.java:3369) at org.apache.cxf.bus.extension.ExtensionManagerImpl.getBeanOfType(ExtensionManagerImpl.java:317) at org.apache.cxf.bus.blueprint.BlueprintBeanLocator.getBeanOfType(BlueprintBeanLocator.java:99) at org.apache.cxf.bus.extension.ExtensionManagerBus.getExtension(ExtensionManagerBus.java:185) at org.apache.cxf.ws.policy.PolicyEngineImpl.setBus(PolicyEngineImpl.java:109) at org.apache.cxf.ws.policy.PolicyEngineImpl.(PolicyEngineImpl.java:92) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.apache.cxf.bus.extension.Extension.load(Extension.java:217) ... 47 more
我正在将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"/>