I defined a bean configuration class:

@Configuration
public class CoreAppBeanConfiguration {
    @Bean
    @Scope(value = WebApplicationContext.SCOPE_REQUEST, proxyMode = ScopedProxyMode.TARGET_CLASS)
    public CoreAppContext getCoreAppContext() {
        CoreAppContext context = new CoreAppContext();
        return context;
    }
}

Then I defined a filter to initialize the CoreAppContext:

@Provider
@Component
public class TestHandler implements ContainerRequestFilter, ContainerResponseFilter {
    @Autowired
    private CoreAppContext coreAppContext;

    @Override
    public void filter(ContainerRequestContext containerRequestContext) throws IOException {
        coreAppContext.id="1";
        coreAppContext.name="test";
        RequestContextHolder.currentRequestAttributes().setAttribute("coreAppContext", coreAppContext, RequestAttributes.SCOPE_REQUEST);
    }
}

Finally I defined a resource class to get the CoreAppContext value:

@Path("/test")
public class TestResource {

    @GET
    @Path("/get")
    public String get() {
        CoreAppContext coreAppContext= (CoreAppContext) RequestContextHolder.getRequestAttributes().getAttribute("coreAppContext", 0);
        String result = coreAppContext.getIdName();
        return result;
    }
}

As you can see in the below picture, I got the null value. proxy_issue1 proxy_issue2 proxy_issue3

Comment From: huabro

Could you please help check if it is a bug or not?

Comment From: sbrannen

Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use the issue tracker only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug.