当前位置: 代码迷 >> Java Web开发 >> BeanDefinitionStoreException错误,详细贴,请刚才的们再看看,
  详细解决方案

BeanDefinitionStoreException错误,详细贴,请刚才的们再看看,

热度:242   发布时间:2016-04-17 01:15:38.0
BeanDefinitionStoreException异常,详细贴,请刚才的大虾们再看看,急~
各位大虾帮帮忙,小弟刚接触spring,但是在用SSH时候读取Spring配置文件的时候出现的错误如下: 
org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name 'accountDAO' defined in file [/WEB-INF/applicationContext.xml]: Bean class [com.worthtech.billportal.dao.hibernate.AccountHibernateDAO] not found; nested exception is java.lang.ClassNotFoundException: com/worthtech/billportal/dao/AccountDAO 

java.lang.ClassNotFoundException: com/worthtech/billportal/dao/AccountDAO 
  ...... 

我已经写了setter,getter了啊,怎么还报错啊?如下:
package com.worthtech.billportal.service.imp;

import java.util.List;
import com.worthtech.billportal.bean.Account;
import com.worthtech.billportal.dao.AccountDAO;
import com.worthtech.billportal.exception.SCException;
import com.worthtech.billportal.service.AccountService;

public class AccountServiceImp implements AccountService{
private AccountDAO accountDAO;
public void save(Account account) throws SCException {
// TODO Auto-generated method stub
this.getAccountDAO().save(account);
}
public List getAllAccount(){
return this.getAccountDAO().getAllAccount();
}
public AccountDAO getAccountDAO() {
return accountDAO;
}
public void setAccountDAO(AccountDAO accountDAO) {
this.accountDAO = accountDAO;
}

}
Spring 配置如下(部分): 

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> 
  <property name="dataSource"> <ref local="dataSource"/> </property> 
  <property name="mappingResources"> 
  <list> 
  <value>com/worthtech/billportal/bean/Account.hbm.xml </value> 
  </list> 
  </property> 
  <property name="hibernateProperties"> 
  <props> 
  <prop key="hibernate.dialect">${hibernate.dialect} </prop> 
  <prop key="hibernate.show_sql">${hibernate.show_sql} </prop> 
  <prop key="hibernate.jdbc.fetch_size">${hibernate.jdbc.fetch_size} </prop> 
  <prop key="hibernate.jdbc.batch_size">${hibernate.jdbc.batch_size} </prop> 
  </props> 
  </property> 
  </bean> 

<!--dao class--> 
  <bean id="accountDAO" class="com.worthtech.billportal.dao.hibernate.AccountHibernateDAO"> 
  <property name="sessionFactory"> 
  <ref local="sessionFactory"/> 
  </property> 
  </bean> 


<bean id="accountServiceTarget" class="com.worthtech.billportal.service.imp.AccountServiceImp" autowire="byName"/> 
<!--Proxy Class--> 
  <bean id="txProxyTemplate" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> 
  <property name="transactionManager"> 
  <ref bean="myTransactionManager"/> 
  </property> 
  <property name="transactionAttributes"> 
  <props> 
  <prop key="create*">PROPAGATION_REQUIRED,-com.worthtech.billportal.exception.SCException </prop> 
  <prop key="save*">PROPAGATION_REQUIRED,-com.worthtech.billportal.exception.SCException </prop>