Announcement Announcement Module
Collapse
No announcement yet.
AuthorizationManager exception, why? Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • AuthorizationManager exception, why?

    I'm trying to integrate Acegi with AndroMDA. I have to configure to files to use it: applicationContext-acegi-security.xml and applicationContext.xml (I guess). I have already configured the applicationContext-acegi-security.xml file. But when I try to do login in the app, it shows the following error:

    org.springframework.beans.factory.access.Bootstrap Exception: Unable to initialize group definition. Group resource name [classpath*:beanRefFactory.xml], factory key [beanRefFactoryEjb]; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'beanRefFactory' defined in URL [jar:file:/C:/jboss-4.0.4/server/default/tmp/deploy/tmp10200montequinto-1.0-SNAPSHOT.ear-contents/montequinto-core-1.0-SNAPSHOT.jar!/beanRefFactory.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.FatalBeanException: Could not instantiate class [org.springframework.context.support.ClassPathXmlAp plicationContext]; constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'serviceSecurityInterceptor' defined in class path resource [applicationContext.xml]: Cannot resolve reference to bean 'authenticationManager' while setting bean property 'authenticationManager'; nested exception is org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named 'authenticationManager' is defined

    You can view my definition of the authenticationManager below:

    applicationContext-acegi-security.xml file:

    ...
    Code:
    <bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager">
    <property name="providers">
    <list>
    <ref local="daoAuthenticationProvider"/>
    <bean class="org.acegisecurity.providers.anonymous.AnonymousAuthenticationProvider">
    <property name="key" value="changeThis"/>
    </bean>
    <bean class="org.acegisecurity.providers.rememberme.RememberMeAuthenticationProvider">
    <property name="key" value="changeThis"/>
    </bean>
    </list>
    </property>
    </bean>
    ...
    applicationContext.xml

    <!-- ================= Start of ACEGI SERVICE SECURITY DEFINITIONS ================ -->
    Code:
    <bean id="serviceSecurityInterceptor" class="org.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor">
    <property name="accessDecisionManager"><ref bean="serviceAccessDecisionManager"/></property>
    <property name="authenticationManager"><ref bean="authenticationManager"/></property>
    <property name="objectDefinitionSource">
    <value>
    </value>
    </property>
    </bean>
    
    <bean id="serviceAccessDecisionManager" class="org.acegisecurity.vote.AffirmativeBased">
    <property name="allowIfAllAbstainDecisions">
    <value>false</value>
    </property>
    <property name="decisionVoters">
    <list>
    <ref local="serviceDecisionVoter"/>
    </list>
    </property>
    </bean>
    
    <bean id="serviceDecisionVoter" class="org.acegisecurity.vote.RoleVoter">
    <property name="rolePrefix"><value>ROLE_</value></property>
    </bean>
    <!-- ================== End of ACEGI SERVICE SECURITY DEFINITIONS ================= -->



    Someone know what is the problem?
    Last edited by ravnock; Apr 12th, 2007, 11:09 AM.

  • #2
    defined in class path resource [applicationContext.xml]
    applicationContext-acegi-security.xml file:
    I would say, the file containing the authenticationManager bean is not processed. Is it referenced in beanRefFactory.xml?

    And please use [ code] [ /code] tags to facilitate reading your code/configuration snippets.

    Regards,
    Andreas

    Comment


    • #3
      My beanRefFactory.xml

      The bean is not referenced in the beanRefFactory, this is the file
      Code:
      <?xml version="1.0" encoding="UTF-8"?>
      
      <!DOCTYPE beans
          PUBLIC "-//SPRING//DTD BEAN//EN"
                 "http://www.springframework.org/dtd/spring-beans.dtd">
      
      <beans>
      
          <bean id="beanRefFactory"
               class="org.springframework.context.support.ClassPathXmlApplicationContext">
              <constructor-arg>
                 <list>
                      <value>applicationContext.xml</value>
                      <value>applicationContext-dataSource.xml</value>
                      <!-- beanRefFactory merge-point -->
                 </list>
              </constructor-arg>
          </bean>
      
          <bean id="beanRefFactoryEjb"
               class="org.springframework.context.support.ClassPathXmlApplicationContext">
              <constructor-arg>
                 <list>
                      <value>applicationContext-localEjb.xml</value>
                      <!-- beanRefFactoryEjb merge-point -->
                 </list>
              </constructor-arg>
          </bean>
          <!-- beanRefFactoryEjbXml merge-point -->
          
      </beans>
      But is defined in applicationContext-acegi-security.xml (the xml configuration file that is used by AndroMDA)

      Comment


      • #4
        Surely applicationContext-acegi-security.xml needs to be loaded as well to be referenced by the applicationContext.xml?

        Comment


        • #5
          I think that there was a configuration error, I downloaded an AndroMDA sample and there was configuration differences. It depends on wich version of AndroMDA we use.

          Thanks.

          Comment


          • #6
            Did you solve the problem then?

            Comment


            • #7
              No, I got this problem because I put a property in the AndroMDA config file that was not neccesary, but then another problem appears. I posted it in the forum.

              Comment


              • #8
                Originally posted by ravnock View Post
                No, I got this problem because I put a property in the AndroMDA config file that was not neccesary, but then another problem appears. I posted it in the forum.
                Ok, I'll check out the other post.

                Comment


                • #9
                  I've found the other error, I'm posting the solution.

                  Thank you very much!

                  Comment


                  • #10
                    Ok, I guess we'll consider this thread dead then. I'll check out the other one.

                    Comment

                    Working...
                    X