nore>truenore>
figuration>
figuration>
maven-eclipse-pluginfiguration>
figuration>
figuration which allows JUnit tests to be placed in the same folder as java files
figuration>
figuration>
figuration which allows configuration files (such as xml files) to be placed in the same folder as java files
cope>providedcope>
cope>providedcope>
spring-beansspring-expressionspring-ormsqlsqlslf4j-apicglibcglibcope>runtimecope>
这是我的DAO课程
public class Task_Impl implements Task_Interface {
@Autowired
SessionFactory sessionfactory;
@Override
@Transactional
public void createTask(Task task) {
// Todo Auto-generated method stub
sessionfactory.getCurrentSession().save(task);
System.out.println("Task created in database");
}
@Override
public void deleteTask() {
// Todo Auto-generated method stub
}
}
Error creating bean with name 'task_impl_bean': Injection of autowired dependencies Failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: org.hibernate.SessionFactory org.mod.Prime.DAO.Implementation.Task_Impl.sessionfactory; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionfactory' defined in ServletContext resource [/WEB-INF/HelloWeb-servlet.xml]: Invocation of init method Failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/util/DTDEntityResolver
主要根本原因是
Invocation of init method Failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/util/DTDEntityResolver