Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

javax.ws.rs.ProcessingException: javax.ws.rs.core.Response$Status #11

Closed
RaviTeja457 opened this issue Apr 4, 2014 · 22 comments
Closed

Comments

@RaviTeja457
Copy link

Hi

I added the dependency and repositories as follows

com.jaspersoft jrs-rest-java-client 5.5.0-SNAPSHOT
<repositories>

    <repository>
        <id>jaspersoft-clients-releases</id>
        <name>Jaspersoft clients releases</name>
        <url>http://jaspersoft.artifactoryonline.com/jaspersoft/jaspersoft-clients-releases</url>
    </repository>

    <repository>
        <id>jaspersoft-clients-snapshots</id>
        <name>Jaspersoft clients snapshots</name>
        <url>http://jaspersoft.artifactoryonline.com/jaspersoft/jaspersoft-clients-snapshots</url>
    </repository>

</repositories>

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;

@boryskolesnykov
Copy link
Contributor

Hi, what version of JRS are you using?

@RaviTeja457
Copy link
Author

jrs-rest-java-client
5.5.0-SNAPSHOT

@boryskolesnykov
Copy link
Contributor

I mean JasperReports server, not REST client.

@RaviTeja457
Copy link
Author

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

@boryskolesnykov
Copy link
Contributor

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.

@RaviTeja457
Copy link
Author

Oh Sorry the server version is Version 5.5.0

@RaviTeja457
Copy link
Author

Hi Borys Kolesnykov,

Is any dependecies are missing or i need to do any more configuration

@boryskolesnykov
Copy link
Contributor

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?

@RaviTeja457
Copy link
Author

@boryskolesnykov
Copy link
Contributor

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());

@boryskolesnykov
Copy link
Contributor

Please provide me with full stack trace of the error.

@RaviTeja457
Copy link
Author

Thank you sir
Could you send me the example you tried

@boryskolesnykov
Copy link
Contributor

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.

@boryskolesnykov
Copy link
Contributor

Give me please your email to send an example

@RaviTeja457
Copy link
Author

ravi.teja@ariveguru.com

@boryskolesnykov
Copy link
Contributor

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>

@RaviTeja457
Copy link
Author

Could you please send me the code you tried, I hope it helps me lot

@boryskolesnykov
Copy link
Contributor

I've sent, but firstly try to change dependency. I'm almost sure that it will solve your problem.

@RaviTeja457
Copy link
Author

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

@RaviTeja457 RaviTeja457 changed the title javax.ws.rs.ProcessingException: javax.ws.rs.ProcessingException: javax.ws.rs.core.Response$Status javax.ws.rs.ProcessingException: javax.ws.rs.core.Response$Status Apr 7, 2014
@RaviTeja457
Copy link
Author

Hi sir ,

I sent the log and example code as an email to borys.kolesnikov@gmail.com

@boryskolesnykov
Copy link
Contributor

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.

@boryskolesnykov
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants