Questions tagged [jax-rs]

JAX-RS: Java API for RESTful Web Services. It is an API that provides support in creating web services according to the REST architectural style.

JAX-RS: API for RESTful Web Services is an API that provides support in creating web services according to the architectural style. JAX-RS uses annotations, introduced in Java SE 5, to simplify the development and deployment of web service clients and endpoints. From version 1.1 on, JAX-RS is an official part of Java EE.

The home for the JAX-RS JSRs is on Java.net.

JAX-RS is implemented by the following frameworks:

Resources:

7676 questions
28
votes
8 answers

A message body writer for Java class java.util.ArrayList

I received the below stack trace when accessing on of my jax-rs resources. I'm using Tomcat 7, with Jersey 1.12 and Hibernate 4 and MySQL. I found this tutorial while searching for a solution:…
n4rzul
  • 4,059
  • 7
  • 45
  • 64
28
votes
7 answers

How to reuse Jersey's JSON/JAXB for serialization?

I have a JAX-RS REST service implemented using Jersey. One of the cool features of JAX-RS/Jersey is how easily a POJO can be turned into a REST service, simply by sprinkling a few Java annotations... including a trivially easy mechanism for…
ctwomey
  • 338
  • 1
  • 3
  • 7
27
votes
5 answers

RESTFul Service Framework for AppEngine

I am working on a project that involves mobile and web clients with Google's AppEngine PAAS. I would like to use RESTFul webservices with my AppEngine app. I have looked over Stackoverflow for references to RESTFul service frameworks that can be…
Saad Farooq
  • 13,172
  • 10
  • 68
  • 94
27
votes
6 answers

How to produce JSON output with Jersey 1.6 using JAXB

@XmlRootElement public class Todo { private String s = "test"; public String getS() { return s; } public void setS(String s) { this.s = s; } } and service: @Path("/test") public class Service { @GET …
Mikhail
  • 1,583
  • 5
  • 22
  • 34
27
votes
2 answers

Disabling WADL in WebLogic12.2.1

I'm trying to disable the WADL without using JMX options or web.xml options. Simple JAX-RS Application Class as follows: @ApplicationPath("resources") public class TestWADL extends Application { public Map getProperties() { …
Niks
  • 271
  • 2
  • 4
27
votes
7 answers

How to leave client waiting for Java JAX-RS service to prevent DOS

I'm having an issue with a web service with users trying to guess application IDs by looping over random IDs. The bad requests are coming from random IPs, so I cannot just ban their IP (unless I do it dynamically, but I'm not looking into that…
James
  • 17,965
  • 11
  • 91
  • 146
26
votes
1 answer

Inheritance with JAX-RS

I am using JAX-RS for my web services. I have common functionality and would like to use inheritance. I am providing simple CRUD operations. I have defined an interface like so: public interface ICRUD { @POST @Consumes("application/json") …
user489041
  • 27,916
  • 55
  • 135
  • 204
26
votes
7 answers

Obtaining "MessageBodyWriter not found for media type=application/json" trying to send JSON object through JAX-RS web service

I am trying to send a JSON object through a JAX-RS web service. My file web.xml is: JAX-RS Tools Generated - Do not modify JAX-RS Servlet
amedeo avogadro
  • 595
  • 2
  • 7
  • 14
26
votes
2 answers

How to resolve MessageBodyWriter not found for media type=multipart/form-data error

How to configure provider for simple multi-form post. Any suggestions/pointers would be much appreciated. Stacktrace: org.glassfish.jersey.message.internal.MessageBodyProviderNotFoundException: MessageBodyWriter not found for media…
Doug
  • 2,242
  • 2
  • 20
  • 16
26
votes
5 answers

Java RestFull WebService: JAX-RS implementation with Jersey 2.3.1 libraries

I am trying to run a simple "Hallo World" application Jersey 2.3.1 REST service on JBoss jboss-eap-6.1 AS. In web.xml i have disabled restEasy library. During deployment i am getting the error: JBWEB000289: Servlet …
Roberto
  • 283
  • 1
  • 3
  • 6
26
votes
1 answer

JAX-RS 2.0 change default implementation

I'm trying to use RESTEasy as JAX-RS 2.0 client implementation. The problem is that I got runtime exception: 06-28 13:29:06.410: E/AndroidRuntime(5745): Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException:…
Konstantin Milyutin
  • 11,946
  • 11
  • 59
  • 85
25
votes
1 answer

How do I do a multipart/form file upload with jax-rs?

(specifically RESTeasy) It would be nice (for a single file) to have a method signature like: public void upload(@FormParam("name") ..., @FormParam("file") file: InputStream) ... doable? or am I dreaming? doesn't seem to be that simple.
Michael Neale
  • 19,248
  • 19
  • 77
  • 109
25
votes
4 answers

Reasons for not directly writing Servlets for creating a REST API

In my current company we are starting a new project that will be a REST API in Java, deployed in a servlet container like Tomcat. In my previous experience using REST frameworks like JAX-RS with Jersey, JBOSS REST Easy, Spring MVC I know what are…
raspacorp
  • 5,037
  • 11
  • 39
  • 51
25
votes
1 answer

RESTful webservice : how to set headers in java to accept XMLHttpRequest allowed by Access-Control-Allow-Origin

I have a RESTful webservice which will return string and it was written in Java (JAX-WS). My problem is when I send request to that webservice with URL like : http://localhost:8080/project/webservices/getlist/getListCustomers In the console it's…
ChiranjeeviIT
  • 529
  • 1
  • 4
  • 17
25
votes
1 answer

JAX-WS vs JAX-RS For RESTful Web Service

Hi I have worked with JAX-WS for SOAP based webservices. Now I want to use REST because REST have advantages over SOAP as i studied about from here. But from different articles I knew that we can create RESTful webservices from JAX-WS also. But most…
Abhendra Singh
  • 1,959
  • 4
  • 26
  • 46