问题描述:
- 在JAVA框架学习中遇到了org.springframework.beans.factory.BeanCreationException
在控制太区域出现了如下的提示
Error creating bean with name 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor
- 具体显示如下:
/*
* 警告: Exception encountered during context initialization - cancelling refresh attempt:
* org.springframework.beans.factory.BeanCreationException:
* Error creating bean with name 'dataSource' defined
* in class path resource [applicationContext.xml]: BeanPostProcessor
* before instantiation of bean failed; nested exception is
* org.springframework.beans.factory.BeanCreationException:
* Error creating bean with name 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0':
* Cannot resolve reference to bean 'txPointCut' while setting bean property 'pointcut';
* nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException:
* No bean named 'txPointCut' available
*/
解决方法:
- 检查后发现我的model层Account类是
public class Account{
//账户ID
private Integer id;
//用户名
private String username;
//账户余额
private Double balance;
}
- 没有提供setter方法
另外我是没有书写model层的Account的属性所以才会出现上述问题
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public Double getBalance() {
return balance;
}
public void setBalance(Double balance) {
this.balance = balance;
}
!!!问题解决了,遇到和我一样问题的小伙伴可在下方留言,一起讨论哦!