I am currently in the process of updating my container from JBoss AS 7 to Wildfly 10. The migration has gone well except for Deltaspike integration. Under JBoss AS 7 AS everything was working as expected, I only needed to create custom SecurityBindingTypes and SecurityParameterBindings. When I try to execute the same coded under Wildfly 10 I get the following error:
Caused by: java.lang.IllegalStateException: Exception looking up authorizer method bean - no beans found for method [class com.mimeya.deb.security.CustomAuthorizer.doSecuredComplianceReportReadAccessCheckForUnitId] at org.apache.deltaspike.security.impl.extension.Authorizer.lazyInitTargetBean(Authorizer.java:215) at org.apache.deltaspike.security.impl.extension.Authorizer.authorize(Authorizer.java:174) at org.apache.deltaspike.security.impl.extension.DefaultSecurityStrategy.invokeBeforeMethodInvocationAuthorizers(DefaultSecurityStrategy.java:80) at org.apache.deltaspike.security.impl.extension.DefaultSecurityStrategy.execute(DefaultSecurityStrategy.java:62) at org.apache.deltaspike.security.impl.extension.SecurityInterceptor.filterDeniedInvocations(SecurityInterceptor.java:44) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.jboss.weld.interceptor.reader.SimpleInterceptorInvocation$SimpleMethodInvocation.invoke(SimpleInterceptorInvocation.java:74) at org.jboss.weld.interceptor.proxy.WeldInvocationContext.invokeNext(WeldInvocationContext.java:83) at org.jboss.weld.interceptor.proxy.WeldInvocationContext.proceed(WeldInvocationContext.java:115) at org.jboss.weld.bean.InterceptorImpl.intercept(InterceptorImpl.java:108) at org.jboss.as.weld.ejb.DelegatingInterceptorInvocationContext.proceed(DelegatingInterceptorInvocationContext.java:77) at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.delegateInterception(Jsr299BindingsInterceptor.java:68) at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:80) at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93) at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437) at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:64) at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340) at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275) ... 144 more
For reference, this is our custom SecurityBindingType:
@Retention(value = RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
@Documented
@SecurityBindingType
public @interface CustomSecurityBinding {}
And this is one of our custom SecurityParameterBindings:
@Retention(value = RetentionPolicy.RUNTIME)
@Target(value={ElementType.PARAMETER})
@Documented
@SecurityParameterBinding
public @interface SecureComplianceReportReadAccessUnit {}
And this is an example of one of the methods I'm calling:
@Secures
@CustomSecurityBinding
public boolean doSecuredComplianceReportReadAccessCheckForUnit(@SecureComplianceReportReadAccessUnit Unit unit) throws Exception {
COMPONENT component = COMPONENT.COMPLIANCE_REPORTS;
int permission = UserPermission.READ_ACCESS;
return manageSecurityBean.canUserPerformAction(userSessionBean.getUserAccess(), component.getDatabaseId(), permission, -1, -1, -1, unitId);
}
I have been reading through a bunch of the documentation but to no avail. I've looked at the quick start guide (https://github.com/wildfly/quickstart/tree/10.x/deltaspike-authorization), the JBoss Developer forums, and the Deltaspike source code itself. Any help or ideas to try would be greatly appreciated. Thank you.