title: "transaction-manager" in "<tx:annotation-driven ... " tag does not get recognized as a valid reference
body: <p>The context is Java Spring MVC and Hibernate, in IntelliJ. For some reason, in the Spring MVC config file, &quot;transaction-manager&quot; is not recognized as a valid reference. See the red text below:</p>
  <p><a href="https://i.stack.imgur.com/zQksl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zQksl.png" alt="transaction-manager attribute is not allowed here" /></a></p>
  <p>Any tips on how to resolve this?</p>
  <p>Here is the full config file:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;beans xmlns=&quot;http://www.springframework.org/schema/beans&quot;
         xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
         xmlns:context=&quot;http://www.springframework.org/schema/context&quot;
         xmlns:mvc=&quot;http://www.springframework.org/schema/mvc&quot; xmlns:tx=&quot;http://www.springframework.org/schema/cache&quot;
         xsi:schemaLocation=&quot;http://www.springframework.org/schema/beans
         http://www.springframework.org/schema/beans/spring-beans.xsd
         http://www.springframework.org/schema/context
         http://www.springframework.org/schema/context/spring-context.xsd
         http://www.springframework.org/schema/mvc
          http://www.springframework.org/schema/mvc/spring-mvc.xsd http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd&quot;&gt;
  
      &lt;!-- Base-package --&gt;
      &lt;context:component-scan base-package=&quot;com.sprang&quot;/&gt;
      &lt;mvc:annotation-driven/&gt;
  
      &lt;bean class=&quot;org.springframework.web.servlet.view.InternalResourceViewResolver&quot;&gt;
          &lt;property name=&quot;prefix&quot; value=&quot;/WEB-INF/views/&quot;/&gt;
          &lt;property name=&quot;suffix&quot; value=&quot;.jsp&quot; /&gt;
      &lt;/bean&gt;
  
      &lt;!-- Step 1: Define Database DataSource/Connection Pool --&gt;
      &lt;bean id=&quot;myDataSource&quot; class=&quot;com.mchange.v2.c3p0.ComboPooledDataSource&quot; destroy-method=&quot;close&quot;&gt;
          &lt;property name=&quot;driverClass&quot; value=&quot;com.mysql.cj.jdbc.Driver&quot;/&gt;
          &lt;property name=&quot;jdbcUrl&quot; value=&quot;jdbc:mysql://us-cdbr-east-05.cleardb.net:3306/heroku_1e4cf119be0ff4a&quot;/&gt;
          &lt;property name=&quot;user&quot; value=&quot;b3a0c1309826f0&quot;/&gt;
          &lt;property name=&quot;password&quot; value=&quot;5b30f68e&quot;/&gt;
          &lt;property name=&quot;minPoolSize&quot; value=&quot;5&quot;/&gt;
          &lt;property name=&quot;maxPoolSize&quot; value=&quot;20&quot;/&gt;
          &lt;property name=&quot;maxIdleTime&quot; value=&quot;30000&quot;/&gt;
      &lt;/bean&gt;
  
      &lt;!-- Step 2: Setup Hibernate session factory --&gt;
      &lt;bean id=&quot;sessionFactory&quot; class=&quot;org.springframework.orm.hibernate5.LocalSessionFactoryBean&quot;&gt;
          &lt;property name=&quot;dataSource&quot; ref=&quot;myDataSource&quot;/&gt;
          &lt;property name=&quot;packagesToScan&quot; value=&quot;com.sprang.model&quot;/&gt;
          &lt;property name=&quot;hibernateProperties&quot;&gt;
              &lt;props&gt;
                  &lt;prop key=&quot;hibernate.dialect&quot;&gt;org.hibernate.dialect.MySQLDialect&lt;/prop&gt;
                  &lt;prop key=&quot;hibernate.show_sql&quot;&gt;true&lt;/prop&gt;
              &lt;/props&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;!-- Step 3: Setup Hibernate transaction manager --&gt;
      &lt;bean id=&quot;transactionManager&quot; class=&quot;org.springframework.orm.hibernate5.HibernateTransactionManager&quot;&gt;
          &lt;property name=&quot;sessionFactory&quot; ref=&quot;sessionFactory&quot;/&gt;
      &lt;/bean&gt;
  
      &lt;!-- Step 4: Enable configuration of transactional behavior based on annotations --&gt;
      &lt;tx:annotation-driven transaction-manager=&quot;transactionManager&quot; /&gt;
  &lt;/beans&gt;
  </code></pre>