oracle / oci-java-sdk

Oracle Cloud Infrastructure SDK for Java
https://cloud.oracle.com/cloud-infrastructure
Other
192 stars 153 forks source link

Jersey3HttpClientBuilder.java from this OCI SDK library. oci-java-sdk-common-httpclient-jersey3-3.8.0.jar is not using the right constructor #512

Closed Rashi0321 closed 1 year ago

Rashi0321 commented 1 year ago

Error : java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: http://hgbu-opera.cne-outbound-proxy.cfs.oraclecne3128/ at com.oracle.bmc.http.client.jersey3.Jersey3HttpClientBuilder.property(Jersey3HttpClientBuilder.java:176) ~[oci-java-sdk-common-httpclient-jersey3-3.8.0.jar:?] at hgbu.opera.cn.publisher.producer.StreamProducer.lambda$initClients$0(StreamProducer.java:101) ~[hgbu-opera-publisher.jar:?]

Analysis :

OCI SDK code in that class com.oracle.bmc.http.client.jersey3.Jersey3HttpClientBuilder looks buggy (URI constructor usage doesn’t seem correct): try { this.properties.put("jersey.config.client.proxy.uri", new URI(scheme, address.getHostString(), Integer.toString(address.getPort()), (String)null)); } catch (URISyntaxException var7) { throw new IllegalArgumentException(var7); } But there is another class for the same interface: com.oracle.bmc.http.client.jersey.JerseyHttpClientBuilder and its code looks good: try { this.properties.put("jersey.config.client.proxy.uri", new URI(scheme, (String)null, address.getHostString(), address.getPort(), (String)null, (String)null, (String)null)); } catch (URISyntaxException var7) { throw new IllegalArgumentException(var7); }

kishan0201 commented 1 year ago

Closing this issue as the URI constructor used in Jersey3HttpClientBuilder is fixed now (v3.17.1). Please feel free to open this, if you're still facing issues