aspose file tools*
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
Author

iBatis error - No SqlMapClient specified

P Chua
Greenhorn

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

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

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/jee
http://www.springframework.org/schema/jee/spring-jee-2.0.xsd
http://www.springframework.org/schema/tx
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.

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: iBatis error - No SqlMapClient specified