Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/401.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 带焊接的Tomcat上的AOP_Java_Tomcat8_Weld - Fatal编程技术网

Java 带焊接的Tomcat上的AOP

Java 带焊接的Tomcat上的AOP,java,tomcat8,weld,Java,Tomcat8,Weld,我正在学习如何在RESTful Web服务中使用AOP。我选择Tomcat作为平台,选择Weld作为CDI,我还使用CXF作为JAX-RS实现(这是一个特定于委员会的技术约束,我还很新)。这是我的 据我所知,Weld已正确加载,我从中获得了Tomcat+Weld配置,它找到了我的拦截器(这里是一个日志快照): 嗯,我可以访问我的琐碎服务,但我的拦截器没有被触发。以下是Tomcat给我的反馈: ... INFORMAZIONI: Server startup in 2293 ms 2017-02-

我正在学习如何在RESTful Web服务中使用AOP。我选择
Tomcat
作为平台,选择
Weld
作为CDI,我还使用
CXF
作为
JAX-RS
实现(这是一个特定于委员会的技术约束,我还很新)。这是我的 据我所知,
Weld
已正确加载,我从中获得了
Tomcat+Weld
配置,它找到了我的拦截器(这里是一个日志快照):

嗯,我可以访问我的琐碎服务,但我的拦截器没有被触发。以下是Tomcat给我的反馈:

...
INFORMAZIONI: Server startup in 2293 ms
2017-02-02 11:28:59 TRACE Servlet:232 - WELD-000708: Initializing request org.apache.catalina.connector.Request@2b2c4052
2017-02-02 11:28:59 DEBUG Reflection:82 - WELD-000620: interface javax.enterprise.inject.Intercepted is not declared @Target(METHOD, FIELD, PARAMETER, TYPE). Weld will use this annotation, however this may make the application unportable.
2017-02-02 11:28:59 DEBUG Reflection:82 - WELD-000620: interface javax.enterprise.inject.Decorated is not declared @Target(METHOD, FIELD, PARAMETER, TYPE). Weld will use this annotation, however this may make the application unportable.
2017-02-02 11:28:59 TRACE Context:69 - WELD-000222: Loading bean store org.jboss.weld.context.beanstore.http.LazySessionBeanStore@366ca776 map from session null
2017-02-02 11:28:59 TRACE DefaultListableBeanFactory:568 - No bean named 'org.apache.cxf.phase.PhaseManager' found in org.springframework.beans.factory.support.DefaultListableBeanFactory@2c80a98d: defining beans [cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,sec,secproof]; root of factory hierarchy
2017-02-02 11:28:59 TRACE DefaultListableBeanFactory:568 - No bean named 'org.apache.cxf.policy.PolicyDataEngine' found in org.springframework.beans.factory.support.DefaultListableBeanFactory@2c80a98d: defining beans [cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,sec,secproof]; root of factory hierarchy
2017-02-02 11:28:59 TRACE Servlet:293 - WELD-000709: Destroying request org.apache.catalina.connector.Request@2b2c4052
...

我错过了什么?

没关系。只是缺少配置。我必须使用
cxf集成cdi
使其工作,博客文章和示例是基础。感谢作者

...
INFORMAZIONI: Server startup in 2293 ms
2017-02-02 11:28:59 TRACE Servlet:232 - WELD-000708: Initializing request org.apache.catalina.connector.Request@2b2c4052
2017-02-02 11:28:59 DEBUG Reflection:82 - WELD-000620: interface javax.enterprise.inject.Intercepted is not declared @Target(METHOD, FIELD, PARAMETER, TYPE). Weld will use this annotation, however this may make the application unportable.
2017-02-02 11:28:59 DEBUG Reflection:82 - WELD-000620: interface javax.enterprise.inject.Decorated is not declared @Target(METHOD, FIELD, PARAMETER, TYPE). Weld will use this annotation, however this may make the application unportable.
2017-02-02 11:28:59 TRACE Context:69 - WELD-000222: Loading bean store org.jboss.weld.context.beanstore.http.LazySessionBeanStore@366ca776 map from session null
2017-02-02 11:28:59 TRACE DefaultListableBeanFactory:568 - No bean named 'org.apache.cxf.phase.PhaseManager' found in org.springframework.beans.factory.support.DefaultListableBeanFactory@2c80a98d: defining beans [cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,sec,secproof]; root of factory hierarchy
2017-02-02 11:28:59 TRACE DefaultListableBeanFactory:568 - No bean named 'org.apache.cxf.policy.PolicyDataEngine' found in org.springframework.beans.factory.support.DefaultListableBeanFactory@2c80a98d: defining beans [cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,sec,secproof]; root of factory hierarchy
2017-02-02 11:28:59 TRACE Servlet:293 - WELD-000709: Destroying request org.apache.catalina.connector.Request@2b2c4052
...