I am trying to call the IBM Watson Service via REST call in Java. I have got an Web Project in Eclipse which is published via Bluemix Tools. I also use the .jar Files. But when i´m trying a simple code like:
LanguageTranslation service = new LanguageTranslation();
service.setUsernameAndPassword("{username}","{password}");
List <IdentifiedLanguage> langs = service.identify("this is a test");
System.out.println(langs);
I get this exception:
Unable to extract the trust manager on okhttp3.internal.Platform@ab895790, sslSocketFactory is class com.ibm.jsse2.SSLSocketFactoryImpl
[WARNING ] Application {http://webapp.aw/}ResourceServlet has thrown exception, unwinding now
[WARNING ] Exception in handleFault on interceptor org.apache.cxf.jaxrs.interceptor.JAXRSDefaultFaultOutInterceptor@ac51d486
Unable to extract the trust manager on okhttp3.internal.Platform@ab895790, sslSocketFactory is class com.ibm.jsse2.SSLSocketFactoryImpl
Unable to extract the trust manager on okhttp3.internal.Platform@ab895790, sslSocketFactory is class com.ibm.jsse2.SSLSocketFactoryImpl
There seems to be some incompatibility with the JVM used on Bluemix and this latest (3.0.0.RC1) version of the library.
I can run the sample code locally just fine. Just not on Bluemix.
My workaround is to use the older 2.10 version of the library:
https://github.com/watson-developer-cloud/java-sdk/releases/tag/java-sdk-2.10.0
Everything works fine there (however you need to remove the .execute() from the end of the translate call to be compatible with older library).