Interceptor Problem
alexanderbell Jan 8, 2010 5:00 PMHi,
I wrote an Interceptor
@InterceptorBinding @Target({ElementType.METHOD, ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) public @interface Deferred {}
@Deferred @Interceptor public class DeferredInterceptor { @AroundInvoke public Object defer(InvocationContext ic) throws Exception { return ic.proceed(); } }
beans.xml
<?xml version='1.0' encoding='UTF-8'?> <beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/beans_1_0.xsd"> <interceptors> <class>org.j4fry.ui.web.common.jsf.interceptor.DeferredInterceptor</class> </interceptors> </beans>
Afterwards I annotated a Method which is located in a Bean with a @Model Annotation
@Model public class SearchBean extends AbstractBeanBase { @Deferred public void actionListener(ActionEvent event) { System.out.println("ActionListener"); } ...
IMO everything is configured correctly.
Unfortunately I get the following error on startup:
16:52:17,126 INFO [Weld/Version] WELD-000900 1.0 (0) 16:52:17,216 ERROR [AbstractKernelController] Error installing to Create: name=vfszip:/home/sidux/projects/j4fry/trunk/server/server/development/deploy/J4Fry-ear.ear/_WeldBootstrapBean state=Configured org.jboss.weld.DeploymentException: Cannot load class org.j4fry.ui.web.common.jsf.interceptor.DeferredInterceptor defined in vfszip:/home/sidux/projects/j4fry/trunk/server/server/development/deploy/J4Fry-ear.ear/J4Fry-war.war/WEB-INF/beans.xml at org.jboss.weld.xml.BeansXmlParser.processInterceptorElement(BeansXmlParser.java:290) at org.jboss.weld.xml.BeansXmlParser.parse(BeansXmlParser.java:207) at org.jboss.weld.bootstrap.BeanDeployment.parseBeansXml(BeanDeployment.java:107) at org.jboss.weld.bootstrap.BeanDeployment.<init>(BeanDeployment.java:85) at org.jboss.weld.bootstrap.WeldBootstrap$DeploymentVisitor.visit(WeldBootstrap.java:197) at org.jboss.weld.bootstrap.WeldBootstrap$DeploymentVisitor.visit(WeldBootstrap.java:174)
Weld cannot find the Interceptor class but I configured the right class-name so I cannot understand that exception.
I'm running on JBoss 6.0M1
Any ideas?
Alex