resteasy

The calling class org.jboss.resteasy.cdi.CdiInjectorFactory is placed in multiple bean archives

天大地大妈咪最大 提交于 2019-12-13 06:31:09
问题 This question was asked before on stackoverflow but, was not appearing as the main question of the post. It was a secondary question. That's why I asked it on a new discussion. The aim is to have a better answer rate. I asked stackoverflow an advice before posting this question I try to run a deployment of an app with jetty 9.4.8. It is an angular java maven multi module app Here is my web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi=

DSL-Json with RESTEasy - Getting NoMessageBodyWriterFoundFailure error

£可爱£侵袭症+ 提交于 2019-12-13 05:50:55
问题 I'm integrating RestEasy with Dsl-JSON but I'm getting the following error: Failed executing GET /json/sample/get org.jboss.resteasy.core.NoMessageBodyWriterFoundFailure: Could not find MessageBodyWriter for response object of type My code is as below: @Path("/json/sample") public class JSONService { @GET @Path("/get") @Produces(MediaType.APPLICATION_JSON) public Sample getProductInJSON() { Sample product = new Sample(); product.setName("abcd"); product.setAge(12); return product; } } My pom

Embedded JAX-RS CDI (Undertow, RestEasy & Weld)

只愿长相守 提交于 2019-12-13 03:46:22
问题 I've been trying in the last couple of days to setup an embedded Undertow server, with JAX-RS, using RestEasy, and CDI using weld. No matter what I do, nothing seems to work. I've read through every possible answer, and demo available I could find; Nothing worked! The JAX-RS resource: @Path("/") @Produces(MediaType.TEXT_PLAIN) @RequestScoped public class EchoResource { @Inject @Named("upperCase") private UpperCaseTextProcessing upperCaseTextProcessing; @Inject @Named("lowerCase") private

How to test the response content-type using SOAP UI

谁说我不能喝 提交于 2019-12-12 23:27:51
问题 I am new to this SOAP UI . I got a requirement to test if the response body is not empty . Can you please tell me how to solve. My idea was to check the content-length of the response using assertion script but it is not working for equals() . contains() is working but not equals : // works: assert ((com.eviware.soapui.support.types.StringList)messageExchange.responseHeaders["Content-Length"]).contains("0") // not working: assert ((com.eviware.soapui.support.types.StringList)messageExchange

REST Service returning wrong content-type and unmarshall

主宰稳场 提交于 2019-12-12 21:51:16
问题 I'm using RESTEasy and more specifically, the client side of their framework. I'm calling a third part web service that's returning me some JSON code. But, for some good reasons, the content-type in their response is "text/javascript". How can I tell RESTEasy that it should be using a JSON provider (unmarshalling purposes) for a "text/javascript" content-type ? Is that possible ? My code : public interface XClient { @GET @Produces("application/json") @Path("/api/x.json") public Movie

jBoss CORS support with security constraints

萝らか妹 提交于 2019-12-12 15:42:26
问题 I'm adding authentication to my API using the web-common security constraints, but it seems to have broken my CORS filter. I've previously had it working with just the filter and no app server level authentication. The basic idea is to require authentication on all requests expect those under the /rest/account endpoint, as these are the ones that handle the initial login and so need to be publicly accessible. Testing in both Chrome and Postman returns a 405 Method not allowed response when

RESTeasy/JAXB; How do I avoid a namespace being added to an Element in an <any> tag? (List<Element> in JAXB)

若如初见. 提交于 2019-12-12 10:44:28
问题 I'm going to simplify my classes and output as best I can here, but basically what I'm after is I want to add an org.w3c.dom.Element (representing an atom link in this case) to a JAXB object I'm returning. The JAXB Class looks something like: import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; import org.w3c.dom.Element; @XmlAccessorType(XmlAccessType.FIELD)

JAX-RS: How to extend Application class to scan packages?

妖精的绣舞 提交于 2019-12-12 10:33:15
问题 Currently, I do something similar to import javax.annotation.Nonnull; import javax.ws.rs.ApplicationPath; import javax.ws.rs.core.Application; import java.util.Collections; import java.util.HashSet; import java.util.Set; @ApplicationPath("oauth") public class OAuthApplication extends Application { final Set<Class<?>> classes = new HashSet<>(); @Nonnull @Override public Set<Class<?>> getClasses() { classes.add(RegisterResource.class); return Collections.unmodifiableSet(classes); } } No if I

Resteasy 3 integration with Spring 3 not working

我的梦境 提交于 2019-12-12 10:11:05
问题 I have a project which uses Resteasy and Spring. Before I used the Resteasy version is 2.3.5, which worked fine and no problem. However I recently upgraded the Resteasy version to 3.0.3.Final, when I deployed to jboss it throws some exceptions. Nothing changed just the resteasy version change to 3.0.3.Final. Exceptions: ERROR [org.springframework.web.context.ContextLoader] (MSC service thread 1-7) Context initialization failed: org.springframework.beans.factory.BeanCreationException: Error

Unable to find contextual data of type: java.ws.rs.container.ContainerRequest (Wildfly error)

蹲街弑〆低调 提交于 2019-12-12 09:59:18
问题 I am using wildfly 9.0.1.Final I am deploying a REST application which has an endpoint defined like this: @GET @Path("/view/products") @Produces(MediaType.APPLICATION_JSON) @CORSEnabled @Protected public String getConfiguredProducts( @Context ContainerRequestContext request) { if (request != null) { Integer companyId = (Integer) request.getProperty("company"); if (companyId != null) { //do stuff } } // ... more staff } When the application runs, the context is injected, i.e. 'request' is non