Announcement Announcement Module
Collapse
No announcement yet.
Autowiring problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Autowiring problem

    Hi,

    I have a Controller that has an autowired service, "ServiceA" and I call a method on ServiceA --> ServiceA.setProfile();
    This works fine however, ServiceA also has 2 autowired properties:

    Code:
    	@Autowired IProfileService profileService;
    	
    	private EntityManager entityManager;
    	@PersistenceContext
    	public void setEntityManager(EntityManager entityManager) {
    	    this. entityManager = entityManager;
    	}
    but because I am inside method: setProfile, my entityManager and profileService types are NULL!!

    Why is this? I thought that since this Service was autowired from the homepageController, there would be a cascase style of autoWiring even internally, as in this case within ServiceA, but this is not the case.

    Any clues why? Please advise. Thank you.

  • #2
    My guess, you are creating a new intance of your service instead of relying on autowiring.

    Comment


    • #3
      still a problem....

      Ok let me go through this issue in a little bit more detail:

      It all starts with the homePageController:

      Code:
      package com.logixplayer.pf.homepage.controller;
      
      import java.io.IOException;
      
      import javax.servlet.ServletException;
      import javax.servlet.http.HttpServletRequest;
      import javax.servlet.http.HttpServletResponse;
      
      import org.apache.commons.logging.Log;
      import org.apache.commons.logging.LogFactory;
      import org.springframework.beans.factory.annotation.Autowired;
      import org.springframework.stereotype.Controller;
      import org.springframework.web.bind.annotation.RequestMapping;
      import org.springframework.web.servlet.ModelAndView;
      
      import com.logixplayer.pf.service.ICanvasOfExpressionService;
      import com.logixplayer.pf.service.IProfileService;
      import com.logixplayer.pf.service.ITopicOfTheDayService;
      
      @Controller
      public class HomePageController {
      
      @Autowired IProfileService profileService;
      @Autowired ITopicOfTheDayService ts;
      @Autowired ICanvasOfExpressionService cs;
      
      	private static final Log log = LogFactory.getLog(HomePageController.class);
      	
      	@RequestMapping("/welcome")
      	public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {
      
      		log.info("********* inside homepage Controller!!! **********");
      		ModelAndView view= new ModelAndView("homepage");
      		
      		//	get user profile URL for Canvas of Expression
      		view = cs.setUserProfileArtifact(view);
      		
      		//	Topic of the Day!!
      		return ts.getHomePageComments(view);
      	}
      }
      ok, now property @Autowired ICanvasOfExpressionService cs; "cs" is defined in my data-access.xml bean file as:

      Code:
      	<bean id="ICanvasOfExpressionService"
      		class="com.logixplayer.publicfountain.service.impl.CanvasOfExpressionServiceImpl">
      	</bean>
      Now, I can see through the debugger that in the homePageController, "cs" is actually instantiated which is great BUT the properties of "cs" which are autowired as well, are NULL.

      Observe definition of cs OR ICanvasOfExpressionService:

      Code:
      public class CanvasOfExpressionServiceImpl implements ICanvasOfExpressionService {
      
      	@Autowired IProfileService profileService; <--- why is this null
      	
      	private EntityManager entityManager;
      	@PersistenceContext
      	public void setEntityManager(EntityManager entityManager) {
      	    this. entityManager = entityManager; <--- why is this null
      	}
      	
      	private static final Log log = LogFactory.getLog(CanvasOfExpressionServiceImpl.class);
      	
      	public Profile getUserProfile() {
      profileService is null and so is entityManager!!
      I have defined IProfileService in my data-access.xml bean file as well:

      Code:
      <bean id="IProfileService" class="com.logixplayer.publicfountain.service.impl.IProfileServiceImpl">
      					<property name="IProfileDAO" ref="ProfileDAO"/>
      				</bean>
      
      </beans>
      What gives? Please advise thank you.

      p.s. there is a direct flow from the homePageController straight to ICanvasOfExpressionService. In other words, I am not instantiating any classes on my own manually, I am leaving it up to the spring container...so then why is it not picking up the autowiring?

      Comment


      • #4
        more info plz

        could you post your config files (inside code or php tags)? also which versions are you using?

        Comment


        • #5
          You can try to make the

          Code:
          @Autowired IProfileService profileService;
          to

          Code:
          @Autowired @Required IProfileService profileService;
          And also can try passing the Qualifier along to make sure the correct bean gets injected.

          Comment


          • #6
            Still having same issue, have attached context bean files....

            Hi ppl,

            Happy New Year...I had the pleasure of debugging this issue still for my new years! Yes I really love Spring! :P

            OK...so the issue is still persisting...

            So I got a HomePageController that looks like so:

            Code:
            @Controller
            public class HomePageController {
            
            @Autowired IProfileService profileService;
            @Autowired ITopicOfTheDayService ts;
            @Autowired ICanvasOfExpressionService cs;
            Again, I appreciate the fact that I might be able to add @Required but that still leaves a null entity Manager in both ITopicOfTheDayService and ICanvasOfExpressionService. Also, as it is now in ICanvasOfExpressionServices, @Autowired IProfileService profileService is null!!! it is not being set....why is this? is it the way I have set up the bean files?

            One interesting thing that I noted is that in HomePageController, IProfileService actually has an internal property set: IProfileDAO but this is because it was explicitly set in the bean file, it was not autowired....could it be that there is some kind of library incompatibility?

            Point being is that Within HomePageController, @AutoWired is working because it does instantiate
            Code:
            @Autowired IProfileService profileService;
            @Autowired ITopicOfTheDayService ts;
            @Autowired ICanvasOfExpressionService cs;
            but it does not instantiate the entityManager within and also any other @AutoWired properties.

            I have pasted the context files below (ICanvasOfExpressionService and ITopicOfTheDayService are at the bottom, IProfileService is an imported file):

            data-access-context.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"
            	xmlns:p="http://www.springframework.org/schema/p"
            	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd" xmlns:tx="http://www.springframework.org/schema/tx">
            
            
            	<bean id="entityManagerFactory"
            		class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
            		<property name="persistenceUnitName" value="dataAccessPU" />
            	</bean>
            	<bean id="transactionManager"
            		class="org.springframework.orm.jpa.JpaTransactionManager">
            		<property name="entityManagerFactory"
            			ref="entityManagerFactory" />
            	</bean>
            	<tx:annotation-driven transaction-manager="transactionManager" />
            	
            	<bean
            		id="CommentDAO"
            		class="com.logixplayer.pf.dao.CommentDAO">
            		<property name="entityManagerFactory"
            			ref="entityManagerFactory" />
            </bean>
            	<bean id="BadWordDAO"
            		class="com.logixplayer.pf.dao.BadWordDAO">
            		<property name="entityManagerFactory"
            			ref="entityManagerFactory" />
            	</bean>
            	<bean id="CategoryDAO"
            		class="com.logixplayer.pf.dao.CategoryDAO">
            		<property name="entityManagerFactory"
            			ref="entityManagerFactory" />
            	</bean>
            	<bean id="UserDAO"
            		class="com.logixplayer.pf.dao.UserDAO">
            		<property name="entityManagerFactory"
            			ref="entityManagerFactory" />
            	</bean>
            	<bean id="TagDAO"
            		class="com.logixplayer.pf.dao.TagDAO">
            		<property name="entityManagerFactory"
            			ref="entityManagerFactory" />
            	</bean>
            	<bean id="CommentTypeDAO"
            		class="com.logixplayer.pf.dao.CommentTypeDAO">
            		<property name="entityManagerFactory"
            			ref="entityManagerFactory" />
            	</bean>
            	<bean id="ContentDAO"
            		class="com.logixplayer.pf.dao.ContentDAO">
            		<property name="entityManagerFactory"
            			ref="entityManagerFactory" />
            	</bean>
            	<bean id="ProfileDAO"
            		class="com.logixplayer.pf.dao.ProfileDAO">
            		<property name="entityManagerFactory"
            			ref="entityManagerFactory" />
            	</bean>
            	<bean id="ContentTypeDAO"
            		class="com.logixplayer.pf.dao.ContentTypeDAO">
            		<property name="entityManagerFactory"
            			ref="entityManagerFactory" />
            	</bean>
            	<bean id="TopicTypeDAO"
            		class="com.logixplayer.pf.dao.TopicTypeDAO">
            		<property name="entityManagerFactory"
            			ref="entityManagerFactory" />
            	</bean>
            	<bean id="AttributesDAO"
            		class="com.logixplayer.pf.dao.AttributesDAO">
            		<property name="entityManagerFactory"
            			ref="entityManagerFactory" />
            	</bean>
            	<bean id="InfoTypeDAO"
            		class="com.logixplayer.pf.dao.InfoTypeDAO">
            		<property name="entityManagerFactory"
            			ref="entityManagerFactory" />
            	</bean>
            	<bean id="UserTypeDAO"
            		class="com.logixplayer.pf.dao.UserTypeDAO">
            		<property name="entityManagerFactory"
            			ref="entityManagerFactory" />
            	</bean>
            	<bean id="TopicDAO"
            		class="com.logixplayer.pf.dao.TopicDAO">
            		<property name="entityManagerFactory"
            			ref="entityManagerFactory" />
            	</bean>
            	<bean id="StatusDAO"
            		class="com.logixplayer.pf.dao.StatusDAO">
            		<property name="entityManagerFactory"
            			ref="entityManagerFactory" />
            	</bean>
            	<bean id="DictionaryDAO"
            		class="com.logixplayer.pf.dao.DictionaryDAO">
            		<property name="entityManagerFactory"
            			ref="entityManagerFactory" />
            	</bean>
            	<bean id="FlagDAO"
            		class="com.logixplayer.pf.dao.FlagDAO">
            		<property name="entityManagerFactory"
            			ref="entityManagerFactory" />
            	</bean>
            	
            	<!-- import services - don't even really need above DAO definitions -->
            	<!-- it's all managed through the service, only the entity manager  -->
            	<!-- factory should be defined -->
            	<import resource="application-context-iAttributesService.xml"/>
            	<import resource="application-context-iBadWordService.xml"/>
            	<import resource="application-context-iCategoryService.xml"/>
            	<import resource="application-context-iCommentService.xml"/>
            	<import resource="application-context-iCommentTypeService.xml"/>
            	<import resource="application-context-iContentService.xml"/>
            	<import resource="application-context-iContentTypeService.xml"/>
            	<import resource="application-context-iDictionaryService.xml"/>
            	<import resource="application-context-iFlagService.xml"/>
            	<import resource="application-context-iInfoTypeService.xml"/>
            	<import resource="application-context-iProfileService.xml"/>
            	<import resource="application-context-iStatusService.xml"/>
            	<import resource="application-context-iTagService.xml"/>
            	<import resource="application-context-iTopicService.xml"/>
            	<import resource="application-context-iTopicTypeService.xml"/>
            	<import resource="application-context-iUserService.xml"/>
            	<import resource="application-context-iUserTypeService.xml"/>
            	
            	<!-- custom classes not generated but ones that I wrote -->
            	<bean id="ICanvasOfExpressionService"
            		class="com.logixplayer.pf.service.impl.CanvasOfExpressionServiceImpl">
            	</bean>
            	
            	<bean id="ITopicOfTheDayService"
            		class="com.logixplayer.pf.service.impl.TopicOfTheDayServiceImpl">
            	</bean>
            	
            	
            	
            	</beans>
            IProfileService :

            Code:
            <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
            					"http://www.springframework.org/dtd/spring-beans.dtd">
            				<beans>
            
            <bean id="IProfileService" class="com.logixplayer.pf.service.impl.IProfileServiceImpl">
            					<property name="IProfileDAO" ref="ProfileDAO"/>
            				</bean>
            
            </beans>
            please advise.
            thanks!

            Comment


            • #7
              Checking your configuration I don't see a context:annotation-config or context:component-scan element which enables @Autowired. If you don't have that the @Autowired annotation is well not doing anything. The same goes for the @PersistenceUnit/-Context annotations.

              Comment


              • #8
                Yes I do....

                Originally posted by Marten Deinum View Post
                Checking your configuration I don't see a context:annotation-config or context:component-scan element which enables @Autowired. If you don't have that the @Autowired annotation is well not doing anything. The same goes for the @PersistenceUnit/-Context annotations.
                Hi, I do have the following :
                Code:
                	<context:component-scan base-package="com.logixplayer.pf" />
                	<context:annotation-config />
                in dispatcher-servlet.xml. If I did not have it, I could never get the autowired properties inside HomePageController to be instantiated.

                Again it gets instantiated there, but each property itself has autowired properties which is not being instanstiated.
                All my code lives within com.logixplayer.pf's sub-folders...
                this is strange...
                hmmmm this has got me stumped....
                please advise.

                Comment


                • #9
                  The fact that you have it in your dispatcher-servlet.xml doesn't mean it applies to the xml files loaded by the ContextLoaderListener! Bean(Factory)PostProcessors work only on the application context in which they are configured.

                  Comment


                  • #10
                    okay so how many times will I be using this:
                    Code:
                    <context:component-scan base-package="com.logixplayer.pf" />
                    	<context:annotation-config />
                    My understanding is that I only had to do this once...this is a WAR file that I am producing so it is listed once in my dispatch-servlet.xml file...??

                    I mean isn't there a global context...? I am not running individulal JUnit tests on this....
                    This is the HomePageController working with the data-access tier.
                    Are you saying that I have to add:
                    Code:
                    <context:component-scan base-package="com.logixplayer.pf" />
                    	<context:annotation-config />
                    in every application-context spring bean file?
                    Please advise. Thank you.

                    Comment


                    • #11
                      No you have to add it to EACH applicationcontext loaded.

                      In general you have a DispatcherServlet which should only contain the web stuff (controllers, viewresolvers etc) and a ContextLoaderListener which loads the general stuff. However the DispatcherServlet has an ApplicationContext AND the ContextLoaderListener loads an ApplicationContext.

                      The DispatcherServlet has full access to the ApplicationContext loaded by the ContextLoaderListener but its configuration doesn't influence it nor does it the other way around.

                      So adding context:annotation-config to the dispatcherservlet configuration doesn't automatically mean that your xml files (the applicationcontext) loaded by the ContextLoaderListener are also going to use/activate annotation based configuration.

                      Comment


                      • #12
                        contextload listener location

                        Okay this is getting kinda confusing....

                        I have always had my contextLoadListener in my web.xml as so:

                        Code:
                            <listener>
                        		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
                        	</listener>
                        	<context-param>
                        		<param-name>contextConfigLocation</param-name>
                        		<param-value> 
                        					 classpath:data-access-context.xml
                        		</param-value>
                        	</context-param>
                        is this the wrong location for this? NOTE: that I am defining my data-access-context location here.
                        I have also added to my data-access-context.xml:
                        Code:
                        <context:component-scan base-package="com.logixplayer.pf" />
                        	<context:annotation-config />
                        but now I am getting errors at startup:

                        Code:
                        Jan 1, 2010 3:14:01 PM org.apache.catalina.core.ApplicationContext log
                        INFO: Initializing Spring root WebApplicationContext
                        Jan 1, 2010 3:14:05 PM org.apache.catalina.core.StandardContext listenerStart
                        SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
                        org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'homePageController': Autowiring of fields failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.logixplayer.pf.service.IProfileService com.logixplayer.pf.homepage.controller.HomePageController.profileService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'IProfileService' defined in class path resource [application-context-iProfileService.xml]: Cannot resolve reference to bean 'ProfileDAO' while setting bean property 'IProfileDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ProfileDAO' defined in class path resource [data-access-context.xml]: Cannot resolve reference to bean 'entityManagerFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [data-access-context.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: dataAccessPU] Unable to build EntityManagerFactory
                        	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessAfterInstantiation(AutowiredAnnotationBeanPostProcessor.java:243)
                        	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
                        Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.logixplayer.pf.service.IProfileService com.logixplayer.pf.homepage.controller.HomePageController.profileService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'IProfileService' defined in class path resource [application-context-iProfileService.xml]: Cannot resolve reference to bean 'ProfileDAO' while setting bean property 'IProfileDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ProfileDAO' defined in class path resource [data-access-context.xml]: Cannot resolve reference to bean 'entityManagerFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [data-access-context.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: dataAccessPU] Unable to build EntityManagerFactory
                        	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:435)
                        	at org.springframework.beans.factory.annotation.InjectionMetadata.injectFields(InjectionMetadata.java:105)
                        	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessAfterInstantiation(AutowiredAnnotationBeanPostProcessor.java:240)
                        	... 40 more
                        Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'IProfileService' defined in class path resource [application-context-iProfileService.xml]: Cannot resolve reference to bean 'ProfileDAO' while setting bean property 'IProfileDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ProfileDAO' defined in class path resource [data-access-context.xml]: Cannot resolve reference to bean 'entityManagerFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [data-access-context.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: dataAccessPU] Unable to build EntityManagerFactory
                        	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:610)
                        	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:412)
                        	... 42 more
                        Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ProfileDAO' defined in class path resource [data-access-context.xml]: Cannot resolve reference to bean 'entityManagerFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [data-access-context.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: dataAccessPU] Unable to build EntityManagerFactory
                        	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
                        	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
                        	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
                        	... 57 more
                        Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [data-access-context.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: dataAccessPU] Unable to build EntityManagerFactory
                        	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
                        	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
                        	... 70 more
                        Caused by: javax.persistence.PersistenceException: [PersistenceUnit: dataAccessPU] Unable to build EntityManagerFactory
                        	at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:677)
                        	at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126)
                        	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
                        	... 80 more
                        Caused by: org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
                        	at org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:57)
                        	at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:39)
                        	at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:426)
                        	at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
                        	... 86 more
                        Jan 1, 2010 3:14:05 PM org.apache.catalina.core.ApplicationContext log
                        INFO: Set web app root system property: 'pf' = [C:\apache-tomcat-6.0.20\webapps\PublicFountainWAR-0.0.1-SNAPSHOT\]
                        Jan 1, 2010 3:14:05 PM org.apache.catalina.core.ApplicationContext log
                        INFO: Initializing log4j from [C:\apache-tomcat-6.0.20\webapps\PublicFountainWAR-0.0.1-SNAPSHOT\WEB-INF\conf\log4j.xml]
                        Jan 1, 2010 3:14:05 PM org.apache.catalina.core.ApplicationContext log
                        INFO: Shutting down log4j
                        Jan 1, 2010 3:14:05 PM org.apache.catalina.core.ApplicationContext log
                        INFO: Closing Spring root WebApplicationContext
                        Jan 1, 2010 3:14:07 PM org.apache.catalina.core.ApplicationContext log
                        INFO: ContextListener: contextInitialized()
                        Jan 1, 2010 3:14:07 PM org.apache.catalina.core.ApplicationContext log
                        INFO: SessionListener: contextInitialized()
                        its talking about how the entitymanager cannot be instantiated because of Hibernate Dialect must be explicitly set and other errors..

                        I think the way I have organized all of this might not be correct. i.e. the location of the org.springframework.web.context.ContextLoaderListe ner or the way I am setting up the component scan? In the meantime I can try to resolve the hibernate dialect issue but I am not sure if this is really the crux of the problem...

                        Comment


                        • #13
                          looks like its solved for now....

                          hey Martin and Spring Users...

                          thank you Marten for your help, much appreciated...
                          after I made the changes from my last post, I was getting an error with the hibernate.dialect so I added this to my persistence.xml:

                          <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>

                          and now I am not getting null values for my entity manager and internal autowired properties. That's amazing!
                          I just hope this was the right way to go and I will be monitoring this fix to test it out thoroughly.

                          Thank you for all your support!!

                          Comment


                          • #14
                            Well there is one issue right now, which might not be apparent or quite clear.

                            You have 2 component-scan elements now which means your controllers are instantiated twice (they are detected twice) so you might want to either remove the component-scan from the root (ContextLoaderListener) application context because you already specified all the beans (leave the context:annotation-config in place!). Or do some more configuration on the component-scan element. Check the reference guide for options.

                            Comment

                            Working...
                            X