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

Unable to find contextual data of type: javax.ws.rs.ext.Providers at Autentication #350

Open
guibernardi opened this issue Mar 13, 2018 · 2 comments

Comments

@guibernardi
Copy link

I followed the example, but I can't authenticate in JasperServer.

`
RestClientConfiguration configuration = new RestClientConfiguration(url);
configuration.setAcceptMimeType(MimeType.JSON).setContentMimeType(MimeType.JSON).setJrsVersion(JRSVersion.v6_1_0).setLogHttp(true);

JasperserverRestClient client = new JasperserverRestClient(configuration);
com.jaspersoft.jasperserver.jaxrs.client.core.Session
session = client.authenticate("xxxx", "xxxx", new Locale("pt", "BR"), TimeZone.getTimeZone("America/Sao_Paulo"));
`

But I'm getting:

09:45:35,151 WARNING [javax.enterprise.resource.webcontainer.jsf.lifecycle] (default task-38) java.lang.RuntimeException: java.lang.RuntimeException: RESTEASY003940: Unable to instantiate MessageBodyReader: javax.el.ELException: java.lang.RuntimeException: java.lang.RuntimeException: RESTEASY003940: Unable to instantiate MessageBodyReader ... Caused by: java.lang.RuntimeException: RESTEASY003325: Failed to construct public com.owlike.genson.ext.jaxrs.GensonJsonConverter(javax.ws.rs.ext.Providers) at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:162) at org.jboss.resteasy.spi.ResteasyProviderFactory.createProviderInstance(ResteasyProviderFactory.java:2017) at org.jboss.resteasy.spi.ResteasyProviderFactory.addMessageBodyReader(ResteasyProviderFactory.java:760) at org.jboss.resteasy.spi.ResteasyProviderFactory.processProviderContracts(ResteasyProviderFactory.java:1357) ... 77 more Caused by: org.jboss.resteasy.spi.LoggableFailure: RESTEASY003880: Unable to find contextual data of type: javax.ws.rs.ext.Providers at org.jboss.resteasy.core.ContextParameterInjector$GenericDelegatingProxy.invoke(ContextParameterInjector.java:62) at com.sun.proxy.$Proxy154.getContextResolver(Unknown Source) at com.owlike.genson.ext.jaxrs.GensonJsonConverter.<init>(GensonJsonConverter.java:59) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:150) ... 80 more

I'm using jrs-rest-java-client: 6.3.1
And my JasperServer is 6.4.2

Is there any recommendation or solution?

Thanks in advance

@tmatveyeva
Copy link

Hello,

Sorry, I cannot see any part of the stacktrace related to rest client code. Where exactly it is failing?

Regards,
Tetyana

@Qleoz12
Copy link

Qleoz12 commented Nov 15, 2019

I use this and this works fine for me....

  1. Create file jboss-deployment-structure.xml in my web project how consumes the jsr-rest-client-api

  2. put this insede the file

        <!-- 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>

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

3 participants