Jaspersoft / jrs-rest-java-client

Java Rest Client for JasperReports Server
GNU Lesser General Public License v3.0
102 stars 103 forks source link

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

Open guibernardi opened 6 years ago

guibernardi commented 6 years ago

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 commented 6 years ago

Hello,

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

Regards, Tetyana

Qleoz12 commented 5 years ago

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