Hello, I am having issues with creating a sql map. I have set up the application according to the developer's guide, and for some reason, it isn't loading the sql maps. I have enclosed the configuration files and the Java file that gets the sqlMap. I have isolated the handing out of the SqlMapClient via a singleton, and for testing purposes, I used the SqlMapClientImpl so I can get at the SqlMapExecutorDelegate to see what SqlMaps are loaded. I wrote a test for the singleton and am getting the following stack trace:
com.ibatis.sqlmap.client.SqlMapException: There is no statement named
getEmergencyInfo in this SqlMap.
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.getMappedStatement(SqlMapExecutorDelegate.java:288)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:552)
at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:536)
at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:97)
at
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClientImpl.java:69)
at
com.ball.persistence.ibatis.dao.IbatisSqlMapManagerTest.testBTestSqlMap(IbatisSqlMapManagerTest.java:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at junit.textui.TestRunner.doRun(TestRunner.java:116)
at
com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(IdeaJUnitAgent.java:57)
at junit.textui.TestRunner.start(TestRunner.java:172)
at
com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(TextTestRunner2.java:23)
at
com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:97)
at
com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31)
What could be possibly happening? I thought that I set up the files the way the
Developer's Guide states.
Thanks,
Russ B.
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sql-map
PUBLIC "-//iBATIS.com//DTD SQL Map 1.0//EN"
"http://www.ibatis.com/dtd/sql-map.dtd">
<!-- Always ensure to use the correct XML header as above! -->
<sql-map namespace="EnergencyContact">
<statment id="getEmergencyInfo"
parameter-class="com.ball.persistence.valueObjects.EmergencyContactValue"
result-class="com.ball.persistence.valueObjects.EmergencyContactValue">
<![CDATA[select
PEECNM AS EmergencyContactName,
PEECAD AS EmergencyContactAddress,
PEECCS AS EmergencyContactCityState,
PEECPH AS EmergencyContactPhone,
PEEDEP AS EmergencyContactRelationship,
PEDOC AS EmergencyContactPhysician,
PEDOC# AS EmergencyContactPhysicianPhone
from #schema.name#.PEPMS
where PEER = #employee.group# and PEEN = #employee.number#]]>
</statment>
<statment id="updateEmergencyInfo"
parameter-class="com.ball.persistence.valueObjects.EmergencyContactValue"
result-class="com.ball.persistence.valueObjects.EmergencyContactValue">
<![CDATA[update
#schema.name#.PEPMS SET
<isNotEmpty preappend="," property="EmergencyContactName">
PEECNM = #EmergencyContactName#
</isNotEmpty>
<isNotEmpty preappend="," property="">
PEECAD = #EmergencyContactAddress#
</isNotEmpty>
<isNotEmpty preappend="," property="EmergencyContactCityState">
PEECCS = #EmergencyContactCityState#
</isNotEmpty>
<isNotEmpty preappend="," property="EmergencyContactPhone">
PEECPH = #EmergencyContactPhone#
</isNotEmpty>
<isNotEmpty preappend="," property="EmergencyContactRelationship">
PEEDEP = #EmergencyContactRelationship#
</isNotEmpty>
<isNotEmpty preappend="," property="EmergencyContactPhysician">
PEDOC = #EmergencyContactPhysician#
</isNotEmpty>
<isNotEmpty preappend="," property="EmergencyContactPhysicianPhone">
PEDOC# = #EmergencyContactPhysicianPhone#
</isNotEmpty>
where PEER = #employee.group# and PEEN = #employee.number#]]>
]]>
</statment>
</sql-map><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sql-map-config
PUBLIC "-//iBATIS.com//DTD SQL Map Config 1.0//EN"
"file:///opt/hrforyou/hrforyou_server/hrforyou/conf/sql-map-config.dtd">
<!-- Always ensure to use the correct XML header as above! -->
<sql-map-config>
<sql-map resource="com/ball/persistence/ibatis/maps/EmergencyContact.xml"/>
</sql-map-config>
IbatisSqlMapManager.java
Description: IbatisSqlMapManager.java

