Closed RaviTeja457 closed 10 years ago
Hi, what version of JRS are you using?
jrs-rest-java-client 5.5.0-SNAPSHOT
I mean JasperReports server, not REST client.
Hi Borys Kolesnykov,
Thank you for replying
I am using aws(Amazon AMI instance) jasper server and my dependencies are as follows
javaee-api , reasteasy-JAXRS , jrs-rest-java-client
Apart from these i am not using anything
Maybe, here is some misunderstanding. I would like to know exactly version of your JasperReports server, it can be v4.7.0, v5.0.0, v5.1.0, v5.2.0, v5.5.0 or earlier. I'm talking about server side, not about application where you are using REST client.
Oh Sorry the server version is Version 5.5.0
Hi Borys Kolesnykov,
Is any dependecies are missing or i need to do any more configuration
Currently I'm trying to reproduce this error, but still have no success. Could you give me a link to your jasperserver and some test credentials, if your security policy allows?
http://ec2-54-214-135-73.us-west-2.compute.amazonaws.com/jasperserver-pro uname : demo pwd : demo
Ok, I tried to reproduce error with your server instance but haven't succeed. Report "/reports/samples/Cascading_multi_select_report" doesn't exists in your JRS instance and it correctly throws ResourceNotFoundException with this stack trace
Exception in thread "main" com.jaspersoft.jasperserver.jaxrs.client.core.exceptions.ResourceNotFoundException: Resource URI:/reports/samples/Cascading_multi_select_report Type:com.jaspersoft.jasperserver.api.metadata.common.domain.InputControlsContainer not found
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.jaspersoft.jasperserver.jaxrs.client.core.exceptions.handling.DefaultErrorHandler.handleBodyError(DefaultErrorHandler.java:90)
at com.jaspersoft.jasperserver.jaxrs.client.apiadapters.reporting.RunReportErrorHandler.handleBodyError(RunReportErrorHandler.java:38)
at com.jaspersoft.jasperserver.jaxrs.client.core.exceptions.handling.DefaultErrorHandler.handleError(DefaultErrorHandler.java:59)
at com.jaspersoft.jasperserver.jaxrs.client.core.JerseyRequest.executeRequest(JerseyRequest.java:168)
at com.jaspersoft.jasperserver.jaxrs.client.core.JerseyRequest.executeRequest(JerseyRequest.java:143)
at com.jaspersoft.jasperserver.jaxrs.client.core.JerseyRequest.get(JerseyRequest.java:109)
at com.jaspersoft.jasperserver.jaxrs.client.apiadapters.reporting.RunReportAdapter.run(RunReportAdapter.java:69)
at Test.main(Test.java:11)
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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
But I tried same operation with existed report "/public/Samples/Reports/9g.CustomerDetailReport" and everything works for me.
RestClientConfiguration configuration = new RestClientConfiguration("http://ec2-54-214-135-73.us-west-2.compute.amazonaws.com/jasperserver-pro");
JasperserverRestClient client = new JasperserverRestClient(configuration);
OperationResult result = client
.authenticate("demo", "demo")
.reportingService()
.report("/public/Samples/Reports/9g.CustomerDetailReport")
.prepareForRun(ReportOutputFormat.HTML, 1)
.parameter("project_id", "2")
.run();
System.out.println(result.getEntity());
Please provide me with full stack trace of the error.
Thank you sir Could you send me the example you tried
Maybe there is some conflict of libraries in your project and in jrs-rest-client. Try to execute this code separately, not within your web app.
Give me please your email to send an example
ravi.teja@ariveguru.com
I think i found an error. Change your jersey dependency on this one
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<!-- if your container implements Servlet API older than 3.0, use "jersey-container-servlet-core" -->
<artifactId>jersey-container-servlet</artifactId>
<version>2.5</version>
</dependency>
Could you please send me the code you tried, I hope it helps me lot
I've sent, but firstly try to change dependency. I'm almost sure that it will solve your problem.
Hi boryskolesnykov,
I tried with the example code what you sent , It is working good . But same thing when i use for restful same exception is coming . Please find the attachment as my example code .
My environment is JBOSS - 7.1
Hi sir ,
I sent the log and example code as an email to borys.kolesnikov@gmail.com
Hi RaviTeja457,
JBOSS has its own implementation of JAX-RS API (RestEasy) and it conflicts with implementation which is used by jrs-rest-client (Jersey). So it's a bug and it will be fixed as soon as possible.
But you can use Tomcat, it doesn't contain any implementations of Java EE specifications and it won't conflict with jrs-rest-client.
Hi RaviTeja457,
JBoss uses old version of JAX-RS API, but jrs-rest-client uses a new one. So, to resolve this conflict you need to exclude an old version from JBoss, you can do it by adding jboss-deployment-structure.xml
file to either /META-INF
or /WEB-INF
directory
<jboss-deployment-structure>
<deployment>
<exclusions>
<!-- Exclude JAVA EE of JBOSS (javax.ws..) => Add dependency javax.annotation -->
<module name="javaee.api" />
<!-- Exclude RestEasy conflict (javax.ws.rs.ext.RunDelegate) -->
<module name="javax.ws.rs.api"/>
<module name="org.codehaus.jackson.jackson-core-asl" />
<module name="org.jboss.resteasy.resteasy-atom-provider" />
<module name="org.jboss.resteasy.resteasy-cdi" />
<module name="org.jboss.resteasy.resteasy-crypto" />
<module name="org.jboss.resteasy.resteasy-jackson-provider" />
<module name="org.jboss.resteasy.resteasy-jaxb-provider" />
<module name="org.jboss.resteasy.resteasy-jaxrs" />
<module name="org.jboss.resteasy.resteasy-jettison-provider" />
<module name="org.jboss.resteasy.resteasy-jsapi" />
<module name="org.jboss.resteasy.resteasy-json-p-provider" />
<module name="org.jboss.resteasy.resteasy-multipart-provider" />
<module name="org.jboss.resteasy.resteasy-validator-provider-11" />
<module name="org.jboss.resteasy.resteasy-yaml-provider" />
</exclusions>
</deployment>
</jboss-deployment-structure>
Also, I've sent you a small demo web application as an example on your email.
Hi
I added the dependency and repositories as follows
And my code is as below RestClientConfiguration configuration = new RestClientConfiguration("http://localhost:8080/jasperserver"); JasperserverRestClient client = new JasperserverRestClient(configuration); OperationResult result = client
.authenticate("superuser", "ariveguru")
.reportingService()
.report("/reports/samples/Cascading_multi_select_report")
.prepareForRun(ReportOutputFormat.HTML, 1)
.parameter("project_id", "2")
.run();
result.getEntity();
I got the following error ,Please help me out
javax.ws.rs.ProcessingException: javax.ws.rs.core.Response$Status$Family.familyOf(I)Ljavax/ws/rs/core/Response$Status$Family;