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 answers
Related Questions in REST
- Query parameter works fine with fastapi application when tested locally but not working when the FastAPI application is deployed on AWS lambda
- Add an http GET/POST entry point to a Django with channels websocket
- Difficulty creating a data pipeline with Fabric Datafactory using REST
- Flutter connection to a local api
- Accessing REST API Status Codes using Azure Data Factory Copy Activity (or similar)?
- Mass Resource deletion in REST
- why when I check endpoint /tasks, an error always appears "error : invalid token" even though I have entered the appropriate token that I got
- How to prevent users from creating custom client apps?
- How to create a REST API with .NET Framework?
- Efficiently Handling Large Number of API Calls with Delphi 10.4 and OmniThreadLibrary
- Put Request throwing 401 [no body] Unauthorized
- Converting img src data to octet-stream
- Implementing Email Verification and Notification System in a Full-Stack Application with React Frontend and Node Backend
- Micronaut - Add Controller from external library
- Moving Template or OVA to Datastore using vCenter API
Related Questions in JAXB
- Migrating Spring Boot 2 to 3 throws org.glassfish.jaxb.runtime.v2.runtime.IllegalAnnotationsException: 3 counts of IllegalAnnotationExceptions
- ModelMapper: mapping an xs:IDREF which is a List of JAXBElement of Object
- 'Code too large' XML to Java using Jaxb2 and Castor maven plugins
- Migrating TransformerFactory Property from javax.xml.Transform to Jakarta in Spring 6 and Java 17
- Quarkus 3.8.x Java 17 NoClassDefFoundError: javax/xml/bind/JAXBException Dependency Conflict
- Why is this Enum class not JAXB-marshalled?
- CXF Codegen wsdlToJava JAXBException
- Troubleshooting JAXBException in JobRunr Scheduled Task with JDK 17 Spring Boot App deployed in Azure App Service
- Upgrading java 8 to 17, jaxb to jakarta generates source classes from wsdl with javax.xml.bind package and complains about package does not exist
- How to share/reuse classes between modularized JAXB/JAX-WS maven modules?
- Docx4J not working on Websphere Liberty Server 24.0.0.2
- JAXBException: Property appears in @XmlType.propOrder, but no such property exists
- How to consume SOAP web service in Spring?
- Applying constraints to the type arguments of parameterized types
- java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlElement
Related Questions in JERSEY
- Change API Input from STRING to WRAPPER - Java Jersey with Swagger
- Using HikariCP with Mysql: who should implement the threadpool
- AbstractMethodError: Receiver class com.sun.jersey.api.uri.UriBuilderImpl...resolved method 'abstract javax.ws.rs.core.UriBuilder
- Caused by: java.lang.ClassNotFoundException: Provider for jakarta.ws.rs.client.ClientBuilder cannot be found
- Is it possible to get ContainerRequestContext or HttpHeaders in Jackson serializers/deserializers?
- How to properly start a web app project in IntelliJ IDEA 2023.3.5 with tomcat?
- jax-rs nested provider with Jersey+Jetty
- What happens when the response is not closed with Apache Connector in Jersey Client?
- Error while using jersey-client - No generator was provided
- ModelValidationException in JAVA Jersey
- Jackson deserialize json: The field `form_object_guid` in the JSON string is not defined in the `DigitalFormGetResponse` properties
- 415 Unsupported Media Type during csv upload
- I'm not able to start jetty server
- Classes defined in a library are not being picked up by jersey in Helidon
- Jersey Web.xml Configuration
Related Questions in JACKSON
- Why Jackson needs a default constructor?
- Support Both Object and Array in Json Otherwise it throws MismatchedInputException
- Quarkus is unable to serialize a simple string as JSON
- Dependencies not shading with Maven shade
- is not a valid Cucumber report! String length (20054016) exceeds the maximum length (20000000)
- Deserialize object that might be wrapped
- Filter out certain fields during deserialization in Jackson?
- Java Jackson update json 2nd value instance in array
- ObjectMapper convert class to map
- Java Jackson Deserialization - Custom add to list
- Serialization of java object to String
- How can I configure Jackson to use BigDecimal when parsing numbers?
- Jackson Kotlin ignore null values (setSerializationInclusion(JsonInclude.Include.NON_NULL) not working)
- Deserialize Builder Class without using Jacksonized
- Java Jackson - Change class name during serialization
Related Questions in JERSEY-1.0
- With what to replace com.sun.jersey.guice.spi.container.servlet.GuiceContainer in Jersey version 2?
- PerRequestTypeInjectableProvider equivalent in Jersey2
- How to match the JSON Response differences between Jackson 1 and Jackson 2 for Weblogic 11G to 12C migration
- Jersey Migration from 1.x to 2.x
- Can Jersey Client be used in multithreaded environment for consuming rest api?
- Jersey exception mapper is not being invoked from Filter class
- Jersey 1 @Inject migrated to Jersey 2 stopped working
- Can we return HashMap<String, Object> from jersey JSR-311 resource as response
- Convert Jersey 1.x client to Jersey 2.x client
- Jersey 1.x JAX-RS: General unhandled exception java.lang.IllegalStateException
- JAX-RS register instance as an endpoint?
- Upgrading from jersey 1.19.4 to 2.29 for Java11
- Bad Request response, Jersey 1.17, @FormDataParam and Weblogic 12.1.2.0.0
- Move from Jersey 1.x to Jersey 2.x - NoSuchMethod error
- 415 Unsupported media type error for DELETE Operation
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?
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)
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: