Troubleshooting
Symptom: I'm getting a java.lang.InstantiationException when using iBATIS DAOs.
Cause 1: Ensure that your ibator configuration file (e.g.abatorConfig.xml) defines the <doaGenerator> element with type="IBATIS".
e.g.
<daoGenerator targetPackage="com.example.ibatis.impl" targetProject="example" type="IBATIS" />
Cause 2: Ensure your DAO configuration file (e.g. dao.xml) defines all <doa> elements correctly. That is, check the spelling and package name is correct for each interface and implementation attribute.
e.g.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE daoConfig PUBLIC "-//ibatis.apache.org//DTD DAO Configuration 2.0//EN" "http://ibatis.apache.org/dtd/dao-2.dtd"> <daoConfig> <context> <transactionManager type="SQLMAP"> <property name="SqlMapConfigResource" value="sqlMapConfig.xml" /> </transactionManager> <!-- DAO interfaces and implementations should be listed here --> <dao interface="com.example.ibatis.impl.TestDAO" implementation="com.example.ibatis.impl.TestDAOImpl" /> ... </context> </daoConfig>
