获取“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

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

问题描述

为了修复损坏的GWT在Chrome 61中的拖放,我们决定升级
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的一部分(可能不应该' t已经开始了,这就是它消失的原因):

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):

Maven:

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

Gradle:

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天全站免登陆