开发中遇到的问题汇总

1、[ERROR] Non-resolvable parent POM: Could not find artifact cn.itcast.parent:itcast-parent:pom:0.0.1-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 4, column 10 -> [Help 2]

原因:找不到parent,在本地库中找不到。是因为没有把parent工程install到本地。

解决方法:选中parent工程,run as --> maven install


2、使用国内的maven mirror,加快构建速度

修改maven根目录下的conf文件夹中的setting.xml文件,内容如下:

  <mirrors>
    <mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>        
    </mirror>
  </mirrors>

之后就能享受如飞的maven下载速度。


3、问题:Spring中返回JSON数据,在前台出现HTTP Status 406错误。

HTTP Status 406 -


type Status report

message

description The resource identified by this request is only capable of generating responses with characteristics not acceptable according to the request "accept" headers.

引起的原因: 

   由于设置了@ResponseBody,要把对象转换成json格式,缺少转换依赖的jar包,故此错。 
解决办法: 
   加入依赖的jar,jackson-core-asl-1.9.12.jar,jackson-mapper-asl-1.9.12.jar问题解决。

加入了 依赖,问题依旧。

发现项目启动日志最后未出现如下提示:

四月 27, 2017 9:26:26 上午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-80"]

说明工程未能成功启动。

可能原因2:检查工程构建所用的设置不对,如下图所示,由于工程和Maven的目录拷贝到了另一个盘符下,所以出现这种错误。改过来,重新构建,就好了。


可能原因3:端口已被占用,换个端口

方法:更改pom.xml中的端口

<build>
<plugins>
<!-- 配置Tomcat插件 -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<configuration>
<port>8880</port>
<!-- 访问的根路径 http://127.0.0.1:{port}/{path} -->
<path>/</path>
</configuration>
</plugin>
</plugins>
</build>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值