Bug 1127119 - Errai can't build with hibernate-validator 4.3.1.Final
Summary: Errai can't build with hibernate-validator 4.3.1.Final
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: Build and Assembly
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ---
: ---
Assignee: Edson Tirelli
QA Contact: Marek Baluch
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-06 08:20 UTC by Ryan Zhang
Modified: 2014-12-11 04:26 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-12-11 04:26:14 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
build.log (40.38 KB, text/x-log)
2014-08-13 09:34 UTC, Ryan Zhang
no flags Details
dependencymanagment.patch (740 bytes, patch)
2014-08-13 09:35 UTC, Ryan Zhang
no flags Details | Diff

Description Ryan Zhang 2014-08-06 08:20:02 UTC
Description of problem:
For IP products, (include BPMS 6.1), We need to align with EAP supported artifacts when building Errai.
In this case, EAP 6.3 use hibernate-validator 4.3.1.Final-redhat-1
However Errai build currently use 4.2.0.Final hibernate-validator and will fail if we  align to 4.3.1.Final-rdhat-1 or 4.3.1.Final.

So my request here is to update Errai 's dependency to 4.3.1.Final and make it compile pass with EAP's 6.3's hibernate-validate.



Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 3 Ryan Zhang 2014-08-06 08:27:09 UTC
The build error is:
INFO]             Generating Extensions Bootstrapper...
[INFO]       Rebinding org.jboss.errai.ioc.client.QualifierEqualityFactory
[INFO]          Invoking generator org.jboss.errai.ioc.rebind.ioc.bootstrapper.QualifierEqualityFactoryGenerator
[INFO]             Generating Extensions Bootstrapper...
[INFO]       Rebinding org.jboss.errai.ioc.client.QualifierEqualityFactory
[INFO]          Invoking generator org.jboss.errai.ioc.rebind.ioc.bootstrapper.QualifierEqualityFactoryGenerator
[INFO]             Generating Extensions Bootstrapper...
[INFO] Reflections took 10337 ms to scan 94 urls, producing 7503 keys and 34078 values 
[INFO] HV000001: Hibernate Validator 4.3.1.Final-redhat-1
[INFO]    [ERROR] An internal compiler exception occurred
[INFO] com.google.gwt.dev.jjs.InternalCompilerException: Unexpected error during visit.
[INFO] 	at com.google.gwt.dev.jjs.ast.JVisitor.translateException(JVisitor.java:109)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:276)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:265)
[INFO] 	at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:116)
[INFO] 	at com.google.gwt.dev.jjs.ast.JCastOperation.traverse(JCastOperation.java:65)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:361)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:273)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:265)
[INFO] 	at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:116)
[INFO] 	at com.google.gwt.dev.jjs.ast.JDeclarationStatement.traverse(JDeclarationStatement.java:48)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor$ListContextImmutable.traverse(JModVisitor.java:170)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.acceptWithInsertRemoveImmutable(JModVisitor.java:336)
[INFO] 	at com.google.gwt.dev.jjs.ast.JBlock.traverse(JBlock.java:83)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:361)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:273)
[INFO] 	at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:137)
[INFO] 	at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:133)
[INFO] 	at com.google.gwt.dev.jjs.ast.JMethodBody.traverse(JMethodBody.java:82)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:361)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:273)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:265)
[INFO] 	at com.google.gwt.dev.jjs.ast.JMethod.visitChildren(JMethod.java:434)
[INFO] 	at com.google.gwt.dev.jjs.ast.JMethod.traverse(JMethod.java:403)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:361)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:273)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:265)
[INFO] 	at com.google.gwt.dev.jjs.impl.UnifyAst.mainLoop(UnifyAst.java:900)
[INFO] 	at com.google.gwt.dev.jjs.impl.UnifyAst.exec(UnifyAst.java:625)
[INFO] 	at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:640)
[INFO] 	at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:33)
[INFO] 	at com.google.gwt.dev.Precompile.precompile(Precompile.java:278)
[INFO] 	at com.google.gwt.dev.Precompile.precompile(Precompile.java:229)
[INFO] 	at com.google.gwt.dev.Precompile.precompile(Precompile.java:141)
[INFO] 	at com.google.gwt.dev.Compiler.run(Compiler.java:232)
[INFO] 	at com.google.gwt.dev.Compiler.run(Compiler.java:198)
[INFO] 	at com.google.gwt.dev.Compiler$1.run(Compiler.java:170)
[INFO] 	at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:88)
[INFO] 	at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:82)
[INFO] 	at com.google.gwt.dev.Compiler.main(Compiler.java:177)
[INFO] Caused by: java.lang.NoClassDefFoundError: org/hibernate/validator/metadata/ConstraintDescriptorImpl
[INFO] 	at com.google.gwt.validation.rebind.GwtSpecificValidatorCreator.writeFields(GwtSpecificValidatorCreator.java:1077)
[INFO] 	at com.google.gwt.validation.rebind.GwtSpecificValidatorCreator.writeClassBody(GwtSpecificValidatorCreator.java:375)
[INFO] 	at com.google.gwt.validation.rebind.AbstractCreator.create(AbstractCreator.java:55)
[INFO] 	at com.google.gwt.validation.rebind.ValidatorGenerator.generateGwtSpecificValidator(ValidatorGenerator.java:142)
[INFO] 	at com.google.gwt.validation.rebind.ValidatorGenerator.generate(ValidatorGenerator.java:67)
[INFO] 	at com.google.gwt.core.ext.IncrementalGenerator.generateNonIncrementally(IncrementalGenerator.java:40)
[INFO] 	at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:657)
[INFO] 	at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41)
[INFO] 	at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:79)
[INFO] 	at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:276)
[INFO] 	at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:265)
[INFO] 	at com.google.gwt.dev.DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(DistillerRebindPermutationOracle.java:91)
[INFO] 	at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.handleGwtCreate(UnifyAst.java:355)
[INFO] 	at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.handleMagicMethodCall(UnifyAst.java:433)
[INFO] 	at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.endVisit(UnifyAst.java:237)
[INFO] 	at com.google.gwt.dev.jjs.ast.JMethodCall.traverse(JMethodCall.java:243)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:361)
[INFO] 	at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:273)
[INFO] 	... 37 more
[INFO] Caused by: java.lang.ClassNotFoundException: org.hibernate.validator.metadata.ConstraintDescriptorImpl
[INFO] 	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
[INFO] 	at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
[INFO] 	at java.security.AccessController.doPrivileged(Native Method)
[INFO] 	at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
[INFO] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
[INFO] 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
[INFO] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
[INFO] 	... 55 more
[INFO]       [ERROR] at _UserValidator.java(6): GWT.create(_UserValidator.class)
[INFO]          com.google.gwt.dev.jjs.ast.JMethodCall
[INFO]       [ERROR] at _UserValidator.java(6): (_UserValidator) GWT.create(_UserValidator.class)
[INFO]          com.google.gwt.dev.jjs.ast.JCastOperation
[INFO]       [ERROR] at _UserValidator.java(6): final static _UserValidator INSTANCE = (_UserValidator) GWT.create(_UserValidator.class)
[INFO]          com.google.gwt.dev.jjs.ast.JDeclarationStatement
[INFO]       [ERROR] at _UserValidator.java(5): {
[INFO]   final static _UserValidator INSTANCE = (_UserValidator) GWT.create(_UserValidator.class);
[INFO] }
[INFO]          com.google.gwt.dev.jjs.ast.JBlock
[INFO]       [ERROR] at _UserValidator.java(5): {
[INFO]   final static _UserValidator INSTANCE = (_UserValidator) GWT.create(_UserValidator.class);
[INFO] }
[INFO]          com.google.gwt.dev.jjs.ast.JMethodBody
[INFO]       [ERROR] at _UserValidator.java(5): private static final void $clinit();
[INFO] 
[INFO]          com.google.gwt.dev.jjs.ast.JMethod
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 38.143s
[INFO] Finished at: Wed Aug 06 15:11:24 CST 2014
[INFO] Final Memory: 43M/344M
[INFO] ------------------------------------------------------------------------

Comment 4 Mark Proctor 2014-08-06 13:30:19 UTC
The validator dependency is for GWT, not for Errai. So this cannot be fixed within Errai itself.

Production could try rebuilding GWT with changed dependencies, and see if it still works... which is risky.

Comment 5 Mark Proctor 2014-08-06 13:44:49 UTC
What we can do is see if we can avoid GWT using Bean Validator. We'll also be updating to Errai 3.x in a few weeks which uses GWT 2.6, and eventually GWT 2.7 - so this might get resolved that way as well.

Comment 6 Christian Sadilek 2014-08-06 15:14:32 UTC
As Mark pointed out, this is in fact GWT's built-in validator generator failing, not Errai's.

However, I just upgraded an Errai 2.4.4.Final application (using GWT 2.5.1) to Hibernate Validator 4.3.1.Final and it worked fine for me.

I simply added this to the dependency management section of the example pom:

<dependencyManagement>
  <dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-validator</artifactId>
    <version>4.3.1.Final</version>
    <scope>provided</scope>
  </dependency>

  <dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-validator</artifactId>
    <version>4.3.1.Final</version>
    <scope>provided</scope>
    <classifier>sources</classifier>
   </dependency>
</dependencyManagement>

I assume there's either some kind of version conflict on the classpath or a problem with the specific bean (named User) for which the validator is generated.

Let me know if there's a way I can help you investigate further.

Comment 7 Ryan Zhang 2014-08-13 09:32:16 UTC
Ok, Thanks Christian and Mark. 
This issue is explored from errai-demos/errai-jpa-demo-todo-list. 
I have applied your dependency management section into errai-demos/errai-jpa-demo-todo-list. And the error is the same.
I have attached the patch and build log.
I think there are also similar cases for droolsjbpm component using errai+hibernate-validator 4.3.1.Final. But I am not sure if the error will occur there too.

(In reply to Christian Sadilek from comment #6)
> As Mark pointed out, this is in fact GWT's built-in validator generator
> failing, not Errai's.
> 
> However, I just upgraded an Errai 2.4.4.Final application (using GWT 2.5.1)
> to Hibernate Validator 4.3.1.Final and it worked fine for me.
> 
> I simply added this to the dependency management section of the example pom:
> 
> <dependencyManagement>
>   <dependency>
>     <groupId>org.hibernate</groupId>
>     <artifactId>hibernate-validator</artifactId>
>     <version>4.3.1.Final</version>
>     <scope>provided</scope>
>   </dependency>
> 
>   <dependency>
>     <groupId>org.hibernate</groupId>
>     <artifactId>hibernate-validator</artifactId>
>     <version>4.3.1.Final</version>
>     <scope>provided</scope>
>     <classifier>sources</classifier>
>    </dependency>
> </dependencyManagement>
> 
> I assume there's either some kind of version conflict on the classpath or a
> problem with the specific bean (named User) for which the validator is
> generated.
> 
> Let me know if there's a way I can help you investigate further.

Comment 8 Ryan Zhang 2014-08-13 09:34:16 UTC
Created attachment 926333 [details]
build.log

Comment 9 Ryan Zhang 2014-08-13 09:35:17 UTC
Created attachment 926334 [details]
dependencymanagment.patch

Comment 10 Christian Sadilek 2014-08-13 16:47:08 UTC
Thank you, Ryan. I have confirmed this now. 

GWT's built-in bean validation support does not work with hibernate-validator 4.3.1. The reason is that its validator generator references org.hibernate.validator.metadata.ConstraintDecriptorImpl which was moved to a different package in 4.3 (org.hibernate.validator.internal.metadata.descriptor).

To make this work we need a fix in GWT. I can report this problem, but it will likely take a while until the next GWT release is stable. So, I think for now the only solution is to use Hibernate Validator 4.2.0 in combination with GWT. This shouldn't be an issue though as it is only a compile-time dependency that is used to generate code that compiles to JavaScript. You don't need to depend on 4.2.0 at run-time.

Comment 11 Ryan Zhang 2014-08-14 02:29:11 UTC
OK, Thanks for your explaination, Christian.

Please update the next GWT when it is stable. This will cause some problem with the productization tools which will  overrride the hibernate-validator automatically since it is shipped in EAP.
But I see that it will not be a problem for Errai project if I use 4.2.0.
I will provide workaround for errai product build.


Note You need to log in before you can comment on or make changes to this bug.