Проблемы с подключением Karaf к TIBCO EMS с использованием JNDI - PullRequest
0 голосов
/ 04 февраля 2020

У меня есть следующие настройки:

  1. Караф 4.2.8
  2. TIBCO EMS 8.5.1 (с использованием версии JAR клиента OSGI)
  3. Camel 2.24.1
  4. Spring 5.1.6.RELEASE

Мой маршрут. xml (его отрывок) Файл выглядит следующим образом:

...
    <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
        <property name="environment">
            <props>
                <prop key="java.naming.factory.initial">${jndi.intial.context}</prop>
                <prop key="java.naming.provider.url">${jndi.naming.provider.url}</prop>
                <prop key="java.naming.security.principal">${jndi.naming.security.principal}</prop>
                <prop key="java.naming.security.credentials">${jndi.naming.security.credentials}</prop>
            </props>
        </property>
    </bean>

    <bean id="jndiFactoryBean" class="org.springframework.jndi.JndiObjectFactoryBean" init-method="afterPropertiesSet">
        <property name="jndiName" value="${jndi.connection.factory.name}"/>
        <property name="jndiTemplate" ref="jndiTemplate"/>
    </bean>

    <bean id="jndiDestinationResolver" class="org.springframework.jms.support.destination.JndiDestinationResolver">
        <property name="jndiTemplate" ref="jndiTemplate"/>
        <property name="cache" value="true" />
    </bean>

    <bean id="jmsConfiguration" class="org.apache.camel.component.jms.JmsConfiguration">
        <property name="connectionFactory" ref="proxyConnectionFactory"/>
        <property name="destinationResolver" ref="jndiDestinationResolver"/>
    </bean>

    <bean id="tibco" class="org.apache.camel.component.jms.JmsComponent">
        <property name="configuration" ref="jmsConfiguration" />
    </bean>
...

I Я не могу установить sh соединение с TIBCO EMS с этой настройкой, и я получаю следующую ошибку:

org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to initialize bean jndiFactoryBean
    at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:593) ~[!/:1.10.2]
    at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:703) ~[!/:1.10.2]
    at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:666) ~[!/:1.10.2]
    at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:81) ~[!/:1.10.2]
    at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
    at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:90) ~[!/:1.10.2]
    at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:360) ~[!/:1.10.2]
    at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:190) ~[!/:1.10.2]
    at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:737) ~[!/:1.10.2]
    at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:433) [!/:1.10.2]
    at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:298) [!/:1.10.2]
    at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:311) [!/:1.10.2]
    at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:280) [!/:1.10.2]
    at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:276) [!/:1.10.2]
    at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:266) [!/:1.10.2]
    at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500) [!/:1.10.2]
    at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433) [!/:1.10.2]
    at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725) [!/:1.10.2]
    at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463) [!/:1.10.2]
    at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422) [!/:1.10.2]
    at org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1179) [org.apache.felix.framework-5.6.12.jar:?]
    at org.apache.felix.framework.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:730) [org.apache.felix.framework-5.6.12.jar:?]
    at org.apache.felix.framework.EventDispatcher.fireBundleEvent(EventDispatcher.java:485) [org.apache.felix.framework-5.6.12.jar:?]
    at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4579) [org.apache.felix.framework-5.6.12.jar:?]
    at org.apache.felix.framework.Felix.startBundle(Felix.java:2174) [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:1153) [!/:?]
    at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:1036) [!/:?]
    at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1062) [!/:?]
    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: javax.naming.NoInitialContextException: Unable to find the InitialContextFactory com.tibco.tibjms.naming.TibjmsInitialContextFactory.
    at org.apache.aries.jndi.ContextHelper.getInitialContext(ContextHelper.java:150) ~[?:?]
    at org.apache.aries.jndi.OSGiInitialContextFactoryBuilder.getInitialContext(OSGiInitialContextFactoryBuilder.java:51) ~[?:?]
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:730) ~[?:?]
    at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:305) ~[?:?]
    at javax.naming.InitialContext.init(InitialContext.java:236) ~[?:?]
    at javax.naming.InitialContext.<init>(InitialContext.java:208) ~[?:?]
    at org.springframework.jndi.JndiTemplate.createInitialContext(JndiTemplate.java:141) ~[?:?]
    at org.springframework.jndi.JndiTemplate.getContext(JndiTemplate.java:108) ~[?:?]
    at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:90) ~[?:?]
    at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:157) ~[?:?]
    at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:179) ~[?:?]
    at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:96) ~[?:?]
    at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:114) ~[?:?]
    at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:239) ~[?:?]
    at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:225) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
    at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:337) ~[!/:1.10.2]
    at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:835) ~[!/:1.10.2]
    at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:591) ~[!/:1.10.2]
    ... 35 more

Кто-нибудь видел что-то подобное раньше? Любые идеи будут чрезвычайно полезны.

...