jbossjhipsterjboss-eap-6

How Run Jhipster 5.4.0 war on JBOSS EAP 6.4


We are trying to deploy an jhipster app on JBOSS EAP 6.4, I have fiew problem with JPA 2.1 and VALIDATION 2, The problem is the JBOSS is JAVA EE 6, but jhipster use a fiew JAVA EE 7 feature. we have added the jboss-deployment-structure.xml file for try to esclude some modules.

Now i solve the JPA 2.1 issue and the validation but stil to have a problem.

this is the jboss-deployment-structure.xml

  <?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
    <deployment>

        <exclude-subsystems>
            <subsystem name="jpa" />


                <subsystem name="jaxrs"/>


        </exclude-subsystems>
        <exclusions>
            <!-- WFCORE-209 workaround -->
            <module name="javaee.api" />

            <module name="javax.persistence.api" />
            <module name="org.hibernate" />
            <module name="org.apache.log4j" />
            <module name="org.slf4j"/>
            <module name="org.apache.commons.logging"/>

            <module name="com.fasterxml.jackson.core.databind"/>
            <module name="com.fasterxml.jackson.module.afterburner"></module>

            <module name="com.fasterxml.jackson.databind.Module" />
            <module name="com.fasterxml.jackson.core.jackson-core" />
            <module name="com.fasterxml.jackson.core.jackson-annotations" />
            <module name="com.fasterxml.jackson.core.jackson-databind" />
            <module name="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider" />
            <module name="org.jboss.resteasy.resteasy-jackson2-provider" />
            <module name="org.jboss.resteasy.resteasy-jackson-provider" />
            <module name="com.fasterxml.jackson.datatype.jackson-datatype-jdk8" />
            <module name="com.fasterxml.jackson.datatype.jackson-datatype-jsr310" />


            <module name="javax.persistence.api" />
            <module name="org.hibernate" />
            <module name="org.hibernate.javax.persistence" />
            <module name="org.hibernate.validator" />
            <module name="javax.validation.api" />
            <module name="javax.el"/>
            <module name="javax.faces.api"/>
            <module name="org.hibernate.validator"/>

        </exclusions>


        <dependencies>
            <!-- WFCORE-209 workaround -->

          <!--  <module name="javax.validation.api" export="true"/>
          -->
            <!-- This one always goes last. -->
           <!-- <module name="javax.api" >
            <imports>
                <exclude-set>
                    <path name="javax/ws/rs"/>
                    <path name="javax/ws/rs/core"/>
                    <path name="javax/ws/rs/ext"/>
                    <path name="javax/validation"/>
                    <path name="javax/validation/bootstrap"/>
                    <path name="javax/validation/constraints"/>
                    <path name="javax/validation/groups"/>
                    <path name="javax/validation/metadata"/>
                    <path name="javax/validation/spi"/>
                </exclude-set>

            </imports>
            </module>-->
        </dependencies>

    </deployment>
</jboss-deployment-structure>

and this is the last error

Caused by: java.lang.IllegalAccessError: javax/el/ELUtil at javax.el.ELManager.getExpressionFactory(ELManager.java:61) [javax.el-3.0.0.jar:3.0.0] at org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator.buildExpressionFactory(ResourceBundleMessageInterpolator.java:88) [hibernate-validator-6.0.12.Final.jar:6.0.12.Final] at org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator.(ResourceBundleMessageInterpolator.java:47) [hibernate-validator-6.0.12.Final.jar:6.0.12.Final] at org.hibernate.validator.internal.engine.ConfigurationImpl.getDefaultMessageInterpolator(ConfigurationImpl.java:474) [hibernate-validator-6.0.12.Final.jar:6.0.12.Final] at org.hibernate.validator.internal.engine.ConfigurationImpl.getDefaultMessageInterpolatorConfiguredWithClassLoader(ConfigurationImpl.java:650) [hibernate-validator-6.0.12.Final.jar:6.0.12.Final] at org.hibernate.validator.internal.engine.ConfigurationImpl.getMessageInterpolator(ConfigurationImpl.java:397) [hibernate-validator-6.0.12.Final.jar:6.0.12.Final] at org.hibernate.validator.internal.engine.ValidatorFactoryImpl.(ValidatorFactoryImpl.java:183) [hibernate-validator-6.0.12.Final.jar:6.0.12.Final] at org.hibernate.validator.HibernateValidator.buildValidatorFactory(HibernateValidator.java:38) [hibernate-validator-6.0.12.Final.jar:6.0.12.Final] at org.hibernate.validator.internal.engine.ConfigurationImpl.buildValidatorFactory(ConfigurationImpl.java:364) [hibernate-validator-6.0.12.Final.jar:6.0.12.Final] at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:103) [validation-api-2.0.1.Final.jar:] at org.hibernate.cfg.beanvalidation.TypeSafeActivator.getValidatorFactory(TypeSafeActivator.java:501) [hibernate-core-5.2.17.Final.jar:5.2.17.Final] at org.hibernate.cfg.beanvalidation.TypeSafeActivator.activate(TypeSafeActivator.java:84) [hibernate-core-5.2.17.Final.jar:5.2.17.Final] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_31] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_31] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_31] at java.lang.reflect.Method.invoke(Method.java:483) [rt.jar:1.8.0_31] at org.hibernate.cfg.beanvalidation.BeanValidationIntegrator.integrate(BeanValidationIntegrator.java:132) [hibernate-core-5.2.17.Final.jar:5.2.17.Final]


Solution

  • Try to change hibernate validator from version 6 to version 5.

    1) exclude hibernate validator from spring-boot-starter-web:

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        <exclusions>
            <exclusion>
                <groupId>org.hibernate.validator</groupId>
                <artifactId>hibernate-validator</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    

    2) add hibernate validator version 5:

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator</artifactId>
        <version>5.4.2.Final</version>
    </dependency>
    

    My apps with jhipster 5.6.1 work with this method. I read compatibility from spring-boot doc, regarding LocalValidatorFactoryBean. I'm using eap 6.4.8