如图所示异常
代码:
public interface HutaoDao {
public void save();
}
public class HutaoDaoImpl implements HutaoDao{
private HutaoDao hutaoDao = new HutaoDaoImpl();
public void save(){
System.out.println("打雷啦,起身啦");
hutaoDao.save();
}
}
public interface HutaoService {
public void save();
}
public class HutaoServiceImpl implements HutaoService {
public void save(){
System.out.println("再会啦");
}
}
xml配置:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="hutaoDao" class="com.mihoyo.dao.impl.HutaoDaoImpl"/>
<bean id="hutaoService" class="com.mihoyo.dao.impl.service.impl.HutaoServiceImpl"/>
</beans>
pom配置:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mihoyo</groupId>
<artifactId>Spring---yuanshen1</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>5.3.22</version>
</dependency>
</dependencies>
</project>