异常信息: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [spring/applicationContext-db.xml]: 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' defined in class path resource [spring/applicationContext-db.xml]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException:Illegal attempt to map a non collection as a @OneToMany, @ManyToMany or @CollectionOfElements: com.PLCmonitor.domain.CraneQueryTimes.users
解决方法:private ArrayList<User> user=new ArrayList<User>();换成private List<User> exams=new ArrayList<User>();