package com.xxxx.service; import org.springframework.stereotype.Service; @Service public class TypeService { public void test(){ System.out.println("TypeService---"); } }
public class App02 { public static void main( String[] args ) { ApplicationContext ac=new ClassPathXmlApplicationContext("spring02.xml"); // TypeDao typeDao= (TypeDao) ac.getBean("typeDao"); // typeDao.test(); TypeService typeService= (TypeService) ac.getBean("typeService"); typeService.test(); } } 下面是报错信息