Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/324.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 侦听器批注中的CXF不工作+;JAX-RS_Java_Web Services_Cxf_Jax Rs_Interceptor - Fatal编程技术网

Java 侦听器批注中的CXF不工作+;JAX-RS

Java 侦听器批注中的CXF不工作+;JAX-RS,java,web-services,cxf,jax-rs,interceptor,Java,Web Services,Cxf,Jax Rs,Interceptor,我已经写了一个CustomValidationInterceptor。我想使用注释在服务级别配置这个拦截器。假设,如果我已经公开了5个服务,并且我只想为其中的1个服务配置拦截器,那么我该怎么做呢 下面是我当前的代码,它没有触发拦截器 @Service("someService") @Path("somePath") @InInterceptors(interceptors = { "com.telus.ffo.msl.service.impl.CustomValidationIntercepto

我已经写了一个CustomValidationInterceptor。我想使用注释在服务级别配置这个拦截器。假设,如果我已经公开了5个服务,并且我只想为其中的1个服务配置拦截器,那么我该怎么做呢

下面是我当前的代码,它没有触发拦截器

@Service("someService")
@Path("somePath")
@InInterceptors(interceptors = { "com.telus.ffo.msl.service.impl.CustomValidationInterceptor" })
public class SystemCheckRestService {


    @POST
    @Path("/{phoneNumber}")
    @Produces({"application/json;charset=UTF-8"})
    public Response preRepairTest(@PathParam("phoneNumber") String phoneNumber) {
    // Code...
    }
}
我的自定义拦截器的代码段是:

@Component
public class CustomValidationInterceptor extends AbstractPhaseInterceptor<Message>{

    public CustomValidationInterceptor() {
        super(Phase.PRE_INVOKE); // Put this interceptor in this phase
    }

    public void handleMessage(Message message) {
        // some code
     }

}
@组件
公共类CustomValidationInterceptor扩展了AbstractPhaseInterceptor{
公共CustomValidationInterceptor(){
super(Phase.PRE_INVOKE);//将此拦截器置于此阶段
}
公共无效handleMessage(消息消息){
//一些代码
}
}