There is a correct answer to this question already on this site. The problem is that the question is for Jersey 1.6 and the correct answer for Jersey 1.17.1 is buried at the bottom. I figured I'd create a correct question for this answer so that it'd be easier to find help for people struggling with this (like I was).
How to produce JSON output with Jersey 1.17.1 using JAXB
2.5k Views Asked by Daniel Kaplan At
1
There are 1 best solutions below
Related Questions in REST
- Spring RestTemplate passing the type of the response
- .net rest service with JSON string and consumed with java client
- SuiteCRM how to retrieve all account related contacts
- http status code for failed email send
- cloud foundry - 413 Request Entity Too Large
- Why does PHP add "\r\n" to an empty string?
- WCF Service not accepting multiple body parameters
- How to send Rest GET request that contains "#" value in url parameters?
- Phalcon PHP - RESTful API
- Object of class CS_REST_Wrapper_Result could not be converted to string in CAMPAIGN MONITOR
- purchase individual items and subscriptions in the same PayPal REST API transaction
- Empty Response Received on Android POST Request
- angular load more tweets onclick
- Async vs Horizontal scaling
- Responding to an Office 365 event invite via REST
Related Questions in JAXB
- Why doesn't wrapping a List/Map in a JAXBElement work?
- JAXB How to append and XML String into a XML element?
- JAXB - why can i only marshal to a stream/file?
- I am new to JAXB. How can I merge two different xmls with different namespaces into one xml with a root element and unmarshal it?
- Why fasterxml lost the "xsi:type" attribute with JaxbAnnotationModule but JAXB Marshaller is fine
- Can I unmarshal a single xml property to a multi element array?
- How to stop XML Tag Attributes from sorting in Ascending Order after modifying the XML file using Java?
- Efficiently unmarshaling a part of a large xml file with JAXB and XMLStreamReader
- exception unmarshalling xml file using jaxb
- OSGI compatible artifact for jaxb2-basics?
- Unable to locate binding.xml for Maven JAXB plugin (jaxb2-maven-plugin)
- XMLGregorianCalendar not displayed in the right format when marshalled
- Convert date type to string in jaxb using bindings
- JAXB on-demand unmarshalling
- JAXB - how to create xml from object with <set varname = "String" value = name "String2"> elements
Related Questions in JERSEY
- Error getting json jax-rs
- How to get rid of WebKitFormBoundary in uploaded file
- MULTIPART_FORM_DATA: No injection source found for a parameter of type public javax.ws.rs.core.Response
- Jersy Rest service to accept java.util.Map for MediaType.APPLICATION_JSON
- Pass parameter data from JQuery/Ajax call to Jersey web service
- Jersey Client - Variable types are ignored
- Uploading a document usibg fabric3
- Jersey version issue: MessageBodyReader not found for media type=application/xml
- Guice + Jersey + Spring data
- What options are there to do output validation of Jersey resources?
- Include null field values in Jersey REST Response
- in jersey 2.x am getting the error like java.util.concurrent.ExecutionException
- Jersey Client, memory leak, static and concurrency
- Java Restful Service eclipse tomcat HTTP Error 404
- Routing all Jersey REST requests through a method prior to execution
Related Questions in JACKSON
- How do I get the type to convert to when deserializing from Jackson
- Add @JsonAutoDetect to third party lib and firebase Java lib
- How to convert input string to json string or json object using jackson in java
- Why fasterxml lost the "xsi:type" attribute with JaxbAnnotationModule but JAXB Marshaller is fine
- How to covert JSON field name to a Java compatible property name while doing Jackson de-serialisation?
- Apply default serializer to properties in custom serializer with Jackson
- Jackson json to map and camelcase key name
- Robospice and Jackson annotations seems to be ignored
- Trouble outputting Float value using Jackson library for Java
- org.codehaus.jackson.JsonParseException: Unexpected character ('�' (code 65533 / 0xfffd))
- jackson - how to serialize nested object with custom object names?
- Jackson 1.9 @JsonTypeInfo visible discriminator property
- Swagger Dropwizard 0.7 - TextArea for JSON parameter not displayed
- Jackson CSV missing columns
- org.codehaus.jackson versus com.fasterxml.jackson.core
Related Questions in JERSEY-1.0
- Jersey - execute 'common' code before running a selected set of subresources
- Jersey resource that matches any path
- Jersey & Guice: How to appoint base path to each ServletModule?
- MOXy - Force Single Element Arrays to be Objects
- Jersey - String not mapped to Json while using ObjectMappers function writeValueAsString succeeds
- Facing Exception of MessageBodyWriter while sending JSONObject to Rest web service
- How can i specify path value from property file in jersey?
- jerssey anotation to filter request based on header value
- Handle an array of POJO in JSON via jersey
- how to pass value to VO which is inside map and VO
- In Jersey, how do you deal with @POST parameters of a deeply nested, complex object?
- How to produce JSON output with Jersey 1.17.1 using JAXB
- Can jersey clients POST a JAXB object to the server using JSON?
- How to suppress Jersey exceptions that Jersey throws automatically?
- Jersey error after migrating EAR from Jboss EAP 6.4 to Jboss EAP 7.3
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
First, you need to add this to your web.xml:
Then, take any of the classes you want to serialize across the wire and add this annotation to the top of them:
Then add the appropriate jars to the classpath. It's not enough to add the Jersey jars, you also need to add jackson. I downloaded the zip that includes 12 different jars. Once I added all 12 jars to my classpath I finally got rid of the error and works great returning JSON.
I hope this helps somebody.
Download Zip with 12 Jars: Here is a link to the zip file that contains the 12 jar files: jersey-archive-1.17.zip
For Maven Users: Add the following to your pom.xml to get the 12 jars individually: