在AbstractFeature中无效的OAuthRequestFilter(或ContainerRequestFilter) - “org.apache.cxf.resource.method”为null

问题描述 投票:0回答:1

我们使用的是CXF 3.x,项目有类MyFeature extends AbstractFeature和`MyFilter扩展OAuthRequestFilter。

MyFeatureMyFilter类对象内部创建为MyFilter myFilter = new MyFilter (classObj);,其中classObj是类的对象,需要在其上应用过滤器。

当我点击端点时,它会将错误抛出为403。

此外,当我使用调试器和LOG消息时,我开始知道内部文件org.apache.cxf.interceptor.security.AbstractAuthorizingInInterceptor(cxf-core版本3.0.4.redhat-621159)有功能getTargetMethod和内部的方法评估BindingOperationInfom.get("org.apache.cxf.resource.method")即将到来的null,由于这个我得到了403。

注意:我们使用osgi(jboss)bundle作为部署策略。

filter cxf handler requesthandler
1个回答
0
投票

JAXRSInInterceptor执行的过滤器位于unmarshal州。在这个状态org.apache.cxf.resource.method仍然是null。我在状态PRE_STREAM中创建了拦截器,那时org.apache.cxf.resource.method为你提供了应该执行的正确名称。

© www.soinside.com 2019 - 2024. All rights reserved.