b n
b n

Reputation: 31

RESTEASY003880: Unable to find contextual data of type: javax.servlet.http.HttpServletRequest

Hi when i am trying to open my applications' login page on browser , i am getting this exception. P.S : open jdk zulu 11 and wildfly 24 for deployment.

org.jboss.resteasy.spi.LoggableFailure: RESTEASY003880: Unable to find contextual data of type: javax.servlet.http.HttpServletRequest
    at [email protected]//org.jboss.resteasy.core.ContextParameterInjector$GenericDelegatingProxy.invoke(ContextParameterInjector.java:77)
    at [email protected]//com.sun.proxy.$Proxy163.getSession(Unknown Source)
    at deployment.demo.ear.rest.war//com.demoapp.demo.rest.resources.Myclass.init(Myclass.java:107)

Upvotes: 3

Views: 2582

Answers (3)

Andreas Panagiotidis
Andreas Panagiotidis

Reputation: 3002

Adding the quarkus-undertow dependency solved the problem for me. I use quarkus 2.X

Upvotes: 0

Seok H Ko
Seok H Ko

Reputation: 1

Check if there is beans.xml in your Web-inf dir. Then, remove and deploy again.

Upvotes: 0

stdunbar
stdunbar

Reputation: 17435

In my experience the @Context is set on a per method basis. More like:

@POST
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response myMethod(String someString, @Context HttpServletRequest request) {

In this way the HttpServletRequest is set on a method basis, not a class basis. I don't think you want it at the class level as if the class has many methods those methods shouldn't share the same HttpServletRequest.

Upvotes: 1

Related Questions