[
https://issues.apache.org/jira/browse/CAMEL-9893?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen resolved CAMEL-9893.
--------------------------------
Resolution: Invalid
Assignee: Claus Ibsen
And please use the user forum / user mailing list to get help first.
> Camel Jetty SSL ClassCastException for SSLContextParametersFactoryBean
> ----------------------------------------------------------------------
>
> Key: CAMEL-9893
> URL: https://issues.apache.org/jira/browse/CAMEL-9893
> Project: Camel
> Issue Type: Bug
> Components: camel-jetty
> Affects Versions: 2.17.0
> Environment: Mac OS / DEV
> Reporter: Mujahed Syed
> Assignee: Claus Ibsen
> Attachments: core.log
>
>
> Hi Team,
> I am trying to create Jetty configuration with SSL. Here is my configuration:
> {code}
> @Bean(name = "jetty")
> public JettyHttpComponent jetty(CamelContext camelContext){
> JettyHttpComponent jettyComponent =
> camelContext.getComponent("jetty", JettyHttpComponent.class);
> jettyComponent.setSslContextParameters(sslContextParameters());
> return jettyComponent;
> }
> @Bean(name = "sslContextParameters")
> public SSLContextParameters sslContextParameters(){
> KeyStoreParameters ksp = new KeyStoreParameters();
> ksp.setResource(KEYSTORE);
> ksp.setPassword(KEYSTORE_PASSWORD);
> KeyManagersParameters kmp = new KeyManagersParameters();
> kmp.setKeyPassword(KEYSTORE_PASSWORD);
> kmp.setKeyStore(ksp);
> TrustManagersParameters tmp = new TrustManagersParameters();
> tmp.setKeyStore(ksp);
> SSLContextParameters sslContextParameters = new
> SSLContextParameters();
> sslContextParameters.setKeyManagers(kmp);
> sslContextParameters.setTrustManagers(tmp);
> return sslContextParameters;
> }
> {code}
> If I load this configuration I get exception stating that:
> Caused by: java.lang.ClassCastException:
> org.apache.camel.util.spring.SSLContextParametersFactoryBean$$EnhancerBySpringCGLIB$$57d06d22
> cannot be cast to org.apache.camel.util.jsse.SSLContextParameters
> at
> com.xxx.config.DevConfiguration$$EnhancerBySpringCGLIB$$1bb53ad4.sslContextParameters(<generated>)
> at com.xxx.config.DevConfiguration.jetty(DevConfiguration.java:45)
> at
> com.xxx.config.DevConfiguration$$EnhancerBySpringCGLIB$$1bb53ad4.CGLIB$jetty$0(<generated>)
> at
> com.xxx.config.DevConfiguration$$EnhancerBySpringCGLIB$$1bb53ad4$$FastClassBySpringCGLIB$$a8257ab2.invoke(<generated>)
> at
> org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
> at
> org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:355)
> at
> com.xxxx.config.DevConfiguration$$EnhancerBySpringCGLIB$$1bb53ad4.jetty(<generated>)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at
> org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
> ... 62 more
> This looks like a bug to me, because the class JettyHttpComponent has a
> setter setSslContextParameters(SSLContextParameters sslContextParameters) the
> parameter is of type org.apache.camel.util.jsse.SSLContextParameters and when
> we package and run this it expects a parameter of type
> org.apache.camel.util.spring.SSLContextParametersFactoryBean I have attached
> complete log file.
> Please let me know if you can point me to some direction.
> Thank you,
> Mujahed
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)