第一次在JBOSS中运行我的应用程序时遇到一个奇怪的问题:错误信息是:
javax.servlet.ServletException: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for project.services.dao.workerDAO.getAllWorkers
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
映射器文件:project.services.dao.sql.workerDAO.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="project.services.dao.workerDAO">
<select id="getAllWorkers" parameterType="java.lang.String"
resultType="Worker">
Select wrk.Id As workerId, wrk.Nm As workerName
From Worker wrk
</select>
</mapper>
但是,第二次没有错误消息。