Questions tagged [javax.ws.rs]

54 questions
0
votes
3 answers

Get T generic type of the class to the T in the new GenericType>() Java

I have implmented the follwing class and implemented a search method get list of Object for the given type of T using a REST call. public class AmapiService implements RestService { @Override public List
JanithOCoder
  • 301
  • 2
  • 5
  • 19
0
votes
0 answers

Access static lookup data from javax REST service

I have a javax rest service that needs to retrieve data from an object database. Additionally, it always needs to perform a lookup in a table (key is a string, value is an integer). There are 250 values in the lookup table, which I am currently…
Hiro Protagonist
  • 474
  • 3
  • 15
0
votes
1 answer

Dropwizard update View from POST method

I am trying to validate a form in my POST method which registers new users. In the case that errors arise such as a username that is already used, I want my View, which is retrieved from my GET method to be updated with the error. I am using…
TM00
  • 1,330
  • 1
  • 14
  • 26
0
votes
0 answers

Jersey (javax.ws.rs): how to do initialisation at page level ONLY not at application level

I need to do a lot of initialisation for few pages when they are called for only first time. Here is a decent post that addresses this: Initialize database on Jersey webapp startup But the problem with the above approach is that the initialisation…
samshers
  • 1
  • 6
  • 37
  • 84
0
votes
1 answer

GWT - Restygwt - Response was NOT a valid JSON document

I wantet to set up a simple demo Project on how to use Restygwt, for learning. I followed this Tutorial: https://ronanquillevere.github.io/2014/03/16/gwt-rest-app.html So far I got this on my client: In my SearchPresenter the method…
KilledByCheese
  • 852
  • 10
  • 30
0
votes
1 answer

Parsing Json Response sent from Google Distance Matrix API

This json occurs when a destination or origin is outside of the uk, therefore not giving me any results! I need to check for this for a null check so i dont receive null pointer exception JSON RESULT: { "destination_addresses" : [ "Durham, NC, USA"…
DeltaRage
  • 119
  • 1
  • 3
  • 16
0
votes
1 answer

Errors resulting from upgrading my CXF version from 2.7.7 to 3.1.8

pom.xml 3.1.8 3.1.8 1.1.1 2.0.1 com.sun.xml.bind
0
votes
0 answers

Can't find javax.ws.rs.core on server, not on client

I am building a REST API that works perfectly on my local development machine, however when I deploy the exact same war file to my test server I get the following error: java.lang.NoSuchMethodError:…
munHunger
  • 2,572
  • 5
  • 34
  • 63
0
votes
2 answers

javax UriBuilder doesn't escape '}' correctly

javax.ws.rs.core.UriBuilder is not escaping } correctly: import javax.ws.rs.core.UriBuilder; public void test() { final UriBuilder builder = UriBuilder.fromUri("http://host"); builder.path("dir}one"); l.info(builder.toString()); } Will…
Roland
  • 7,525
  • 13
  • 61
  • 124
0
votes
0 answers

Java Runnable using a utility function post call

I have a work project where I am having multiple threads call a utility function I created that sends a post form to an internal API we have. I use the callAPI method here which is in a utility class, which is public, final and static : public…
Kyle Calica-St
  • 2,629
  • 4
  • 26
  • 56
0
votes
1 answer

Java REST API Query annotation

I am currently trying to add a new feature to my REST API. Basically I want to add the ability to add query parameters to the end of a path and turn this into a Map of all the query options for example. my current code allows me to do things…
0
votes
1 answer

How to prevent sensitive data from being logged by SyncInvoker.post?

I'm sending a request with a following code: final WebTarget target = client.target(url); CustomResponse response = target.request(MediaType.APPLICATION_XML_TYPE) .post(Entity.xml(password),…
0
votes
1 answer

How to get simple javax.ws REST service url

Below is a toy example of a simple service using javax.ws. I want to get the service URL, callable from a web browser or curl. This is the toy service code: package packagename; import javax.jws.WebMethod; import javax.jws.WebService; import…
npit
  • 2,219
  • 2
  • 19
  • 25
0
votes
0 answers

Migration from jersey 1.* to 2.*

I am migrating my application from jersey 1.* to jersey 2.*. If have made the following changes. removed the below entries from pom.xml com.sun.jersey jersey-client
Raul
  • 139
  • 1
  • 6
  • 17
0
votes
1 answer

ExceptionMapper not working consistently in Jersey 2.x & javax

I am using javax and jersey for my api application (exposing api endpoints) I am trying to catch exceptions coming from fasterXml (on put and post calls) by having a Provider which implements ExceptionMapper. My Problem is that on POST or PUT,…
Shiran Maor
  • 309
  • 2
  • 5
  • 18