该问题再返回Json数据时候是由于没有导入Jackson的架包导致的.
HTTP Status 406 – Not Acceptable
Type Status Report
Description The target resource does not have a current representation that would be acceptable to the
user agent, according to the proactive negotiation header fields received in the request, and the
server is unwilling to supply a default representation.
Apache Tomcat/8.5.33
我们需要在pox.xml文件中添加依赖即可(jackson-core,jackson-annotations,jackson-databind)。
HTTP Status 500 – Internal Server Error
Type Exception Report
Message Handler processing failed; nested exception is java.lang.NoClassDefFoundError: com/mchange/v2/c3p0/ComboPooledDataSource
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
该问题是使用c3p0连接池时发生的错误,缺少c3p0的jar包,在配置c3p0时候共需要导入两个架包(c3p0-0.9.2,mchange-commons-java-0.2.3.4)
信息 [MLog-Init-Reporter] com.mchange.v2.log.MLog. MLog clients using java 1.4+ standard logging.
该问题导致的原因未将jar导入到我们的项目中
springmvc访问接口404
The origin server did not find a current representation for the target resource or is not willing to disclose that one exists
该问题存在的原因如下: pox.xml中没有添加适合的依赖,扫描器中没有扫描到控制器或者没有扫描控制器。
org.springframework.web.servlet.FrameworkServlet.initServletBean Initializing Servlet 'spring'......忘记截图全内容了,淦
该问题出现的原因是因为pom.xml中没有导入相关的spring框架依赖.
我们只需要在pom.xml中加入这几行,再次运行就基本上ok了。
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>