• Post Reply Bookmark Topic Watch Topic
  • New Topic

iBatis error - No SqlMapClient specified  RSS feed

P Chua
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 (DBServiceImpl.java 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="com.scb.cr.common.impl.DBServiceImpl">
<property name="sqlMapClient" ref="sqlMapClient"/>
The datasource being reffered in dataAccessContext.xml is defined in another configuration file ( infContext.xml)

<beans xmlns="http://www.springframework.org/schema/beans"
http://www.springframework.org/schema/tx/spring-tx-2.0.xsd" >

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

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!