Results 1 to 2 of 2

Thread: Acegi Java 5 Security Annotations

Hybrid View

  1. #1
    Join Date
    Jul 2007
    Posts
    6

    Default 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

  2. #2
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    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
  •