gpt4 book ai didi

validation - gwt 编译期间的 GWT 验证错误 - 没有可用的源代码

转载 作者:行者123 更新时间:2023-12-03 16:47:28 24 4
gpt4 key购买 nike

我正在尝试使用休眠验证器进行 gwt 验证。我遵循了 http://code.google.com/p/google-web-toolkit/wiki/BeanValidation 中的步骤并根据 http://code.google.com/p/google-web-toolkit/source/browse/trunk/samples/validation/ 处的示例验证项目配置我的项目

我的 .gwt.xml 文件包含:

<inherits name="org.hibernate.validator.HibernateValidator" />

和我的自定义验证工厂:
<replace-with class="my.package.here.client.validation.ValidatorFactory">
<when-type-is class="javax.validation.ValidatorFactory" />
</replace-with>

验证在开发模式下在客户端和服务器端都可以完美运行,但是在尝试 gwt 编译时,我得到:
gwtc-production:
[java] Compiling module my.package.MyModule
[java] Validating newly compiled units
[java] [ERROR] Errors in 'jar:file:/hibernate-validator-4.2.0.Final-sources.jar!/org/hibernate/validator/constraints/impl/FutureValidatorForReadableInstant.java'
[java] [ERROR] Line 32: No source code is available for type org.joda.time.ReadableInstant; did you forget to inherit a required module?
[java] [ERROR] Errors in 'jar:file:/hibernate-validator-4.2.0.Final-sources.jar!/org/hibernate/validator/constraints/impl/FutureValidatorForReadablePartial.java'
[java] [ERROR] Line 32: No source code is available for type org.joda.time.ReadablePartial; did you forget to inherit a required module?
[java] [ERROR] Errors in 'jar:file:/hibernate-validator-4.2.0.Final-sources.jar!/org/hibernate/validator/constraints/impl/PastValidatorForReadableInstant.java'
[java] [ERROR] Errors in 'jar:file:/hibernate-validator-4.2.0.Final-sources.jar!/org/hibernate/validator/constraints/impl/SafeHtmlValidator.java'
[java] [ERROR] Line 22: The import org.jsoup cannot be resolved
[java] [ERROR] Line 23: The import org.jsoup cannot be resolved
[java] [ERROR] Line 35: Whitelist cannot be resolved to a type
[java] [ERROR] Line 40: Whitelist cannot be resolved to a type
[java] [ERROR] Line 40: Whitelist cannot be resolved
[java] [ERROR] Line 43: Whitelist cannot be resolved to a type
[java] [ERROR] Line 43: Whitelist cannot be resolved
[java] [ERROR] Line 46: Whitelist cannot be resolved to a type
[java] [ERROR] Line 46: Whitelist cannot be resolved
[java] [ERROR] Line 49: Whitelist cannot be resolved to a type
[java] [ERROR] Line 49: Whitelist cannot be resolved
[java] [ERROR] Line 52: Whitelist cannot be resolved to a type
[java] [ERROR] Line 52: Whitelist cannot be resolved
[java] [ERROR] Line 55: Whitelist cannot be resolved to a type
[java] [ERROR] Line 62: Jsoup cannot be resolved
[java] [ERROR] Line 62: Whitelist cannot be resolved to a type
[java] [ERROR] Errors in 'jar:file:gwt-user.jar!/org/hibernate/validator/super/org/hibernate/validator/engine/PathImpl.java'
[java] [ERROR] Line 72: The constructor NodeImpl(String) is undefined
[java] [ERROR] Line 84: The constructor NodeImpl(Path.Node) is undefined
[java] [ERROR] Line 95: The constructor NodeImpl(Path.Node) is undefined
[java] [ERROR] Line 202: The constructor NodeImpl(String) is undefined
[java] [ERROR] Line 204: The method setInIterable(boolean) is undefined for the type NodeImpl
[java] [ERROR] Line 209: The method setIndex(Integer) is undefined for the type NodeImpl
[java] [ERROR] Line 212: The method setKey(String) is undefined for the type NodeImpl
[java] [ERROR] Aborting compile due to errors in some input files

显然我缺少一些源 jar。我的类路径上有(除其他外):
hibernate-validator-4.2.0.Final.jar
hibernate-validator-4.2.0.Final-sources.jar

我也尝试添加 joda-time-2.1.jar , joda-time-2.1-sources.jar , jsoup-1.6.3.jarjsoup-1.6.3-sources.jar .

不应该继承 org.hibernate.validator.HibernateValidator 来处理 super 源,所以我不需要提供源吗?谁能看到我错过了什么?

最佳答案

GWT 是针对 Hibernate Validator 4.1.0-Final 构建的,并且依赖于它的一些内部结构( PathImplNodeImpl ),显然这些在 Hibernate Validator 4.2.0 中发生了变化。

使用 4.1.0-Final(或者可能是示例中的 4.0.2.GA)而不是 4.2.0。

可以在 GWT Tracker 中跟踪问题,我们可能至少应该明确记录不兼容性。

关于validation - gwt 编译期间的 GWT 验证错误 - 没有可用的源代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12385785/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com