retrievercommunications / docker-jasperserver

Docker image for the community edition of JasperReports® Server.
https://hub.docker.com/r/retriever/jasperserver/
MIT License
46 stars 50 forks source link

Rest V2 API #16

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hi.

I've been trying to access the reports through the rest API. As stated here: https://community.jaspersoft.com/documentation/jasperreports-server-web-services-guide/v56/rest-server-information. Every time I call one endpoint I just get 404.

I searched and tried different things to solve this issue. Looks like the endpoints are not available on Tomcat. I was wondering if this could be related to the configuration to force the jasperserver to run as the default application.

I have checked the config file and the rest_v2 endpoint is configured there.

Thanks for your work. This is a really good project and it's helping a lot.

Let me know if I can help with something.

grange74 commented 6 years ago

Hi @andrevasconcellos, I've just tried to reach the APIs on my machine and i can access them. As you say it may be related to it being changed to the default application. The documentation says http://<host>:<port>/jasperserver[-pro]/rest_v2/serverInfo but as the application is running as the root application, it should just be http://<host>:<port>/rest_v2/serverInfo for this container.

Can you specify what is the URL you are trying to hit and getting the 404?

The test i performed was using the following curl command and it returned the following JSON:

curl -H "Accept: application/json" 'http://localhost:8080/rest_v2/serverInfo'
{"dateFormatPattern":"yyyy-MM-dd","datetimeFormatPattern":"yyyy-MM-dd'T'HH:mm:ss","version":"6.4.0","edition":"CE","build":"BUILD_DATE_STAMP_BUILD_TIME_STAMP"}

Hope this helps. Very happy to hear that other people are benefitting from the project.

ghost commented 6 years ago

Hi @grange74 . Thanks for the help. That was a mistake. I gave the answer in the question, but I haven't figure that out until today. I spent too much time searching for errors on the configuration files.

You are right! The problem was the path.

Sorry to waste your time with such a noob question.

grange74 commented 6 years ago

You're welcome. Btw I don't see it as a waste of time at all. It happens to every developer. Many times I've been looking at a problem for a long time and the answer is staring at me but i can't see it until either i leave the problem for a while or I ask someone else. While I sometimes feel stupid when the answer is pointed out but I feel grateful and happy to help others as i know how frustrating and time consuming these issues can be. In most case i regret not asking sooner. Don't hesitate to raise more issues. Take care.