-
Jul 23rd, 2007, 02:08 AM
#1
Acegi Java 5 Security Annotations
Hi,
i tried method level security for my application using java 5 annotation
but it threw an exception
NoSuchBeanDefinitionException: No bean named 'secureDAO' is defined.
<bean id="attributes" class="org.acegisecurity.annotation.SecurityAnnota tionAttributes"/>
<bean id="objectDefinitionSource" class="org.acegisecurity.intercept.method.MethodDe finitionAttributes">
<property name="attributes"><ref local="attributes"/></property>
</bean>
<bean id="bankmanagersecurtiy" class="org.acegisecurity.intercept.method.aopallia nce.MethodSecurityInterceptor">
<property name="validateConfigAttributes"><value>false</value></property>
<property name="authenticationManager"><ref bean="authenticationManager"/></property>
<property name="accessDecisionManager"><ref bean="accessDecisionManager"/></property>
<property name="objectDefinitionSource"><ref bean="objectDefinitionSource"/></property>
</bean>
and my java class...
package test;
import org.acegisecurity.annotation.Secured;
public class SecureDAO {
public String create() {
return "create";
}
public String read() {
return "read";
}
public String update() {
return "update";
}
/**
* Delete something
*/
@Secured({"ROLE_LEAD"})
public String delete() {
return "delete";
}
}
thanks,
dinesh
-
Jul 23rd, 2007, 03:17 AM
#2
Do you have a bean with id "secureDAO" in your context?
BTW: Questions concerning security would be better posted in the security forum. And please use [ code] [ /code] tags to improve readability.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules