先看网页上的错误信息吧:
javax.servlet.ServletException: Error creating bean with name 'managerFacade ' defined in class path resource [spring.xml]: Cannot resolve reference to bean 'managerImpl ' while setting bean property 'managerServiceImpl '; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'managerImpl ' defined in class path resource [spring.xml]: Cannot resolve reference to bean 'questionsDao ' while setting bean property 'questionsDao '; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'questionsDao ' defined in class path resource [spring.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.webexam.dao.QuestionsDao]: Constructor threw exception; nested exception is com.ibatis.common.exception.NestedRuntimeException: Error occurred. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMapConfig/sqlMap '. Cause: com.ibatis.common.xml.NodeletException: Error parsing XML. Cause: com.ibatis.common.exception.NestedRuntimeException: Error parsing XPath '/sqlMap/resultMap/result '. Cause: com.ibatis.common.exception.NestedRuntimeException: Error. Could not set TypeHandler. Cause: java.lang.ClassNotFoundException: String
Caused by: java.lang.ClassNotFoundException: String
上面的只是第一行。。。
我的spring.xml文件比较简单:
<bean id= "questionsDao "
class= "com.webexam.dao.QuestionsDao ">
</bean>
<bean id= "managerImpl " class= "com.webexam.Service.Manager.ManagerServiceImpl " singleton= "false ">
<property name= "questionsDao ">
<ref local= "questionsDao "> </ref>
</property>
</bean>
<bean id= "managerFacade " class= "com.webexam.Service.Manager.ManagerServiceFacade " singleton = "false ">
<property name = "managerServiceImpl ">
<ref local= "managerImpl "/>
</property>
</bean>
另外,ManagerServiceImpl和ManagerServiceFacade也比较简单,就是set/get方法:
ManagerServiceImpl文件:
public class ManagerServiceImpl {
private QuestionsDao questionsDao;
public QuestionsDao getQuestionsDao() {
return questionsDao;
}
public void setQuestionsDao(QuestionsDao questionsDao) {