找不到类的问题 报找不到类异常
* @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
然后再删除接口上的注解 只保留实现类上面的 以后启动服务器就都正常了 为什么会这样 ?
只标注在实现类上 首次启动服务器就是报类未定义异常
自动扫描配置部分
<?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
...全文
相关推荐
Tomcat正常启动,访问所有页面均报404异常,404异常总结分析
今天遇到一个问题:Tomcat正常启动,访问所有页面均报404异常,究竟该如何解决这个问题呢?下边小编将为大家介绍一下解决方法,需要的朋友可以参考下
sqoop.zip解决报空指针的问题所需要的jar
sqoop.zip解决报空指针的问题所需要的jar.这个jar包适用于安装在CDH6.2.1版本的sqoop
添加json所报的异常
NULL 博文链接:https://670827470.iteye.com/blog/2281015
Idea跑的项目没问题将程序install成jar包运行报错空指针的问题
主要介绍了Idea跑的项目没问题,将程序install成jar包运行报错空指针的问题,本文通过图文并茂的形式给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
这是我工作中的一些jar报吗,我要测试
这是我工作中的一些jar报吗,我要测试


