spring 常见错误

问题一: WARN  org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/card_console-api/apitest] in DispatcherServlet with name 点do请求不能找到映射

解决方法:

1、可能是MVC配置问题。
2、spring3.2需要加入<mvc:annotation-driven></mvc:annotation-driven>,Controller才可以正确处理

 

问题二:WARN  org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/card_console-api/WEB-INF/views/apitest/menu.jsp] in DispatcherServlet with name 'springServlet' 点do请求可以进入,但是处理完跳转不能进行。

解决方法:

将web.xml中的<url-pattern>/*</url-pattern>改为<url-pattern>*.do</url-pattern>

问题三:No qualifying bean of type [com.mopon.service.account.impl.AccountServiceImpl] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations

解决方法:

如果配置了component-scan,请注意是否是顺序的问题。web.xml和spring的xml要一起观察

 

问题三:spring cachable的错误,启动时,报错:Caused by: java.lang.NoSuchMethodError: DeserializingConverter.<init>(Ljava/lang/ClassLoader;)V

解决办法:jar包冲突导致,使用 spring-core(4.1.4)和spring-data-redis(1.4.1) 对应

 

问题四:spring无网启动

解决办法 :

    线上环境无法联网时,spring启动可能会报错,其实,spring的jar包中本身已经有了对应的dtd,只需要修改启配置文件的配置

  <!-- !DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"-->

<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns="http://www.springframework.org/schema/beans"

xsi:schemaLocation="

http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd">

猜你喜欢

转载自javaprimary.iteye.com/blog/2281235