How to run the sample program given in Getting Started with REST Web Service API?

As it was mentioned in  Example -> executing the sample code i did mvn test i am getting the following


log4j:WARN No appenders could be found for logger (
log4j:WARN Please initialize the log4j system properly.
 INFO [] sending Request. url: http://localhost:8080/jasperserver-pro/rest/resource req verb: PUT
 INFO [] response status line: HTTP/1.1 403 Forbidden
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 2.538 sec <<< FAILURE!
Results :
Failed tests: basic response check did not pass
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.809s
[INFO] Finished at: Fri Jun 21 10:54:18 IST 2013
[INFO] Final Memory: 7M/106M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-test) on project RESTCodeSample: There are test failures.
[ERROR] Please refer to C:\Users\BizAct20\Desktop\restapicodesample\target\surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] For more information about the errors and possible solutions, please read the following articles:
can any one help me 



ganesh.simhadri's picture
Joined: Jun 18 2013 - 3:46am
Last seen: 8 years 7 months ago

2 Answers:

Did you perhaps run the test twice? It creates a folder on the jasperserver, which won´t be deleted automatically. So, before re-running, you have to delete by yourself the folder.

If not, did you check the login credentials? Maybe you changed username and/or password on jasperserver? You would have to change this in the sample package too, there is a class with constants including username and password somewhere.

Cheers, Thomas

Thomas Zimmer's picture
Joined: Oct 2 2012 - 1:35am
Last seen: 10 hours 41 min ago

For the first time itself it reported failure. and my login username and password are similar to jasperserver.

thanks for responding.

ganesh.simhadri - 9 years 9 months ago

Answering my self the problem is due to embedded maven in eclipse 

Have a look at the following link



ganesh.simhadri's picture
Joined: Jun 18 2013 - 3:46am
Last seen: 8 years 7 months ago