获取“XmlRootElement 无法解析为类型"将 GWT 从 2.8.1 升级到 2.8.2 后出错 [英] Getting "XmlRootElement cannot be resolved to a type" error after upgrading GWT from 2.8.1 to 2.8.2

查看:14
本文介绍了获取“XmlRootElement 无法解析为类型"将 GWT 从 2.8.1 升级到 2.8.2 后出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了修复Chrome 61中损坏的GWT拖放问题,我们决定升级GWT,因为修复是在 GWT 2.8.2 中.

In order to fix the broken GWT drag and drop in Chrome 61, we decided to upgrade GWT since the fix is in GWT 2.8.2.

升级后,我收到了以下数百个错误:

After upgrading, I got hundreds of following errors:

[ERROR] Line 7: XmlRootElement cannot be resolved to a type
[ERROR] Line 3: The import javax.xml.bind cannot be resolved

我尝试将其他依赖项升级到最新版本,但没有成功.任何解决方案或建议表示赞赏.谢谢.

I tried to upgraded other dependencies to the latest version and got no luck. Any solutions or suggestions are appreciated. Thanks.

推荐答案

你现在需要添加对那个 jar 的依赖,它不再是 GWT 的一部分(并且可能不应该从一开始,这就是为什么它不见了):

You need to add a dependency on that jar now, it is no longer part of GWT (and probably shouldn't have been to begin with, which is why it is gone):

马文:

<dependency>
  <groupId>javax.xml.bind</groupId>
  <artifactId>jaxb-api</artifactId>
  <version>2.3.0</version>
  <classifier>sources</classifier>
  <scope>provided</scope>
</dependency>

摇篮:

gwt 'javax.xml.bind:jaxb-api:2.3.0'

<小时>

更正,看起来这可能不仅仅与更新 GWT 有关,而是特定于 Java 9 - JDK 9 中不再包含这些类,因此您实际上必须依赖于您的 jaxb-api项目.


Correction, it looks like this might not be just related to updating GWT, but specific to Java 9 - no longer are these classes included in JDK 9, so you must actually have a dependency on the jaxb-api in your project.

这篇关于获取“XmlRootElement 无法解析为类型"将 GWT 从 2.8.1 升级到 2.8.2 后出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆