Using the REST API Extension and getting "component class is null" on clean install of 2021.[12]
Going through the tutorial to deploy a REST API extension:
https://documentation.bonitasoft.com/bonita/2021.1/rest-api-extensions
On completion, calling the service had no data in the response. Looking to the logs, found the following:
INFO (http-nio-8080-exec-1) org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/bonita] RestletServlet: [Restlet] ServerServlet: component class is null
Found an already existing question:
https://community.bonitasoft.com/questions-and-answers/restlet-serverservlet-component-class-null
but this was from 2015 and referenced JBoss, which I am not using.
The initial tests were using Bonita Studio, but also tested on fresh docker deployments of both 2021.1 ("FROM bonita:2021.1") and 2021.2 ("FROM bonita:2021.2"), but getting the same result on all three.
Any help would be appreciated.
---
OS used is Fedora 33, fully updated. Default installed Java is reporting as:
openjdk version "11.0.13" 2021-10-19 OpenJDK Runtime Environment 18.9 (build 11.0.13+8) OpenJDK 64-Bit Server VM 18.9 (build 11.0.13+8, mixed mode, sharing)
and inside "BonitaStudioCommunity-2021.1/jre/bin" reporting as:
openjdk version "11.0.8" 2020-07-14 OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10) OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.8+10, mixed mode)
Comments
Hi,
As the log is in
INFO
I'm not sure that it explains the cause of your issue. Can you give us more information (logs, request status in the browser dev mode...etc) ?Romain
The following is from a fresh start via Bonita Studio, without `INFO` lines:
When using `curl` to test the API, there are no additional log events, but nothing is returned:
I also get the same if I use the following:
Or indeed anything stemming from this.
Advise if additional info is required.
You get a 401 because you need to pass the authentication header in your curl request.
You might just want to use a web browser a log in to the user app, and then just call the http://localhost:808/bonita/API/extension/userInformation?p=0&c=10 directly from the browser url.
Using dev tools will provide additional information on the request (status, header, response...etc)
Whoops. Missed that! Exactly the same in the browser, I was testing without logging in. Once logged in, all good.
Thank you for that, much appreciate the assistance leading the blind. Wood for trees and missed that it was returning a `401`
Glad it was just that !
Have fun