开发者社区> 问答> 正文

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

启动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");
  }

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

展开
收起
落地花开啦 2016-05-30 16:12:01 7749 0
1 条回答
写回答
取消 提交回答
  • 喜欢技术,喜欢努力的人

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

    2019-07-17 19:20:42
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Spring Cloud Alibaba - 重新定义 Java Cloud-Native 立即下载
The Reactive Cloud Native Arch 立即下载
JAVA开发手册1.5.0 立即下载