Questions tagged [javax.ws.rs]
54 questions
0
votes
1 answer
JAVA Classpath and jersey client
I had this problem for last few weeks and whenever i run a java application the following exception :
java.lang.NoClassDefFoundError: com/sun/jersey/core/util/FeaturesAndProperties
Caused by: java.lang.ClassNotFoundException:…

Vikram
- 635
- 1
- 9
- 29
0
votes
1 answer
Unmarshall json @POST parameter
I have a class looking like this:
public class Test {
@JsonProperty("name")
private String name;
public Test(){}
public String getName() {
return name;
}
public void setName(String name) {
this.name =…

Grains
- 950
- 3
- 16
- 35
0
votes
0 answers
How to authorize a user using EJB interceptors?
We are planning to use ejbs for our service layer. We have http clients and EJB clients.
We want to authorise a user action based on his roles. There are two kinds of users, admins and non admins.
We configured a realm in the server and in the…

Krishna Chaitanya
- 2,533
- 4
- 40
- 74
0
votes
1 answer
RESTful Java service not serializing ArrayList
Here is a sample code of my GET method that should return xml serialized version of ConfigurationProperty as a response.
It serializes the ConfigurationProperty model in most of the times, except when the value is set to an ArrayList.
What may be…

Peter G.
- 7,816
- 20
- 80
- 154
0
votes
1 answer
JAX-RS How to return a list as Json with field name
I have a list which I want to return as a Response. But I want to prepend it with a field name.
List res = ...
return Response.ok(res, MediaType.APPLICATION_JSON_TYPE).build();
This returns only the list
["abcd","efgh"]
But I want to…

Thiyagu
- 17,362
- 5
- 42
- 79
0
votes
1 answer
javax.ws.rs MediaType - Accept Header
@Consumes as well as @Produces, both accepts the Media type. Accept Header in request corresponds to which annotation?
In most of the examples (e.g. How to deal with accept-parameters when developing a jax-rs application) it shows of using @Produces…

Sandeep Jindal
- 14,510
- 18
- 83
- 121
0
votes
1 answer
Serve static content on a per servlet basis
I'm making an application which loads modules dynamically based on configuration files. Each module has its own servlet and its own path.
It works, but so far it's only serving content I annotate with @Path in my classes (rest services), thanks to…

Sebas
- 21,192
- 9
- 55
- 109
0
votes
0 answers
400 Bad Request: POST request using javax.ws.rs and Json jackson
I am trying to make a POST with javax. Keep getting the 400 bad request response code. It suggests that there is something wrong with the json being sent(?) I have checked the json a hundred times, it looks pretty good to me. What am I…

irrelevantUser
- 1,172
- 18
- 35
-2
votes
1 answer
how to make javax.ws post request similar to postman request?
I try to send an http post request with postman and it works
(it works using curl as well)
I get a positive response
I try to do the same request in code using
import javax.ws.rs.client.WebTarget;
Map formData = new…

Elad Benda
- 35,076
- 87
- 265
- 471