Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed
<p>Full Error:</p>

<blockquote>
  <p>org.springframework.beans.factory.BeanCreationException: 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: java.util.List</p>
</blockquote>

<p>Here are my Domain classes:</p>

<pre><code>class File implements Serializable {

    String path;
    String name;

    public File(String path, String name) {
        this.path = path;
        this.name = name;
    }
}

class Directory extends File {

    List files = [];

    public Directory(String path, String name) {
        super(path, name);
    }
}
</code></pre>

<p>Here is my DirectoryService:</p>

<pre><code>@Transactional
class DirectoryService {

    def fetchDirectory(String path) {
        java.io.File dir = new Path(path);
        java.io.File[] files = dir.listFiles();

        Directory pdirectory = new Directory(path, dir.getName());
        List list = [];
        for(java.io.File file : files) {
            File pfile = new File(path, file.getName());
            list.add(pfile);
        }
        pdirectory.files = list;
        return pdirectory;
    }
}
</code></pre>

<p>The problem occurs because I have a <code>List files = []</code> in Directory model class.</p>

<p>I don't even understand the problem to be able to find a solution. Why does Grails not allow me to have list in models? And if it is not actually allowed, I want to know how to make it work.</p>

<p>In my application I have many models with datasources that are not databases; and in this case, the SQL relationship equivalent is "Directory hasMany File." Also Directory itself is a subset of File.</p>