Skip to content

Caused by: com.gooddata.GoodDataRestException: 415: [request_id=xyz] Content type 'application/xml;charset=UTF-8' not supported #837

Description

@BenDol

Having trouble getting the Afm execution working.
Caused by: com.gooddata.GoodDataRestException: 415: [request_id=tzRYVbhAWy3Z8aTS] Content type 'application/xml;charset=UTF-8' not supported

ProjectinsclixProject = goodDataService.getProjectService().getProjectById("XYZ");
ExecuteAfmServiceexecuteAfmService = goodDataService.getExecuteAfmService();
MetadataServicemetadataService = goodDataService.getMetadataService();
Attributeattr = metadataService.getObj(insclixProject, Attribute.class, Restriction.title("PaymentMethod"));
Metricmetric = metadataService.getObj(insclixProject, Metric.class, Restriction.title("@NetUnits"));
Afmafm = newAfm()
// How
.addAttribute(newAttributeItem(newIdentifierObjQualifier(attr.getDefaultDisplayForm().getIdentifier()), "a1"))
// What
.addMeasure(newMeasureItem(newSimpleMeasureDefinition(newUriObjQualifier(metric.getUri())), "m1"));
// TODO FilterExecutionexecution = newExecution(afm);
ExecutionResponseresponse = executeAfmService.executeAfm(insclixProject, execution);
logger.info(response.getExecutionResultUri());
logger.info(response.toString());

Results in:

java.lang.IllegalStateException: Failed to execute CommandLineRunner
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:816)
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:797)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:324)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
at com.insclix.dashboard.EmbeddedWebApplication.main(EmbeddedWebApplication.java:54)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:67)
Caused by: com.gooddata.GoodDataException: Unable to execute AFM
at com.gooddata.sdk.service.executeafm.ExecuteAfmService.executeAfm(ExecuteAfmService.java:77)
at com.insclix.dashboard.DevIntitializer.lambda$testData$0(DevIntitializer.java:103)
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:813)
... 10 common frames omitted
Caused by: com.gooddata.GoodDataRestException: 415: [request_id=e0WU2jcSXi0r9LAb] Content type 'application/xml;charset=UTF-8' not supported
at com.gooddata.sdk.service.util.ResponseErrorHandler.handleError(ResponseErrorHandler.java:55)
at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63)
at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:778)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:736)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:670)
at org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:414)
at com.gooddata.sdk.service.executeafm.ExecuteAfmService.executeAfm(ExecuteAfmService.java:71)
... 12 common frames omitted

I wasn't able to find any resource on this particular issue.
Any help is appreciated.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions