Skip to content

Commit

Permalink
Remove dependency on SVM class.
Browse files Browse the repository at this point in the history
This dependency caused:

java.lang.ClassNotFoundException:
com.oracle.svm.core.jdk.UnsupportedFeatureError

when using the RestClient in HotSpot mode
  • Loading branch information
geoand committed Feb 4, 2019
1 parent 3ee2981 commit 28f0692
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@

package org.jboss.shamrock.restclient.runtime;

import java.net.MalformedURLException;
import java.net.URL;

import org.eclipse.microprofile.config.Config;
import org.eclipse.microprofile.config.ConfigProvider;
import org.eclipse.microprofile.rest.client.RestClientBuilder;

import com.oracle.svm.core.jdk.UnsupportedFeatureError;
import java.net.MalformedURLException;
import java.net.URL;

public class RestClientBase {

Expand All @@ -45,8 +43,11 @@ public Object create() {
return builder.baseUrl(new URL(baseUrl)).build(proxyType);
} catch (MalformedURLException e) {
throw new IllegalArgumentException("The value of URL was invalid " + baseUrl);
} catch (UnsupportedFeatureError e) {
throw new IllegalArgumentException(baseUrl + " requires SSL support but it is disabled. You probably have set shamrock.ssl.native to false.");
} catch (Exception e) {
if ("com.oracle.svm.core.jdk.UnsupportedFeatureError".equals(e.getClass().getCanonicalName())) {
throw new IllegalArgumentException(baseUrl + " requires SSL support but it is disabled. You probably have set shamrock.ssl.native to false.");
}
throw e;
}
}

Expand Down

0 comments on commit 28f0692

Please sign in to comment.