Results 1 to 3 of 3

Thread: No bean named AnnotationBeanConfigurerAspect is defined

  1. #1
    Join Date
    Jun 2010
    Posts
    20

    Default No bean named AnnotationBeanConfigurerAspect is defined

    According to the documentation if you do

    Code:
    <bean class="org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect" factory-method="aspectOf" />
    then you can do

    Code:
    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"
    		depends-on="org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect">
    But if you do

    Code:
    <context:spring-configured />
    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"
    		depends-on="org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect">
    you get org.springframework.beans.factory.NoSuchBeanDefini tionException: No bean named 'org.springframework.beans.factory.aspectj.Annotat ionBeanConfigurerAspect' is defined

    So the question is what is magic word for depends-on="magic" if you are using context namespace?

    Thanks

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,695

    Default

    If you use the namespace use 'org.springframework.context.config.internalBeanCo nfigurerAspect' I suggest taking a look at the SpringConfiguredBeanDefinitionParser source as that registers the bean.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Oct 2011
    Posts
    4

    Default

    riends,

    I'm having trouble inicilização in my Tomcat 6.0 server after implementation of Spring 3.1. Going up the server error occurs below

    No bean named 'springSecurityFilterChain' is defined


    My web.xml
    Code:
    [...]
    	<!-- SPRING -->
    
    	<listener>
    		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    	</listener>
    	<listener>
    		<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
    	</listener>
    	<listener>
    		<listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class>
    	</listener>
    
    	<filter>
    		<filter-name>springSecurityFilterChain</filter-name>
    		<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    	</filter>
    	<filter-mapping>
    		<filter-name>springSecurityFilterChain</filter-name>
    		<url-pattern>/*</url-pattern>
    	</filter-mapping>
    
    
    	<context-param>
    		<param-name>contexConfigLocation</param-name>
    		<param-value>
    	 		/WEB-INF/applicationContext.xml
    	 		/WEB-INF/applicationContext-security.xml
    	 	</param-value>
    	</context-param>
    
    	<context-param>
    		<param-name>contextClass</param-name>
    		<param-value>    
                 org.springframework.web.context.support.AnnotationConfigWebApplicationContext    
             </param-value>
    	</context-param>
    
    	<!-- <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> 
    		</listener> -->
    	<!-- FECHA SPRING -->
    
    [...]
    MY applicationContext.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <b:beans xmlns="http://www.springframework.org/schema/security"
    	xmlns:b="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
    	http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd">
    	<http>
    		<intercept-url pattern="/admin/**" access="ROLE_ADMINISTRADOR" />
    		<intercept-url pattern="/restrito/**" access="ROLE_USUARIO" />
    		<form-login login-page="/publico/login.jsf"
    			always-use-default-target="true" default-target-url="/restrito/principal.jsf"
    			authentication-failure-url="/publico/login.jsf?login_error=1" />
    		<logout />
    		<remember-me />
    	</http>
    	<authentication-manager>
    		<authentication-provider>
    			<jdbc-user-service data-source-ref="sdkStoreDataSource"
    				authorities-by-username-query="SELECT 
    	u.login, p.permissao FROM usuario u, usuario_permissao p WHERE u.id_usuario 
    	= p.permissao AND u.login = ?"
    				users-by-username-query="SELECT login, senha, 
    	ativo FROM usuario WHERE login = ?" />
    		</authentication-provider>
    	</authentication-manager>
    </b:beans>

    My applicationContext-security.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"	
    	xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
    	<bean id="sdkStoreDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
    		<property name="jndiName">
    			<value>java:comp/env/jdbc/sdkStoreDB</value>
    		</property>
    	</bean>
    	<beans:bean id="springSecurityFilterChain" class="org.springframework.security.util.FilterChainProxy">
            <filter-chain-map path-type="ant">
                <filter-chain pattern="/**" filters="sif"/>
            </filter-chain-map>
        </beans:bean>
    
    	
    </beans>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •