找不到类的问题 报找不到类异常
* @Service注解要标在实现类上面 服务bean面向接口编程(有时候需要先标在接口和实现类上,启动web(Tomcat)服务器一次 正常
然后再删除接口上的注解 只保留实现类上面的 以后启动服务器就都正常了 为什么会这样 ?
只标注在实现类上 首次启动服务器就是报类未定义异常
自动扫描配置部分
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<context:component-scan base-package="com.mysite.cms" />
类所在包名是com.mysite.cms.service和com.mysite.cms.service.impl