• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

iBatis error - No SqlMapClient specified

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>

<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
 
It's weird that we cook bacon and bake cookies. Eat this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic