Dashboard > iBATIS DataMapper > Home > Using Ibator to Generate Code for iBATIS
Using Ibator to Generate Code for iBATIS
Added by Paul, last edited by Paul on Sep 16, 2008  (view change)


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".


<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.


<?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">
    <transactionManager type="SQLMAP">
    <property name="SqlMapConfigResource" value="sqlMapConfig.xml" />
    <!-- DAO interfaces and implementations should be listed here -->
    <dao interface="com.example.ibatis.impl.TestDAO"
    implementation="com.example.ibatis.impl.TestDAOImpl" />

Site running on a free Atlassian Confluence Open Source Project License granted to OSS. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.5 Build:#811 Jul 25, 2007) - Bug/feature request - Contact Administrators