jersey-2.0

Jersey 2.1 + JBoss 7.1 NoSuchMethodError: getProperties

旧时模样 提交于 2020-01-01 05:19:09
问题 I am trying to run Jersey 2.1 REST service on JBoss 7.1 AS. I am getting the NoSuchMethodError: javax.ws.rs.core.Application.getProperties error during deployment: ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/RESTService]] (MSC service thread 1-9) StandardWrapper.Throwable: java.lang.NoSuchMethodError: javax.ws.rs.core.Application.getProperties()Ljava/util/Map; at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:271) [jersey-server-2

java.net site closed, not able to access jersey documentation

不羁的心 提交于 2020-01-01 04:29:30
问题 I'm not able to access jersey documentation from, https://jersey.java.net/ Has jersey documentation been moved to a new location? 回答1: Bizarrely it seems that Oracle have pulled the plug on java.net. The jersey docs are available on the github site: https://jersey.github.io/documentation/latest/index.html 回答2: Jersey issues are available as well Issue IDs are same as former JIRA issue IDs ex: https://github.com/jersey/jersey/issues/3054 is same as former https://java.net/jira/browse/JERSEY

MessageBodyWriter not found vogella tutorial

早过忘川 提交于 2019-12-31 00:05:32
问题 I am attempting to recreate the most excellent vogella tutorial for create REST with java, JAX-RS and Jersey. I'm using eclipse Kepler with Java-EE perspective, tomcat 7.0. I have create the Todo class, the TodoResource class with the appropriate annotations and deployed on tomcat 7. I have imported the jaxrs-ri libs into the WEB-INF/lib folder as instructed. Todo class: package com.vogella.jersey.jaxb.model; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement public class Todo {

A resource model has ambiguous (sub-)resource method for HTTP method GET and input mime-types as defined by“@Consumes” and “@Produces” annotations

被刻印的时光 ゝ 提交于 2019-12-30 17:26:13
问题 How can the following produce this error when they have different URLs ? @Path("/job/{empId}/empProfile") public EmpProfileResource delegateToEventProfileResource() { EmpProfileResource resource = new EmpProfileResource(); locator.inject(resource); return resource; } @Path("/job/{empId}/empTask") public EmpTaskResource getClientLevelAttendees(@PathParam("clientId") long clientId){ EmpTaskResource resource = new EmpTaskResource (empId); locator.inject(resource); return resource; } @Path("/")

JsonMappingException: Can not find a deserializer for non-concrete Map type

坚强是说给别人听的谎言 提交于 2019-12-30 11:08:36
问题 String str = commonClient.authorizedRequestBuilder(commonClient.webTarget .path("/apps/get_current_version/default/"+appName+"/"+appName) .queryParam("object_type", "app")) .accept(MediaType.APPLICATION_JSON_TYPE) .get() .readEntity(String.class); i get str = {"versions": {"ap": "Not Set", "am": "topic-test-publisher-1.0.16", "il": "topic-test-publisher-1.0.16", "row": "topic-test-publisher-1.0.49"}, "provider": "gce"} Then i have changed to this code Version version = commonClient

Excessive warning messages from Jersey 2.x

情到浓时终转凉″ 提交于 2019-12-30 10:59:08
问题 I keep getting these warning messages from any POST operation with APPLICATION_FORM_URLENCODED form data: A servlet request to the URI (local request URI) contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected. I've traced this down to org.glassfish

Can't find @FormDataParam in Jersey 2.17

 ̄綄美尐妖づ 提交于 2019-12-30 03:43:14
问题 I'm quite new to web services so I've started with basic examples. This one relates to file upload. I'm using latest (2.17) version of Jersey bundle for non-maven developers. It states that: bundle contains the JAX-RS 2.0 API jar, all the core Jersey module jars as well as all the required 3rd-party dependencies . The problem is that I can not compile this part: @POST @Path("/upload") @Consumes(MediaType.MULTIPART_FORM_DATA) public Response uploadFile( @FormDataParam("file") InputStream

How to Convert a Properties Object to JSON Object with JAXB

早过忘川 提交于 2019-12-28 06:53:28
问题 I want to accept and respond JSON objects in a REST Application. The data I need to send and receive are in a .properties file. I have already read them and are now in a Properties Object(From java.util.Properties ). Is there a way to marshal and unmarshal Properties Objects, without implementing a new class? I am using Jax-rs API in a Weblogic server. @POST @Path("{id}") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public JSONObject getbyID(@PathParam("id"

What exactly is the ResourceConfig class in Jersey 2?

不羁岁月 提交于 2019-12-27 11:53:33
问题 I have seen a lot of Jersey tutorials that starts with something like @ApplicationPath("services") public class JerseyApplication extends ResourceConfig { public JerseyApplication() { packages("com.abc.jersey.services"); } } without explaining what exactly the ResourceConfig class is. So where can I find its documentation, usage, etc.? Googling for "jersey resourceconfig" does not yield any official doc. Some of my questions about this class and its usage are: What things can I do inside the

How to inject an object into jersey request context?

喜你入骨 提交于 2019-12-27 11:06:54
问题 I have this scenario where I want to write a filter and I want this filter to insert some object into the current request and pass it on so that when the resource class gets the request it can use the object. Filter class @Override public void filter(ContainerRequestContext request) throws IOException { MyObject obj = new MyObject(); // Inject MyObject to request which I dont know how } Resource Class @PUT @Consumes("application/json") @Path("/") public String create( JSONParam sample,