启动tomcat运行项目异常 Caused by: java.lang.Error: Unresolved compilation problems-问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文

启动tomcat运行项目异常 Caused by: java.lang.Error: Unresolved compilation problems

落地花开啦 2016-05-30 16:12:01 5647

启动tomcat运行项目时出现以下异常
Caused by: java.lang.Error: Unresolved compilation problems:

    The import javax.xml.bind cannot be resolved
    The import javax.xml.bind cannot be resolved
    The import javax.xml.bind cannot be resolved
    The import org.codehaus cannot be resolved
    XmlRootElement cannot be resolved to a type
    XmlAccessorType cannot be resolved to a type
    The attribute value is undefined for the annotation type XmlAccessorType
    XmlAccessType cannot be resolved to a variable
    JsonSerialize cannot be resolved to a type
    The attribute using is undefined for the annotation type JsonSerialize 

执行mvn clean install成功,但反编译发现代码不是我的代码,如下

  public String getId() {
    throw new Error("Unresolved compilation problem: \n");
  }
   public void setId(String paramString) {
    throw new Error("Unresolved compilation problem: \n");
  } 
  public Date getUpdateTime() {
    throw new Error("Unresolved compilation problems: \n\tJsonSerialize cannot be resolved to a type\n\tThe attribute using is undefined for the annotation type JsonSerialize\n");
  }
  public void setUpdateTime(Date paramDate) {
    throw new Error("Unresolved compilation problem: \n");
  }

请高手解答,或给出可能原因,谢谢。

启动by: tomcat启动java error启动 error异常 启动异常
分享到
取消 提交回答
全部回答(1)
  • 落地花开啦
    2019-07-17 19:20:42

    1.首先确保eclipse工程Java Compiler属性中的JDK Compliance与Java Build Path中的JRE System library中的JDK版本保持一致。
    2.本地JDK尽量使用较新版本,从而使本地编译器比所依赖的jar包编译器要新,使其向老版本兼容,反之则不行。比如,你本地用jdk1.5编译,而所依赖的jar包是用jdk1.6编译的,可能就会有问题。
    3.确保本地代码编译时所依赖的JAR包是正确的版本,并且同一jar包不要有多个版本重复引入。

    0 0
开发与运维
使用钉钉扫一扫加入圈子
+ 订阅

集结各类场景实战经验,助你开发运维畅行无忧

相似问题
最新问题