syndesisio / syndesis-rest

The API for Syndesis - a flexible, customizable, cloud-hosted platform that provides core integration capabilities as a service. It leverages Red Hat's existing product architecture using OpenShift Online/Dedicated and Fuse Integration Services.
https://syndesis-staging.b6ff.rh-idev.openshiftapps.com/api/v1/
Apache License 2.0
6 stars 17 forks source link

ClassNotFoundException: okhttp3.TlsVersion #129

Closed iocanel closed 7 years ago

iocanel commented 7 years ago

Exception in thread "main" java.lang.reflect.InvocationTargetException 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.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) Caused by: java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.context.ApplicationContextInitializer : io.fabric8.spring.cloud.kubernetes.profile.KubernetesApplicationContextInitializer at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:423) at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:402) at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:393) at org.springframework.boot.SpringApplication.initialize(SpringApplication.java:260) at org.springframework.boot.SpringApplication.(SpringApplication.java:236) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1162) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1151) at com.redhat.ipaas.runtime.Application.main(Application.java:35) ... 8 more Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.fabric8.spring.cloud.kubernetes.profile.KubernetesApplicationContextInitializer]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: okhttp3/TlsVersion at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:154) at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:419) ... 15 more Caused by: java.lang.NoClassDefFoundError: okhttp3/TlsVersion at io.fabric8.kubernetes.client.Config.(Config.java:127) at io.fabric8.kubernetes.client.ConfigBuilder.(ConfigBuilder.java:16) at io.fabric8.kubernetes.client.ConfigBuilder.(ConfigBuilder.java:13) at io.fabric8.kubernetes.client.BaseClient.(BaseClient.java:37) at io.fabric8.kubernetes.client.DefaultKubernetesClient.(DefaultKubernetesClient.java:107) at io.fabric8.spring.cloud.kubernetes.profile.KubernetesApplicationContextInitializer.(KubernetesApplicationContextInitializer.java:35) 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.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:142) ... 16 more Caused by: java.lang.ClassNotFoundException: okhttp3.TlsVersion at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:94) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 27 more

jimmidyson commented 7 years ago

When do you get this?

iocanel commented 7 years ago

I am running the system tests, which actually create the following template:

https://raw.githubusercontent.com/redhat-ipaas/openshift-templates/master/redhat-ipaas-single-tenant.yml

This error occurs in the logs of the ipaas-rest pod.

jimmidyson commented 7 years ago

Wondering if this is caused by @chirino's https://github.com/redhat-ipaas/ipaas-rest/pull/125#pullrequestreview-24127667

chirino commented 7 years ago

It likely is. Should go away when we get the latest k8s clients in. Or we could disable the ws tests.

iocanel commented 7 years ago

@chirino: just removing the test scope from okhttp was enough :-)

chirino commented 7 years ago

ok thx!

jimmidyson commented 7 years ago

So we should remove the deps now, right? Just inherit from kube client?

chirino commented 7 years ago

yeah

jimmidyson commented 7 years ago

Done in https://github.com/redhat-ipaas/ipaas-rest/pull/133