jersey

Deploying jersey web services on Payara 4 doesn´t expose methods

僤鯓⒐⒋嵵緔 提交于 2019-12-06 22:25:09
I developed a Maven Web Project to expose some jersey web services through Payara 4, the project builds fine, but my web methods are not exposed. Here is the main class: package br.com.ainstec.cfrjob.api.resources; import br.com.concil.cfrimporter.controller.CfrImport; import br.com.concil.cfrimporter.model.PojoTest; import javax.enterprise.context.RequestScoped; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.support.ClassPathXmlApplicationContext; /** * Recurso REST para tratar chamadas * */

How to send enclose data in DELETE request in Jersey client?

送分小仙女□ 提交于 2019-12-06 21:47:20
问题 I have the following server-side code in Jersey 2.x: @Path("/store/remove/from/group") @DELETE @Consumes(MediaType.APPLICATION_FORM_URLENCODED) @Produces(MediaType.TEXT_PLAIN) public Response removeStoresFromGroup(@FormParam("storeName") List<String> storeNames, @FormParam("groupName") String groupName) { //...... } On client side, I want to use Jersey 2.x client to send a delete request to the above web service. However, from the documentation of Jersey client API, I didn't find how to

NoSuchMethodError on Values.lazy (Jersey 2.5.1)

為{幸葍}努か 提交于 2019-12-06 21:35:27
I am officially perplexed by this blocker. I had upgraded Jersey from 2.4.1 to 2.5.1 because Jersey/Oracle fixed a package scanning bug that was affecting getting Swagger working. 2.4.1 was working relatively "okay" after lots of hacks to integrate with our Spring-based server (spring-jersey3 was not working at all .) Now since upgrading to 2.5.1 (and now, 2.6-SNAPSHOT), I receive the error below each time I make a request to anything matching the API URL pattern. What I have done: Redeployed on a new, clean server (clean maven repository, clean tomcat, etc); Checked that the jar is the

Jersey POJOMappingFeature to convert null to empty string?

℡╲_俬逩灬. 提交于 2019-12-06 20:09:29
I'm using Jersey 1.18 and I have POJOMappingFeature enabled. I would like all incoming & outgoing JSON values to be converted from null to an empty string. How to configure the mapping? I've searched web but was unable to find what I'm looking for. from my web.xml: <servlet> <servlet-name>Jersey REST Service</servlet-name> <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class> <init-param> <param-name>com.sun.jersey.config.property.packages</param-name> <param-value>com.abc.restControllers</param-value> </init-param> <init-param> <param-name>com.sun.jersey.api

Jersey 2.x 分支 Java SE 兼容性

那年仲夏 提交于 2019-12-06 19:47:21
直到 Jersey 2.6 版本,Jersey 将会兼容 Java SE 6。这个情况将会在在 Jersey 2.7 的版本有所改变。 直到 Jersey 版本 2.25x, 所有的 Jersey 的组件将会兼容 Java SE 7 为目标。这个意思是你将会需要最少使用 Java SE 7 来支持和运行使用最新的。只有 core-common 和 core-client 模块仍然兼容 Java SE 6 的版本并且可以在这个版本上运行。 从 Jersey 2.26 开始,所有的模块将会使用 Java SE 8 进行构建,这里并不能支持运行老的 Java SE 分发包。 https://www.cwiki.us/display/JERSEYZH/Java+SE+Compatibility 来源: oschina 链接: https://my.oschina.net/u/2344080/blog/2871538

What are push configurations (host, port, username, password) for TextSecure Server

浪尽此生 提交于 2019-12-06 16:54:02
问题 I installed TextSecure Server.(https://github.com/WhisperSystems/TextSecure-Server) I also modified some server side code to to simplify registration process and to accept predefined sms/voice verification code. I also created custom TextSecure app with my own TextSecure server details. And installed on my two android devices. I successfully registered TextSecure app on my two mobiles. No problem at all. But when I send message from one mobile, server gets this message, but not able to

What does this strange Jersey warning mean?

时间秒杀一切 提交于 2019-12-06 16:36:31
问题 What does this warning mean in Jersey 1.4: WARNING: A sub-resource method, public final java.lang.String com.XXX.render(), with URI template, "/", is treated as a resource method This is how the method looks: @GET @Produces(MediaType.APPLICATION_XML) @Path("/") public final String render() { return "test"; } 回答1: Why do you need specify such path for method? @Get is enough to tell jersey that it is default method for entire class (I'm assuming that your class has some @Path("/MyRes")

NoSuchMethodError javax.ws.rs.core.Application.getProperties()Ljava/util/Map

别说谁变了你拦得住时间么 提交于 2019-12-06 16:31:25
I am trying my first REST application. Below is my configuration: Java 7 JBoss AS 7.1 Jersey 2.22.2 Below are list of jars downloaded by Maven: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.prasad</groupId> <artifactId>messenger</artifactId> <packaging>war</packaging> <version>0.0.1-SNAPSHOT</version> <name>messenger</name> <build> <finalName>messenger</finalName> <plugins> <plugin> <groupId

Securing with roles annotations not working (Jersey)

醉酒当歌 提交于 2019-12-06 16:07:12
I'm new here even though I've found many answers to my problems in here before. Now I'm looking for help with this: I have this little example resource on my little REST API: @Path("/greeting") @PermitAll public class HelloResource { @GET @Produces(MediaType.TEXT_PLAIN) @Path("all") public String sayHelloToAll() { return "Hello, everybody!"; } @GET @Produces(MediaType.TEXT_PLAIN) @RolesAllowed("admin") @Path("admin") public String sayHelloToAdmin() { return "Hello, admin!"; } } In order to filter roles, I have this implementation of SecurityContext: public class Authorizer implements

JAX-RS Jersey Read entity with Content-Type “*”

两盒软妹~` 提交于 2019-12-06 15:45:32
问题 I am using Jax-RS to make a request to a server, which just returns a one word String, and read that response into a String variable. The issue is that I have no idea how to use the response, as its Content-Type is *; charset=UTF-8 (I verified this using Postman). Jax-RS has difficulty parsing this kind of header. Here is my code: MultivaluedMap<String, String> formData = new MultivaluedHashMap<String, String>(); formData.add("username", username); formData.add("target", "10"); Response