jax-rs

An exception occurred while scanning class and annotation data. The exception was java.lang.IllegalArgumentException

梦想的初衷 提交于 2020-06-27 05:53:53
问题 I have Jersey(JaxRS) REST service running on WebSphere Application Server Version 8.5.5.9 Liberty Profile. I am using Jersey2.25. It worked fine. Now I upgraded to Jersey 2.31 and see exceptions. I heard that from Jersey2.26 there are backward compatibility issues here: Jersey stopped working with InjectionManagerFactory not found This is the exception I am running into [6/15/20 17:31:40:413 CDT] 00000020 id= com.ibm.ws.http.internal.VirtualHostImpl A CWWKT0016I: Web application available

Calling multiple API in sequence with token in java

只愿长相守 提交于 2020-06-25 04:47:28
问题 I have to call 5 APIs in sequence after generating the token. i am using below API to generate token . POST https://idcs-xxxx.identity.c9dev2.oc9qadev.com/oauth2/v1/token I will send username and password to get token in above API. Once token will be received I will have to use the same token to call below 5 APIs in sequence. I will use output of one API and filter it and pick some values as an input to next API . all the rest endpoint will change based on the input value of previous API

Why in multiple connections to PricesResource Publisher, only one gets the stream?

核能气质少年 提交于 2020-06-17 09:33:10
问题 It seems that only one http client gets the stream of data, while the others do not. Is it true that the Publisher is hot data, and that it should broadcast to all subscribers? Please find more in Can I allow multiple http clients to consume a Flowable stream of data with resteasy-rxjava2 / quarkus? package org.acme.kafka; import javax.inject.Inject; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import io.reactivex.Flowable;

Different behaviour on JAX-RS json (java.util.Date) serialization

倖福魔咒の 提交于 2020-06-16 18:50:27
问题 I'm migrating my application (Jee7) from Wildfly 9.0.1 to Wildfly 16.0.0. I noticed different Responses from JAX-RS json (java.util.Date) deserialization on both wildfly version. Is it a bug or Jee spec changed? Is there a way to globally fix it for entire application? Example classes: @ApplicationPath("/rest") public class RestConfig extends Application { } @Path("/test") public class TestResource { @GET @Produces(MediaType.APPLICATION_JSON) public TestEntity get() { return new TestEntity

Can I allow multiple http clients to consume a Flowable stream of data with resteasy-rxjava2 / quarkus?

大城市里の小女人 提交于 2020-05-30 09:49:20
问题 Currently I am able to see the streaming values exposed by the code below, but only one http client will receive the continuous stream of values, the others will not be able to. The code, a modified version of the quarkus quickstart for kafka reactive streaming is: @Path("/migrations") public class StreamingResource { private volatile Map<String, String> counterBySystemDate = new ConcurrentHashMap<>(); @Inject @Channel("migrations") Flowable<String> counters; @GET @Path("/stream") @Produces

Can I allow multiple http clients to consume a Flowable stream of data with resteasy-rxjava2 / quarkus?

丶灬走出姿态 提交于 2020-05-30 09:48:38
问题 Currently I am able to see the streaming values exposed by the code below, but only one http client will receive the continuous stream of values, the others will not be able to. The code, a modified version of the quarkus quickstart for kafka reactive streaming is: @Path("/migrations") public class StreamingResource { private volatile Map<String, String> counterBySystemDate = new ConcurrentHashMap<>(); @Inject @Channel("migrations") Flowable<String> counters; @GET @Path("/stream") @Produces

Trouble creating a simple singleton class in Jersey 2 using built-in Jersey dependency injection

ぐ巨炮叔叔 提交于 2020-05-09 21:40:53
问题 I am having trouble getting a very basic implementation of a singleton class off the ground with Jersey 2 (2.7) and only Jersey's built-in HK2 dependency injection. I am running this on Tomcat. My goal is to create a singleton instance of a support class that will be used by various web service methods. I don't have a strong preference between constructor injection, method injection, and annotating a class member (as I do below). Here is my to-be-singleton class: package singletest; import

Trouble creating a simple singleton class in Jersey 2 using built-in Jersey dependency injection

爱⌒轻易说出口 提交于 2020-05-09 21:40:19
问题 I am having trouble getting a very basic implementation of a singleton class off the ground with Jersey 2 (2.7) and only Jersey's built-in HK2 dependency injection. I am running this on Tomcat. My goal is to create a singleton instance of a support class that will be used by various web service methods. I don't have a strong preference between constructor injection, method injection, and annotating a class member (as I do below). Here is my to-be-singleton class: package singletest; import

What is the most portable (or standard) way of returning a list as a response in jax-rs?

﹥>﹥吖頭↗ 提交于 2020-04-30 12:25:30
问题 Well, anybody can say this question is already asked and answered. Never mind I also found them. JAX-RS: How to automatically serialize a collection when returning a Response object? Using Java-generics template type in RESTful Response object via GenericEntity<List<T>> I'm not confused with the way of responding with an List<T> but just not convinced about the portability. Let's say I have a nicely annotated entity looks like this. @XmlRootElement public class Stock { @XmlAttribute private

How can i build a connection between an RMI server and a RESTful web service?

℡╲_俬逩灬. 提交于 2020-04-30 09:19:20
问题 So I am trying to understand how to build a connection between a RMI server and a RESTful web service. My requirement is that , I need to build a web client and a RMI desktop application , which connects to a RESTful web service to conduct crud operation. I only need to use the web application to view the data in the database , but the desktop application needs to be able to conduct CRUD operations. The above provided diagram is the architecture I need to follow to develop my application. For