Hello,
I am trying to do spring managed struts action via the org.springframework.web.struts.ContextLoaderPlugIn and the org.springframework.web.struts.DelegatingActionPro xy, but I am getting an error. Here is my error msg:
Code:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlMapClient' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.FatalBeanException: Could not instantiate class [org.springframework.orm.ibatis.SqlMapClientFactoryBean]; constructor threw exception; nested exception is java.lang.NoClassDefFoundError: com.ibatis.sqlmap.engine.transaction.external.ExternalTransactionConfig org.springframework.beans.FatalBeanException: Could not instantiate class [org.springframework.orm.ibatis.SqlMapClientFactoryBean]; constructor threw exception; nested exception is java.lang.NoClassDefFoundError: com.ibatis.sqlmap.engine.transaction.external.ExternalTransactionConfig java.lang.NoClassDefFoundError: com.ibatis.sqlmap.engine.transaction.external.ExternalTransactionConfig
All of my spring config files are located:
/WEB-INF/
MY struts plugin, located in my struts-config.xml, looks like so:
Code:<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn"> <set-property property="contextConfigLocation" value="/WEB-INF/applicationContext.xml"/> </plug-in>
My applicationContext.xml looks like so:
Code:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName"> <!-- com.mysql.jdbc.Driver org.gjt.mm.mysql.Driver //--> <value>org.gjt.mm.mysql.Driver</value> </property> <property name="url"> <value>jdbc:mysql://localhost:3306/spring_test</value> </property> <property name="username"> <value>username</value> </property> <property name="password"> <value>pw</value> </property> </bean> <bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean"> <property name="configLocation"> <value>/sqlMapConfig.xml</value> </property> </bean> <bean id="testDao" class="com.pouncil.common.dao.SqlMapClientTestDao"> <property name="sqlMapClient"><ref local="sqlMapClient"/></property> <property name="dataSource"><ref local="dataSource"/></property> </bean> <bean id="customerIbatisDao" class="com.pouncil.common.dao.ibatis.CustomerSqlMapDao"> <property name="sqlMapClient"><ref local="sqlMapClient"/></property> <property name="dataSource"><ref local="dataSource"/></property> </bean> <bean id="customerService" class="com.pouncil.common.service.CustomerServiceImpl"> <constructor-arg> <ref bean="customerIbatisDao"/> </constructor-arg> </bean> <bean id="customer" class="com.pouncil.common.pojo.model.Customer"> <property name="firstName"> <value>Frisco</value> </property> <property name="middleName"> <value>DeShawn</value> </property> <property name="lastName"> <value>Pullom</value> </property> <property name="email"> <value>tim@yahoo.com</value> </property> <property name="age"> <value>17</value> </property> <property name="gender"> <value>male</value> </property> <property name="ethnicity"> <value>Black</value> </property> <property name="createdDate"> <value>12/01/2003</value> </property> <property name="lastmodifiedDate"> <value>05/01/2005/</value> </property> <property name="createdBy"> <value>spring-injection</value> </property> <property name="lastmodifiedBy"> <value>spring-injection</value> </property> </bean> <bean name="/scustomer" class="com.pouncil.web.struts.actions.SpringCustomerAction"> <property name="customerService"><ref local="customerService"/></property> </bean> <bean name="/cajunfamily/scustomer" class="com.pouncil.web.struts.actions.SpringCustomerAction"> <property name="customerService"><ref local="customerService"/></property> </bean> </beans>
My slqMapConfig.xml look like this:
Code:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE sqlMapConfig PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN" "http://www.ibatis.com/dtd/sql-map-config-2.dtd"> <sqlMapConfig> <sqlMap resource="/WEB-INF/customer-ibatis.xml"/> </sqlMapConfig>


Reply With Quote