Done a step further ... I mean I added to my local maven repository wlcipher.jar file from weblogic distribution.
My configuration:
Code:
<jee:jndi-lookup id="connectionFactory" jndi-name="..." expose-access-context="true">
<jee:environment>
java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
java.naming.provider.url=t3s://...
java.naming.security.principal=...
java.naming.security.credentials=...
weblogic.security.SSL.ignoreHostnameVerification=true
java.protocol.handler.pkgs=weblogic.net
weblogic.security.TrustKeyStore=CustomTrust
weblogic.security.CustomTrustKeyStoreFileName=C:\\projects\\maven\\workspace\\listener\\src\\test\\resources\\wls_keystore.jks
weblogic.security.CustomTrustKeyStoreType=JKS
</jee:environment>
</jee:jndi-lookup>
<jee:jndi-lookup id="queue" jndi-name="...">
<jee:environment>
java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
java.naming.provider.url=t3s://...
java.naming.security.principal=...
java.naming.security.credentials=...
weblogic.security.SSL.ignoreHostnameVerification=true
java.protocol.handler.pkgs=weblogic.net
weblogic.security.TrustKeyStore=CustomTrust
weblogic.security.CustomTrustKeyStoreFileName=C:\\projects\\maven\\workspace\\listener\\src\\test\\resources\\wls_keystore.jks
weblogic.security.CustomTrustKeyStoreType=JKS
</jee:environment>
</jee:jndi-lookup>
But now I got another error:
Code:
11.mag.2012 13:21:29,758 - (LISTENER SERVICE) (main) [ERROR ]-[TestContextManager (324 )] - Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@1b9f88b] to prepare test instance [null(ch.integration.jms.ListenerTest)]
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:157)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109)
...
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.jms.listener.DefaultMessageListenerContainer#0':
Cannot resolve reference to bean 'connectionFactory' while setting bean property 'connectionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'connectionFactory':
Invocation of init method failed; nested exception is javax.naming.CommunicationException [Root exception is java.net.ConnectException: t3s://...:7842: Destination unreachable;
nested exception is:
javax.net.ssl.SSLKeyException: [Security:090542]Certificate chain received from ... - xxx.xxx.xxx.xxx was not trusted causing SSL handshake failure.
Check the certificate chain to determine if it should be trusted or not. If it should be trusted, then update the client trusted CA configuration to trust the CA certificate that signed the peer certificate chain.
If you are connecting to a WLS server that is using demo certificates (the default WLS server behavior), and you want this client to trust demo certificates,
then specify -Dweblogic.security.TrustKeyStore=DemoTrust on the command line for this client.; No available router to destination]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:103)
at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:1)
at org.springframework.test.context.support.DelegatingSmartContextLoader.loadContext(DelegatingSmartContextLoader.java:228)
at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:124)
at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:148)
... 28 more
I did already a succesfull test with a simple JMS java consumer using the same wls_keystore.jks file and the same other settings:
Code:
public static void retrieveMessage() {
Hashtable<String, String> properties = new Hashtable<String, String>();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
properties.put(Context.PROVIDER_URL, "...");
properties.put(Context.SECURITY_PRINCIPAL, "...");
properties.put(Context.SECURITY_CREDENTIALS, "...");
System.setProperty("weblogic.security.SSL.ignoreHostnameVerification", "true");
System.setProperty("java.protocol.handler.pkgs", "weblogic.net");
System.setProperty("weblogic.security.TrustKeyStore", "CustomTrust");
System.setProperty("weblogic.security.CustomTrustKeyStoreFileName", "C:\\projects\\maven\\workspace\\listener\\src\\test\\resources\\wls_keystore.jks");
System.setProperty("weblogic.security.CustomTrustKeyStorePassPhrase","");
System.setProperty("weblogic.security.CustomTrustKeyStoreType", "JKS");
...
so maybe I miss some settings in my above <jee:jndi-lookup> configuration.
Any help ss greatly appreciated!!!