No answer for access token request

Hello, i’m creating a sample project for the Rest API service, and can’t move through the first step of the 7.1 REST API manual. i decided to take a screenshot for you.


here’s the story:
i add the restapi dependency, run the app, copy-paste POST request and get an empty response… can u please help me, where to dig?

Hi, it should work.
Try to create a new project with the REST API addon again. If the problem still persists there, check the log for errors and then attach the project here.

the project i show on a screenshot is an empty sample project. i can attach it here restsample.zip (303.5 KB)
i may be missing something important, but i can’t see what…

What I see is that at least restapi component is not mentioned in your web.xml. There should be something like this:

    <context-param>
        <param-name>appComponents</param-name>
        <param-value>com.haulmont.cuba com.haulmont.addon.restapi</param-value>
    </context-param>

I don’t know what went wrong when you created the project, but if modifying the web.xml won’t help, then, as I already adviced you, try to create a new project from scratch using the latest bugfix releases of platform and restapi addon.

probably that happened, cos i added plugin not by clicking-studio-menus, but by adding a dependency manually to build.gradle. anyhow, i added a param value and now api responds, it says: "error":"server_error","error_description":"Internal Server Error" and catalina.out has a warn message: Handling error: IlleagalArgumentException, Service sample-core/restapi_ServerTokenStore is not regigtered in LocalServiceDirectory
i still blame the manual plugin installation, but infortunately i can’t use online addon installation, cos i’m inside a close corporate network( and yes, as i said - it’s still a completely-brand-new-sample-project-made-to-test-rest-api)))

Did you add the param-value to both web.xml files?

1 Like

my bad. now as i add it to both files - i get the token, thank you