0
votes

We have some existing source code which connect to JMS using TCP protocol . We are providing EMS URL as shown below in properties file:

tib.ems.url=tcp://UK_ONES_DEV_0000.ldn.mywork.com:9222

Now our EMS URL has been changed to SSL but when we are making any changes to ems URL in properties file, it is changing SSL to TCP automatically and failing connection. I am wondering if we need to make any changes for SSL connection.

<bean id="orcaReplayConnectionFactory"
      class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
    <property name="targetConnectionFactory" ref="orcaProviderReplayConnectionFactory"/>
    <property name="username" value="${jms.orca.username}"/>
    <property name="password" value="${jms.orca.password}"/>
</bean>

<jee:jndi-lookup id="orcaProviderReplayConnectionFactory"
                 jndi-name="${jndi.orca.name.replay}">
    <jee:environment>
        java.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory
        java.naming.provider.url=${jndi.orca.url}
        java.naming.factory.url.pkgs=com.tibco.tibjms.naming
    </jee:environment>
</jee:jndi-lookup>

15:43:12.923 [main] INFO o.s.s.c.ThreadPoolTaskScheduler -Initializing ExecutorService 'taskScheduler' 15:43:13.528 [main] WARN o.s.c.s.ClassPathXmlApplicationContext -Exception encountered during context initialization - cancelling refresh attempt org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.jms.listener.DefaultMessageListenerContainer#0': Cannot resolve reference to bean 'orcaConnectionFactory_v2' while setting bean property 'connectionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'orcaConnectionFactory_v2' defined in class path resource [spring/integration-context.xml]: Cannot resolve reference to bean 'orcaProviderConnectionFactory_v2' while setting bean property 'targetConnectionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'orcaProviderConnectionFactory_v2': Invocation of init method failed; nested exception is javax.naming.ServiceUnavailableException: Failed to query JNDI: Failed to connect to the server at tcp://UK_ONES_UAT_0000.ldn.mywork.com:9222 [Root exception is javax.jms.JMSException: Failed to connect to the server at tcp://UK_ONES_UAT_0000.ldn.mywork.com:9222]

2
" I am wondering if we need to make any changes for SSL connection. " Yes switching from TCP to TLS is not just changing some URLs. You will have typically to configure things around certificates and validation.Patrick Mevzek

2 Answers

0
votes

Normally, when using JNDI, the connection URL is configured in the provider not the JNDI client. You need to fix the url in the provider.

0
votes

After adding highlighted configuration while doing JNDI l, issue is resolved

<jee:environment>
            java.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory
            java.naming.provider.url=${jndi.orca.url}
            java.naming.factory.url.pkgs=com.tibco.tibjms.naming
            **com.tibco.tibjms.naming.security_protocol=ssl
            com.tibco.tibjms.naming.ssl_enable_verify_host=false**
            java.naming.security.principal=${jms.orca.username}
            java.naming.security.credentials=${jms.orca.password}
        </jee:environment>