2020-08-11T13:24:09.643386+00:00 heroku[router]: at=info method=POST path="/greeting" host=lolipopi.herokuapp.com request_id=f182ba6d-5e48-4584-ba11-094ef4301759 fwd="178.205.243.66" dyno=web.1 connect=1ms service=656ms status=500 bytes=538 protocol=https
2020-08-11T13:24:09.595504+00:00 app[web.1]: 2020-08-11 13:24:09.594 ERROR 4 --- [io-33966-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception
2020-08-11T13:24:09.595539+00:00 app[web.1]:
2020-08-11T13:24:09.595540+00:00 app[web.1]: java.io.IOException: Server returned HTTP response code: 403 for URL: https://api.qrfinex.com/v1.1/actions
2020-08-11T13:24:09.595542+00:00 app[web.1]: at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1900) ~[na:1.8.0_262-heroku]
2020-08-11T13:24:09.595542+00:00 app[web.1]: at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498) ~[na:1.8.0_262-heroku]
URL url;
URLConnection uc;
StringBuilder parsedContentFromUrl = new StringBuilder();
String urlString = "https://api.qrfinex.com/v1.1/actions";
System.out.println("Getting content for URl : " + urlString);
url = new URL(urlString);
uc = url.openConnection();
uc.connect();
uc = url.openConnection();
uc.addRequestProperty("User-Agent",
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");
uc.getInputStream();
BufferedReader in = new BufferedReader(new InputStreamReader(uc.getInputStream(), "UTF-8"));
int ch;
while ((ch = in.read()) != -1) {
parsedContentFromUrl.append((char) ch);
}
System.out.println(parsedContentFromUrl);
public class Provider {
private int id;
private String name;
private String icon;
private String web;
private String ios;
private String android;
@JsonProperty("id")
public int getId() {
return id;
}
@JsonProperty("id")
public void setId(int id) {
this.id = id;
}
@JsonProperty("name")
public String getName() {
return name;
}
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
@JsonProperty("icon")
public String getIcon() {
return icon;
}
@JsonProperty("icon")
public void setIcon(String icon) {
this.icon = icon;
}
@JsonProperty("web")
public String getWeb() {
return web;
}
@JsonProperty("web")
public void setWeb(String web) {
this.web = web;
}
@JsonProperty("ios")
public String getIos() {
return ios;
}
@JsonProperty("ios")
public void setIos(String ios) {
this.ios = ios;
}
@JsonProperty("android")
public String getAndroid() {
return android;
}
@JsonProperty("android")
public void setAndroid(String android) {
this.android = android;
}
}
public class RootObject {
private Provider[] providers;
private Actions actions;
@JsonProperty("providers")
public Provider[] getProviders() {
return providers;
}
@JsonProperty("providers")
public void setProviders(Provider[] providers) {
this.providers = providers;
}
@JsonProperty("actions")
public Actions getActions() {
return actions;
}
@JsonProperty("actions")
public void setActions(Actions actions) {
this.actions = actions;
}
}
URL url;
URLConnection uc;
StringBuilder parsedContentFromUrl = new StringBuilder();
String urlString = "https://api.qrfinex.com/v1.1/actions";
System.out.println("Getting content for URl : " + urlString);
url = new URL(urlString);
uc = url.openConnection();
uc.connect();
uc = url.openConnection();
uc.addRequestProperty("User-Agent",
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)");
uc.getInputStream();
BufferedReader in = new BufferedReader(new InputStreamReader(uc.getInputStream(), "UTF-8"));
int ch;
while ((ch = in.read()) != -1) {
parsedContentFromUrl.append((char) ch);
}
System.out.println(parsedContentFromUrl);
Gson gson = new Gson();
// 2. JSON string to Java object
RootObject response = gson.fromJson(String.valueOf(parsedContentFromUrl), RootObject.class);
System.out.println(response.getActions());
public class Actions {
private int id;
private String action;
private Actions provider;
private String date_from;
private String date_to;
private String info;
private String payment_info;
private String url;
@JsonProperty("id")
public int getId() {
return id;
}
@JsonProperty("id")
public void setId(int id) {
this.id = id;
}
@JsonProperty("action")
public String getAction() {
return action;
}
@JsonProperty("action")
public void setAction(String action) {
this.action = action;
}
@JsonProperty("provider")
public Actions getProvider() {
return provider;
}
@JsonProperty("provider")
public void setProvider(Actions provider) {
this.provider = provider;
}
@JsonProperty("date_from")
public String getDateFrom() {
return date_from;
}
@JsonProperty("date_from")
public void setDateFrom(String date_from) {
this.date_from = date_from;
}
@JsonProperty("date_to")
public String getDateTo() {
return date_to;
}
@JsonProperty("date_to")
public void setDateTo(String date_to) {
this.date_to = date_to;
}
@JsonProperty("info")
public String getInfo() {
return info;
}
@JsonProperty("info")
public void setInfo(String info) {
this.info = info;
}
@JsonProperty("payment_info")
public String getPaymentInfo() {
return payment_info;
}
@JsonProperty("payment_info")
public void setPaymentInfo(String payment_info) {
this.payment_info = payment_info;
}
@JsonProperty("url")
public String getUrl() {
return url;
}
@JsonProperty("url")
public void setUrl(String url) {
this.url = url;
}
}
public class Provider {
private int id;
private String name;
private String icon;
private String web;
private String ios;
private String android;
@JsonProperty("id")
public int getId() {
return id;
}
@JsonProperty("id")
public void setId(int id) {
this.id = id;
}
@JsonProperty("name")
public String getName() {
return name;
}
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
@JsonProperty("icon")
public String getIcon() {
return icon;
}
@JsonProperty("icon")
public void setIcon(String icon) {
this.icon = icon;
}
@JsonProperty("web")
public String getWeb() {
return web;
}
@JsonProperty("web")
public void setWeb(String web) {
this.web = web;
}
@JsonProperty("ios")
public String getIos() {
return ios;
}
@JsonProperty("ios")
public void setIos(String ios) {
this.ios = ios;
}
@JsonProperty("android")
public String getAndroid() {
return android;
}
@JsonProperty("android")
public void setAndroid(String android) {
this.android = android;
}
}
public class RootObject {
private Provider[] providers;
private Actions actions;
@JsonProperty("providers")
public Provider[] getProviders() {
return providers;
}
@JsonProperty("providers")
public void setProviders(Provider[] providers) {
this.providers = providers;
}
@JsonProperty("actions")
public Actions getActions() {
return actions;
}
@JsonProperty("actions")
public void setActions(Actions actions) {
this.actions = actions;
}
}
@Transactional
@PostMapping("/removeproduct")
public String removeAdminProduct(@RequestParam String removname, Map<String, Object> model){
System.out.println("_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_");
System.out.println(removname);
List<AdminProductions> adp = adminProductRepo.findByAdminproductname(removname);
for(AdminProductions ad : adp){
adminProductRepo.deleteById(ad.getId());
System.out.println(ad.getId() +" : "+ad.getAdminproductname());
}
Iterable<AdminProductions> adminproductions = adminProductRepo.findAll();
model.put("adminproductions", adminproductions);
return "removeproduct";
}