title: spring beans is not configured in struts2?
body: <p>I am doing a project by using struts2 ,spring and hibernate.I have faced a problem in struts.xml file that its not taking the beans which is declared in applictioncontext.xml.
  my applicationcontext.xml looks like this </p>
  
  <pre><code>    &lt;bean id="dvdDAO" class="com.ideas2it.dvdstruts.DvdDAO"&gt;
      &lt;property name="sessionFactory" ref="sessionFactory"/&gt;
  &lt;/bean&gt;
  &lt;bean id="userDetailDAO" class="com.ideas2it.dvdstruts.UserDetailDAO"&gt;
      &lt;property name="sessionFactory" ref="sessionFactory" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="hibernatetransactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"&gt;
      &lt;property name="sessionFactory" ref="sessionFactory" /&gt;
  &lt;/bean&gt;
  
  &lt;bean name="DvdAction" class="com.ideas2it.dvdstruts.DvdAction" &gt;
  &lt;property name="dvdDAO" ref="dvdDAO"/&gt;
  &lt;property name="userDetailDAO" ref="userDetailDAO"/&gt;
  &lt;/bean&gt;
  &lt;bean name="LoginAction" class="com.ideas2it.dvdstruts.LoginAction" &gt;
  &lt;property name="userDetailDAO" ref="userDetailDAO"/&gt;
  &lt;/bean&gt;
  
  &lt;bean name="AccountCreationAction" class="com.ideas2it.dvdstruts.AccountCreationAction" &gt;
  &lt;property name="userDetailDAO" ref="userDetailDAO"/&gt;
  </code></pre>
  
  <p>my struts.xml</p>
  
  <pre><code>&lt;struts&gt;
      &lt;constant name="struts.devMode" value="true" /&gt;
      &lt;constant name="struts.enable.SlashesInActionNames" value="true"/&gt;
      &lt;constant name="struts.objectFactory" value="spring"/&gt;
      &lt;package name="basicstruts2" namespace="/" extends="struts-default"&gt;
          &lt;action name="register" class="AccountCreationAction" method="register" &gt;
              &lt;result name="success"&gt;Login.jsp&lt;/result&gt;
              &lt;result name="input"&gt;failure.jsp&lt;/result&gt;
          &lt;/action&gt;
          &lt;action name="login" class="LoginAction" method="loginProcess" &gt;
              &lt;result name="success" type="redirectAction"&gt; 
              &lt;param name="actionName"&gt;display&lt;/param&gt; 
              &lt;param name="userDetail"&gt;${userDetail}&lt;/param&gt;
              &lt;/result&gt;
              &lt;result name="input"&gt;failure.jsp&lt;/result&gt;
          &lt;/action&gt;
          &lt;action name="insert" class="DvdAction" method="insertDvd"&gt;
              &lt;result type="redirectAction"&gt;
              &lt;param name="actionName"&gt;display&lt;/param&gt;
              &lt;/result&gt;
          &lt;/action&gt;
  
          &lt;action name="delete" class="DvdAction" method="deleteDvd"&gt;
              &lt;result type="redirectAction"&gt;
              &lt;param name="actionName"&gt;display&lt;/param&gt;
              &lt;/result&gt;
          &lt;/action&gt;
  
          &lt;action name="update" class="DvdAction" method="updateDvd"&gt;
              &lt;result type="redirectAction"&gt;
              &lt;param name="actionName"&gt;display&lt;/param&gt;
              &lt;/result&gt;
          &lt;/action&gt;
  
          &lt;action name="display" class="DvdAction" method="displayDvd"&gt;
              &lt;result name="success"&gt;Dvd.jsp&lt;/result&gt;
          &lt;/action&gt;
  
  
      &lt;/package&gt;
  &lt;/struts&gt;
  </code></pre>
  
  <p>The beans which are in applicationcontext.xml which is not referred here.I am getting error in log like
  error in the log:</p>
  
  <pre><code>    INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
      2012-12-14 10:22:09,821 INFO  org.springframework.web.context.ContextLoader.initWebApplicationContext:187 - Root WebApplicationContext: initialization started
      2012-12-14 10:22:09,901 INFO  org.springframework.web.context.support.XmlWebApplicationContext.prepareRefresh:456 - Refreshing Root WebApplicationContext: startup date [Fri Dec 14 10:22:09 IST 2012]; root of context hierarchy
      2012-12-14 10:22:09,999 INFO  org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions:315 - Loading XML bean definitions from ServletContext resource [/WEB-INF/config/dvdstruts-context.xml]
      2012-12-14 10:22:10,173 INFO  org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions:315 - Loading XML bean definitions from ServletContext resource [/WEB-INF/classes/struts.xml]
      2012-12-14 10:22:11,644 INFO  org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons:555 - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@6dbdc9: defining beans [dataSource,sessionFactory,dvdDAO,userDetailDAO,hibernatetransactionManager,DvdAction,LoginAction,AccountCreationAction]; root of factory hierarchy
  
  
      .........//hibernate mapping some log file info
   2012-12-14 10:22:22,825 DEBUG com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.debug:57 - Loaded [BUILDER] {PackageConfig Name:convention-default namespace: parents:[{PackageConfig Name:struts-default namespace: parents:[]}]}
  2012-12-14 10:22:22,825 DEBUG com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.debug:57 - Loaded [BUILDER] {PackageConfig Name:hibernate-default namespace: parents:[{PackageConfig Name:struts-default namespace: parents:[]}]}
  2012-12-14 10:22:22,826 DEBUG com.opensymphony.xwork2.interceptor.I18nInterceptor.debug:57 - new I18nInterceptor()
  2012-12-14 10:22:22,843 DEBUG com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.debug:57 - Loaded [BUILDER] {PackageConfig Name:hibernateManager namespace:/hibernateManager parents:[{PackageConfig Name:struts-default namespace: parents:[]}]}
  2012-12-14 10:22:22,850 DEBUG com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.debug:57 - Loaded /hibernateManager/* in 'hibernateManager' package:{ActionConfig * (.{1}()) - action - jar:file:/home/saranya/Desktop/apache-tomcat-6.0.20/webapps/dvd_struts/WEB-INF/lib/struts2-fullhibernatecore-plugin-1.4-GA.jar!/struts-plugin.xml:74:36}
  2012-12-14 10:22:22,850 DEBUG com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.debug:57 - Loaded [BUILDER] {PackageConfig Name:basicstruts2 namespace:/ parents:[{PackageConfig Name:struts-default namespace: parents:[]}]}
  Dec 14, 2012 10:22:22 AM org.apache.catalina.core.StandardContext start
  SEVERE: Error filterStart
  Dec 14, 2012 10:22:22 AM org.apache.catalina.core.StandardContext start
  SEVERE: Context [/dvd_struts] startup failed due to previous errors
  2012-12-14 10:22:22,885 INFO  org.springframework.web.context.support.XmlWebApplicationContext.doClose:1002 - Closing Root WebApplicationContext: startup date [Fri Dec 14 10:22:09 IST 2012]; root of context hierarchy
  2012-12-14 10:22:22,886 INFO  org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons:422 - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@6dbdc9: defining beans [dataSource,sessionFactory,dvdDAO,userDetailDAO,hibernatetransactionManager,DvdAction,LoginAction,AccountCreationAction]; root of factory hierarchy
  2012-12-14 10:22:22,887 INFO  org.springframework.orm.hibernate3.LocalSessionFactoryBean.destroy:246 - Closing Hibernate SessionFactory
  2012-12-14 10:22:22,887 INFO  org.hibernate.impl.SessionFactoryImpl.close:805 - closing
  log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
  </code></pre>
  
  <p>my web.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" &gt;
  &lt;web-app&gt;
  &lt;display-name&gt;Struts 2 Dvd Application&lt;/display-name&gt;
  
      &lt;filter&gt;
          &lt;filter-name&gt;Spring_struts&lt;/filter-name&gt;
          &lt;filter-class&gt;org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter&lt;/filter-class&gt;
  
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/filter&gt;
       &lt;context-param&gt;
              &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
              &lt;param-value&gt;/WEB-INF/config/dvdstruts-context.xml,/WEB-INF/classes/struts.xml&lt;/param-value&gt;
  
        &lt;/context-param&gt;
  
      &lt;listener&gt;
              &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
          &lt;/listener&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;Spring_struts&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
       &lt;welcome-file-list&gt;
              &lt;welcome-file&gt;Login.jsp&lt;/welcome-file&gt;
          &lt;/welcome-file-list&gt;
  
  &lt;/web-app&gt;
  </code></pre>