It's not a secret anymore!
The moose likes Object Relational Mapping and the fly likes iBatis error - No SqlMapClient specified Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "iBatis error - No SqlMapClient specified" Watch "iBatis error - No SqlMapClient specified" New topic

iBatis error - No SqlMapClient specified

P Chua

Joined: Feb 13, 2009
Posts: 1
Hi All

I am new to ibatis , while trying to confugure ibatis using struts2 and spring, i am facing this error : "No SqlMapClient specified"

Below is my javacode which calls the ibatis ( which extends SqlMapClientDaoSupport)

paramMap.put("bcaNumber", bcaNumber);

childDocIDList = (List<RevenueProfitabilityDetailsDTO>)getSqlMapClientTemplate().queryForObject("retrieveChildRecsFromParentDocId", paramMap);

(where RevenueProfitabilityDetailsDTO is my bean which maps to database table)
The SQLMapClient configuration as specified in XML file (dataAccessContext.xml)

<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="WEB-INF/sql-map-config.xml"/>
<property name="dataSource" ref="dataSource"/>

<bean id="dbSvcImpl" class="">
<property name="sqlMapClient" ref="sqlMapClient"/>
The datasource being reffered in dataAccessContext.xml is defined in another configuration file ( infContext.xml)

<beans xmlns=""
xsi:schemaLocation="" >

<!-- INF Related bean declarations -->
<jee:jndi-lookup id="dataSource" jndi-name="jdbc/CR_DB_DataSource"/>

This datasource has been configured properly in IBMwebshere and working fine , however i am still getting the above mentioned error.
I am catching the exception in my java class but no stacktrace is being printed for it. However if I print e.getMessage() then it prints "No SqlMapClient specified".
I have also added the required ibatis jar to my classpath.

The same configurations are woking for another module but somehow its not working for this module which I am doing. Please help to identify the problem or any settings that I have overlooked.

I agree. Here's the link:
subject: iBatis error - No SqlMapClient specified
jQuery in Action, 3rd edition