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 5, 2019
1 parent 386394f commit 54b5cf3
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
import org.eclipse.microprofile.config.ConfigProvider;
import org.eclipse.microprofile.rest.client.RestClientBuilder;

import com.oracle.svm.core.jdk.UnsupportedFeatureError;

public class RestClientBase {

public static final String REST_URL_FORMAT = "%s/mp-rest/url";
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 54b5cf3

Please sign in to comment.