GWT 2.4:“;发生内部编译器异常";在使用Hibernate进行Bean验证的项目中
自从我决定在我的GWT项目中使用JSR303Bean验证以来,已经过了大约5个小时了,我不得不说,我甚至无法(礼貌地)在谷歌网站上表达我对这个主题有多么不满意 我真的希望你们能帮我 我随后将客户端bean验证添加到我的项目中。不幸的是,它只工作了一次,并且在运行时抛出了一个异常,表示我需要将Hibernate验证源添加到类路径中。我修正了这一点,并决定重新声明我的依赖关系(这是我一生中最大的错误),但我再也不能让它工作了 我无法使用GWT SDK中的验证示例,因为它不可编译,因为它有两个类GWT 2.4:“;发生内部编译器异常";在使用Hibernate进行Bean验证的项目中,gwt,bean-validation,gwt2,hibernate-validator,Gwt,Bean Validation,Gwt2,Hibernate Validator,自从我决定在我的GWT项目中使用JSR303Bean验证以来,已经过了大约5个小时了,我不得不说,我甚至无法(礼貌地)在谷歌网站上表达我对这个主题有多么不满意 我真的希望你们能帮我 我随后将客户端bean验证添加到我的项目中。不幸的是,它只工作了一次,并且在运行时抛出了一个异常,表示我需要将Hibernate验证源添加到类路径中。我修正了这一点,并决定重新声明我的依赖关系(这是我一生中最大的错误),但我再也不能让它工作了 我无法使用GWT SDK中的验证示例,因为它不可编译,因为它有两个类Ser
ServerValidator
的实现。奇怪
所以为了简化我的问题,我使用IntelliJ IDEA的项目向导创建了虚拟GWT应用程序
我在模块xml中添加了以下元素:
<inherits name="org.hibernate.validator.HibernateValidator"/>
<replace-with class="com.mySampleApplication.client.ClientValidatorFactory">
<when-type-is class="javax.validation.ValidatorFactory"/>
</replace-with>
在onModuleLoad()
方法中,我添加了这一行,这会导致编译器崩溃
Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
最后,我使用了以下jar,它们是我从GWTSDK的验证样本中复制的
hibernate-validator-4.1.0.Final-sources.jar
hibernate-validator-4.1.0.Final.jar
log4j-1.2.16.jar
slf4j-api-1.6.1.jar
slf4j-log4j12-1.6.1.jar
validation-api-1.0.0.GA-sources.jar
validation-api-1.0.0.GA.jar
但当我编译我的项目时,它给出了以下无意义的错误:
在详细的GWT编译器日志中,我看到:
Loaded 2315 units from persistent store.
Found 2282 cached units. Used 2282 / 2282 units from cache.
Added 0 units to persistent cache.
Validating newly compiled units
Errors in 'jar:file:/C:/work/externals/gwt/gwt-user.jar!/org/hibernate/validator/engine/ConstraintViolationImpl_CustomFieldSerializer.java'
Line 33: No source code is available for type org.hibernate.validator.engine.ConstraintViolationImpl<T>; did you forget to inherit a required module?
Errors in 'jar:file:/C:/work/externals/gwt/gwt-user.jar!/org/hibernate/validator/engine/ValidationSupport.java'
Line 43: No source code is available for type org.hibernate.validator.engine.ConstraintViolationImpl<T>; did you forget to inherit a required module?
Errors in 'jar:file:/C:/work/externals/gwt/gwt-user.jar!/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/EmailValidator.java'
Line 25: No source code is available for type org.hibernate.validator.constraints.Email; did you forget to inherit a required module?
Errors in 'jar:file:/C:/work/externals/gwt/gwt-user.jar!/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/ScriptAssertValidator.java'
Line 26: No source code is available for type org.hibernate.validator.constraints.Email; did you forget to inherit a required module?
Errors in 'jar:file:/C:/work/externals/gwt/gwt-user.jar!/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/URLValidator.java'
Line 26: No source code is available for type org.hibernate.validator.constraints.URL; did you forget to inherit a required module?
Errors in 'jar:file:/C:/work/externals/gwt/gwt-user.jar!/org/hibernate/validator/super/org/hibernate/validator/engine/PathImpl.java'
Line 72: No source code is available for type org.hibernate.validator.engine.NodeImpl; did you forget to inherit a required module?
从持久存储中加载了2315个单元。
找到2282个缓存单元。使用缓存中的2282/2282单元。
已将0个单位添加到永久缓存。
验证新编译的单元
“jar:file:/C:/work/externals/gwt/gwt-user.jar”中出现错误/org/hibernate/validator/engine/ConstraintViolationImpl_CustomFieldSerializer.java'
第33行:org.hibernate.validator.engine.ConstraintViolationImpl类型没有可用的源代码;您是否忘记继承所需的模块?
“jar:file:/C:/work/externals/gwt/gwt-user.jar”中出现错误/org/hibernate/validator/engine/ValidationSupport.java'
第43行:org.hibernate.validator.engine.ConstraintViolationImpl类型没有可用的源代码;您是否忘记继承所需的模块?
“jar:file:/C:/work/externals/gwt/gwt-user.jar”中出现错误/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/EmailValidator.java'
第25行:org.hibernate.validator.constraints.Email类型没有可用的源代码;您是否忘记继承所需的模块?
“jar:file:/C:/work/externals/gwt/gwt-user.jar”中出现错误/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/ScriptAssertValidator.java'
第26行:org.hibernate.validator.constraints.Email类型没有可用的源代码;您是否忘记继承所需的模块?
“jar:file:/C:/work/externals/gwt/gwt-user.jar”中出现错误/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/urlvidator.java'
第26行:org.hibernate.validator.constraints.URL类型没有可用的源代码;您是否忘记继承所需的模块?
“jar:file:/C:/work/externals/gwt/gwt-user.jar”中出现错误/org/hibernate/validator/super/org/hibernate/validator/engine/patimpl.java'
第72行:org.hibernate.validator.engine.NodeImpl类型没有可用的源代码;您是否忘记继承所需的模块?
为什么它找不到类?我的类路径中有hibernate-validator-4.1.0.Final sources.jar
有什么想法吗
如果你们想玩,我上传了我的项目。案件结案了,伙计们。错误是由于IntelliJ IDEA中的错误导致类路径中缺少hibernate验证源造成的。详情如下。案件结案了,伙计们。错误是由于IntelliJ IDEA中的错误导致类路径中缺少hibernate验证源造成的。详细信息如下。无限循环!您的链接将转到此页面:\无限循环!您的链接将转到此页面:\
Loaded 2315 units from persistent store.
Found 2282 cached units. Used 2282 / 2282 units from cache.
Added 0 units to persistent cache.
Validating newly compiled units
Errors in 'jar:file:/C:/work/externals/gwt/gwt-user.jar!/org/hibernate/validator/engine/ConstraintViolationImpl_CustomFieldSerializer.java'
Line 33: No source code is available for type org.hibernate.validator.engine.ConstraintViolationImpl<T>; did you forget to inherit a required module?
Errors in 'jar:file:/C:/work/externals/gwt/gwt-user.jar!/org/hibernate/validator/engine/ValidationSupport.java'
Line 43: No source code is available for type org.hibernate.validator.engine.ConstraintViolationImpl<T>; did you forget to inherit a required module?
Errors in 'jar:file:/C:/work/externals/gwt/gwt-user.jar!/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/EmailValidator.java'
Line 25: No source code is available for type org.hibernate.validator.constraints.Email; did you forget to inherit a required module?
Errors in 'jar:file:/C:/work/externals/gwt/gwt-user.jar!/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/ScriptAssertValidator.java'
Line 26: No source code is available for type org.hibernate.validator.constraints.Email; did you forget to inherit a required module?
Errors in 'jar:file:/C:/work/externals/gwt/gwt-user.jar!/org/hibernate/validator/super/org/hibernate/validator/constraints/impl/URLValidator.java'
Line 26: No source code is available for type org.hibernate.validator.constraints.URL; did you forget to inherit a required module?
Errors in 'jar:file:/C:/work/externals/gwt/gwt-user.jar!/org/hibernate/validator/super/org/hibernate/validator/engine/PathImpl.java'
Line 72: No source code is available for type org.hibernate.validator.engine.NodeImpl; did you forget to inherit a required module?