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)
Labels: 
(None)


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>

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