masteryoda Posted July 23, 2013 Share Posted July 23, 2013 the example given here -- http://community.jaspersoft.com/wiki/getting-started-rest-web-service-api is not working . i have done everything mentioned there but it is giving this error E:restapicodesample>mvn test[iNFO] Scanning for projects...[iNFO][iNFO] ------------------------------------------------------------------------[iNFO] Building REST Code Sample 1.0-SNAPSHOT[iNFO] ------------------------------------------------------------------------[WARNING] The artifact org.apache.commons:commons-io:jar:1.3.2 has been relocated to commons-io:commons-io:jar:1.3.2[iNFO][iNFO] --- maven-resources-plugin:2.6:resources (default-resources) @ RESTCodeSample ---[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent![iNFO] skip non existing resourceDirectory E:restapicodesamplesrcmainresources[iNFO][iNFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ RESTCodeSample ---[iNFO] Nothing to compile - all classes are up to date[iNFO][iNFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ RESTCodeSample ---[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent![iNFO] skip non existing resourceDirectory E:restapicodesamplesrctestresources[iNFO][iNFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ RESTCodeSample ---[iNFO] Nothing to compile - all classes are up to date[iNFO][iNFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ RESTCodeSample ---[iNFO] Surefire report directory: E:restapicodesampletargetsurefire-reports ------------------------------------------------------- T E S T S-------------------------------------------------------Running com.jaspersoft.jasperserver.rest.sample.BasicResourceCRUDTestlog4j:WARN No appenders could be found for logger (com.jaspersoft.jasperserver.rest.sample.RestAPIUtils).log4j:WARN Please initialize the log4j system properly. INFO [com.jaspersoft.jasperserver.rest.sample.RestAPIUtils] sending Request. url: http://localhost:8080/jasperserver-pro/rest/resource req verb: PUT INFO [com.jaspersoft.jasperserver.rest.sample.RestAPIUtils] response status line: HTTP/1.1403 ForbiddenTests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.353 sec <<< FAILURE!com.jaspersoft.jasperserver.rest.sample.BasicResourceCRUDTest Time elapsed: 0.353 sec <<<FAILURE!java.lang.AssertionError: basic response check did not pass at org.junit.Assert.fail(Assert.java:91) at org.junit.Assert.assertTrue(Assert.java:43) at com.jaspersoft.jasperserver.rest.sample.RestAPIUtils.sendAndAssert(RestAPIUtils.java:123) at com.jaspersoft.jasperserver.rest.sample.RestAPIUtils.sendAndAssert(RestAPIUtils.java:117) at com.jaspersoft.jasperserver.rest.sample.BasicResourceCRUDTest.setUp(BasicResourceCRUDTest.java:47) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.junit.runners.ParentRunner.run(ParentRunner.java:236) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75) Results : Failed tests: com.jaspersoft.jasperserver.rest.sample.BasicResourceCRUDTest: basic response check did not pass Tests run: 1, Failures: 1, Errors: 0, Skipped: 0 [iNFO] ------------------------------------------------------------------------[iNFO] BUILD FAILURE[iNFO] ------------------------------------------------------------------------[iNFO] Total time: 1.538s[iNFO] Finished at: Tue Jul 23 18:11:36 IST 2013[iNFO] Final Memory: 7M/111M[iNFO] ------------------------------------------------------------------------[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project RESTCodeSample: There are test failures.[ERROR][ERROR] Please refer to E:restapicodesampletargetsurefire-reports for the individual test results.[ERROR] -> [Help 1][ERROR][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][ERROR] For more information about the errors and possible solutions, please read the following articles:[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExceptionE:restapicodesample> //------------------------------------------------------------------------- Link to comment Share on other sites More sharing options...
pssp25 Posted July 23, 2013 Share Posted July 23, 2013 Hi materyoda,It seems that the test should login first.The 403 Forbidden message that your getting means that no authentication has been performed.Can walso mean that credentials from tests are wrong.Please check if all that credentials match.kind regards,Paulo Link to comment Share on other sites More sharing options...
masteryoda Posted July 23, 2013 Author Share Posted July 23, 2013 Hi pssp25 I have logged in using the username- jasperadmin and password- jasperadmin as specified in the Consts.java of the example. and i have also checked the credentials from the test. but still it is not working. i am new to jasperserver and have read the documents but cannot figure out what is the problem ... please any suggestions.... Link to comment Share on other sites More sharing options...
pssp25 Posted July 23, 2013 Share Posted July 23, 2013 Should be OK! Are you passing any organization!? Kind regards, Paulo Link to comment Share on other sites More sharing options...
pssp25 Posted July 24, 2013 Share Posted July 24, 2013 I used the following parameters to do a successful login: 1) orgId 2) j_username 3) j_password 4) j_password_pseudo Example of Login. Login Link HTML file with button and link to automatically login. Not that the credentials are in the HTML file. This is not SSO. Link to comment Share on other sites More sharing options...
chitoan Posted July 24, 2013 Share Posted July 24, 2013 I am also trying to run the same sample codes and having the same error. I've used default credentials: j_username=jasperadmin and j_password=jasperadmin.Please help.Thank youToan Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now