Skip to content

Commit 11faf92

Browse files
committed
Remove dependency on SVM class.
This dependency caused: java.lang.ClassNotFoundException: com.oracle.svm.core.jdk.UnsupportedFeatureError when using the RestClient in HotSpot mode
1 parent 3ee2981 commit 11faf92

File tree

1 file changed

+5
-4
lines changed
  • extensions/rest-client/runtime/src/main/java/org/jboss/shamrock/restclient/runtime

1 file changed

+5
-4
lines changed

extensions/rest-client/runtime/src/main/java/org/jboss/shamrock/restclient/runtime/RestClientBase.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
import org.eclipse.microprofile.config.ConfigProvider;
2424
import org.eclipse.microprofile.rest.client.RestClientBuilder;
2525

26-
import com.oracle.svm.core.jdk.UnsupportedFeatureError;
27-
2826
public class RestClientBase {
2927

3028
public static final String REST_URL_FORMAT = "%s/mp-rest/url";
@@ -45,8 +43,11 @@ public Object create() {
4543
return builder.baseUrl(new URL(baseUrl)).build(proxyType);
4644
} catch (MalformedURLException e) {
4745
throw new IllegalArgumentException("The value of URL was invalid " + baseUrl);
48-
} catch (UnsupportedFeatureError e) {
49-
throw new IllegalArgumentException(baseUrl + " requires SSL support but it is disabled. You probably have set shamrock.ssl.native to false.");
46+
} catch (Exception e) {
47+
if ("com.oracle.svm.core.jdk.UnsupportedFeatureError".equals(e.getClass().getCanonicalName())) {
48+
throw new IllegalArgumentException(baseUrl + " requires SSL support but it is disabled. You probably have set shamrock.ssl.native to false.");
49+
}
50+
throw e;
5051
}
5152
}
5253

0 commit comments

Comments
 (0)