java-ee-8

Migrating from java 8 to 11 - jaxws-rt

扶醉桌前 提交于 2020-03-03 14:00:48
问题 I´ve migrated from Java 8 to Java 11 and I´ve found that some Java EE libraries are deprecated and I have to use some third party dependencies instead. So I´ve added these dependencies to maven pom.xml <dependency> <groupId>org.glassfish.jaxb</groupId> <artifactId>jaxb-runtime</artifactId> </dependency> <!-- JAXWS for Java 11 --> <dependency> <groupId>com.sun.xml.ws</groupId> <artifactId>jaxws-rt</artifactId> <version>${com.sun.xml.ws.jaxws-rt.version}</version> <type>pom</type> </dependency>

EE8 JCache annotation CacheResult doesn't work

一曲冷凌霜 提交于 2020-01-03 03:11:41
问题 I'm developing a WEB APP under JBoss EAP 7.2 (EE8) using EhCache as JCache implementation (JSR 107) I have this code: @Inject CacheManager cacheManager; @CacheResult(cacheName = "roles") public List<RoleDTO> get(@CacheKey String id) { return service.getRoles(id); } public List<RoleDTO> getRoles(final String userId) { final List<RoleDTO> output = get(userId); return output; } According to this article I read, I'd expect the second time I access the get(userId) method should use cache and

Convert JsonObject to pojo efficiently with JSON-B 1.0 (e.g. Yasson, Java EE 8)

旧巷老猫 提交于 2019-12-12 19:33:02
问题 A JsonObject can be transformed into it's corresponding class instance via: Pojo pojo = JsonbBuilder.create().fromJson(jsonObject.toString(), Pojo.class) However, it seems to be inefficient to use jsonObject.toString() as a String is an other intermediate representation, that contains the same information. I need to transform the jsonObject before the object binding. So is there a more efficient way to achieve the binding from a JsonObject? (Note I want to implement with Java EE 8 standards,

jax-rs sse client with Singleton in Glassfish/Payara

倖福魔咒の 提交于 2019-12-11 03:04:43
问题 About jax-rs client with SSE in EJB Singleton, I've tried with Payara server full-5.183 (without docker) for this example, [https://abhirockzz.wordpress.com/2017/07/27/jax-rs-2-1-sse-client-api-example-using-glassfish-5-on-docker/], but failed. Error shown at line eventSource = SseEventSource.target(target).build(); @PostConstruct public void init() { this.sseClient = ClientBuilder.newClient(); this.target = this.sseClient.target("https://sse.now.sh"); tsvc.createSingleActionTimer(15000, null

How to get specific error instead of Internal Server Error?

笑着哭i 提交于 2019-12-01 08:49:10
问题 I am getting Internal Server Error on postman even though I am throwing a custom exception from my code exception. I want to see the exception of having a valid error message and error code, what I am throwing. It will be a great help if anyone of you can help me on this point. Like how I can get a better error message. Adding below code snap. Thanks in advance. @Service public class FetchActionImpl implements FetchAction { private static Logger log = LoggerFactory.getLogger(FetchActionImpl