killbill-client-java icon indicating copy to clipboard operation
killbill-client-java copied to clipboard

API classes' constructors using the default KillBillHttpClient constructor cause 404 because of bad url formatting

Open HoucemEdHr opened this issue 11 months ago • 0 comments

So API classes (TenantApi for instance) have default constructors that call the default constructor of KillBillHttpClient. The latter relies on system properties or fallback values to init some fileds namely the KillBillHttpClient's kbServerUrl field, so if the system property "killbill.url" isn't set, the fallback value "http://127.0.0.1:8080/" is used instead and since each api has a uri(path) looking like this "/1.0/kb/tenants" , so this line "u = new URI(String.format("%s%s", this.kbServerUrl, url));" in KillBillHttpClient.getURI() is causing the url used in request to look like this "http://127.0.0.1:8080//1.0/kb/tenants" (notice the // after port), this is causing every request to return null (404 not found) ,as a fix when I set the system property killbill.url to "http://127.0.0.1:8080", requests are successful ! #version1.3.8

HoucemEdHr avatar Mar 17 '25 13:03 HoucemEdHr