title: GrailsContextLoader Error with Transaction Manager
body: <p>I'm using Grails 2.3.3 for an application which has built successfully. </p>
  
  <p>I'm now incorporating Spring security into the application adding the line in the plugins:</p>
  
  <pre><code>compile ":spring-security-core:2.0-RC5"
  </code></pre>
  
  <p>As a result I am getting this GrailsContextLoader error relating to <code>transactionManager</code> and <code>sessionfactory</code> - here is the error:</p>
  
  <blockquote>
    <p>Error |
    2017-10-13 12:46:09,299 [localhost-startStop-1] ERROR context.GrailsContextLoader  - Error initializing the application: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.MappingException: Association references unmapped class: homevu1.PicturesNWShr
    Message: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.MappingException: Association references unmapped class: homevu1.PicturesNWShr</p>
  </blockquote>
  
  <p>PicturesNWShr is one of my domains and there is no problem compiling it if the spring-security plugin is removed. </p>
  
  <p>I have scanned a of related posts although I've not so far found one with an identical problem. But a number are suggesting making modifications to the dependency file in the root folder of the project in order to impose or exclude dependencies from the build. </p>
  
  <p>I would welcome some suggestions?</p>
  
  <p>Here is the domain definition of PicturesNWShr:</p>
  
  <pre><code>package homevu1
  
  import java.util.Date;
  
  class PicturesNWShr {
  
      static constraints = {
          name()
          filename(blank: true, nullable: true)
          dateCreated()
          caption(blank: true, nullable: true)
          slotType(blank: true, nullable: true)
          groupName(blank: true, nullable: true)
      }
  
      static mapping = {
          datasource 'publish'
      }
  
      String name
      String filename
      String caption
      Date dateCreated
      VideoSlotTypeShr slotType
      String groupName // link pictures together for multifile upload 
      // ideal for linking al images of a house together for EAs.
      Date updateDate // The multiple file upload process - checks each instance update is complete 
      // before adding to vidSlot.
      static belongsTo = [userBT: UserShr]
  
  
      String toString() {
          "${name}"
      }
  }
  </code></pre>
  
  <p>-mike</p>