Reputation: 141
I'm attempting to deploy the packager-01 EAR from https://github.com/dewthefifth/java-examples/tree/master/multi-ear-jms on Wildfly 8.2.1, and am receiving the following error because Wildfly is insisting on loading the hibernate-validator module out of $JBOSS_HOME/modules/org/hibernate/validator/main instead of the one located inside of my EAR.
Caused by: java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor': Invocation of init method failed; nested exception is java.lang.AbstractMethodError: org.hibernate.validator.engine.ConfigurationImpl.getDefaultParameterNameProvider()Ljavax/validation/ParameterNameProvider;
at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:223)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:87)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:72)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
... 3 more
Note: this is a custom deployed module required by a different application deployed on the same app server. Prior to deploying the other application, which includes multiple custom hibernate modules, I was able to get the EAR to deploy.
I've attempted to exclude the validator module using the following jboss-deployment-structure (assembled out of basically adding every exclusion any google result even hinted at), but have had no luck. No matter what I do the validator being loaded is Hibernate Validator 4.2.0.Final
while the validator I'm providing in my EAR is hibernate-validator-6.0.7.Final.jar
.
<jboss-deployment-structure>
<!-- Make sub deployments isolated by default, so they cannot see each others classes without a Class-Path entry -->
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
<!-- This corresponds to the top level deployment. For a war this is the war's module, for an ear -->
<!-- This is the top level ear module, which contains all the classes in the EAR's lib folder -->
<deployment>
<exclude-subsystems>
<subsystem name="jaxrs" />
<subsystem name="resteasy" />
</exclude-subsystems>
<exclusions>
<!-- Exclude Jackson - I included my own -->
<module name="com.fasterxml.jackson.core.jackson-annotations" />
<module name="com.fasterxml.jackson.core.jackson-core" />
<module name="com.fasterxml.jackson.core.jackson-databind" />
<module name="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider" />
<module name="org.jboss.resteasy.resteasy-jackson-provider" />
<module name="org.jboss.resteasy.resteasy-jackson2-provider" />
<module name="org.apache.xalan" />
<module name="org.apache.xerces" />
<module name="org.jboss.logging" />
<!-- Exclude Hibernate -->
<module name="org.hibernate" />
<!-- Exclude hibernate validation -->
<module name="org.jboss.resteasy.resteasy-validator-provider-11" />
<module name="org.hibernate.validator" />
<module name="javax.validation.api" />
<module name="javaee.api" />
<module name="javax.faces.api" />
</exclusions>
<!-- This allows you to define additional dependencies, it is the same as using the Dependencies: manifest attribute -->
<dependencies>
</dependencies>
</deployment>
If anybody knows which subsystem I need to exclude I'd greatly appreciate the help.
Note: I'm sharing my Wildfly 8.2.1, and even using my Wildfly 8.2.1 because those are constraints placed on me by my customer deployment site.
Update 1: Thanks for the help so far.
I've reached the point that my new excludes list includes the following false
<module name="org.jboss.resteasy.resteasy-jackson-provider" />
<module name="org.jboss.resteasy.resteasy-jackson2-provider" />
<module name="org.apache.xalan" />
<module name="org.apache.xerces" />
<module name="org.jboss.logging" />
<!-- Exclude Hibernate -->
<module name="org.hibernate" />
<module name="javax.persistence.api" />
<!-- Exclude hibernate validation -->
<module name="org.hibernate.validator" />
<module name="org.jboss.invocation" />
<module name="org.jboss.as.connector" />
<module name="org.jboss.as.ee" />
<module name="org.jboss.as.jpa" />
<module name="org.jboss.as.jpa.hibernate" />
<module name="javax.resource.api" />
<module name="org.jboss.as.ejb-client" />
<module name="org.jboss.as.weld" />
<module name="org.jboss.ironjacamar.impl" />
<module name="org.jboss.ironjacamar.jdbcadapters" />
<module name="org.jboss.resteasy.resteasy-jaxrs" />
<module name="org.jboss.resteasy.resteasy-validator-provider-11" />
<module name="javaee.api" />
<module name="javax.el.api" />
<module name="javax.enterprise.api" />
<module name="javax.faces.api" />
<module name="javax.persistence.api" />
<module name="javax.servlet.jsp.api" />
<module name="javax.validation.api" />
</exclusions>
<!-- This allows you to define additional dependencies, it is the same as using the Dependencies: manifest attribute -->
<dependencies>
</dependencies>
</deployment>
which I determined by turning TRACE level logging on for all JBOSS and basically adding exclusions the the first listed entry until I stopped seeing Hibernate 4.0.2 was being loaded. I haven't yet been able to run down exactly which of these were the real culperite, but we're getting somewhere.
I will add that the WAR no longer deploys, now because it's missing core jee libraries... (as you might expect). I'll update as I find time, hopefuly eventually producing the genuine (minimal) set of exclusions required for it to work.
Upvotes: 1
Views: 3034
Reputation: 141
I ended up having some success with this on a different project/module which is available at https://github.com/dewthefifth/spring-boot-ear-skinny-war/tree/spring-boot-2.0-with-spring-legacy-with-wfcore-209-workaround.
Specifically the web0 project had luck removing the validator, but any attempt to remove it from the EAR fails.
The github link is focused on making the removal so that Spring 5+ can be used on JBOSS and Wildfly. It includes a README with detailed information on exactly which versions of Wildfly and JBOSS were tested, and a workaround for the versions of JBOSS that didn't work (it's not pretty).
Upvotes: 0
Reputation: 4932
I think you need to exclude it from all dependencies also. I'm working on 6.4EAP so it could change slightly for your version of jboss, but try it. So go to your modules jboss subdirectory and grep for org.hibernate.validator
(grep -ir "org.hibernate.validator" .
) if you are on linux.
That will show you result like:
./system/layers/base/org/hibernate/validator/main/module.xml:<module xmlns="urn:jboss:module:1.1" name="org.hibernate.validator">
./system/layers/base/org/jboss/as/jpa/hibernate/3/module.xml: <module name="org.hibernate.validator"/>
./system/layers/base/org/jboss/as/jpa/hibernate/4/module.xml: <module name="org.hibernate.validator"/>
./system/layers/base/org/jboss/as/jpa/main/module.xml: <module name="org.hibernate.validator"/>
./system/layers/base/org/jboss/as/ee/main/module.xml: <module name="org.hibernate.validator" optional="true"/>
./system/layers/base/org/jboss/as/connector/main/module.xml: <module name="org.hibernate.validator"/>
./system/layers/base/org/jboss/resteasy/resteasy-hibernatevalidator-provider/main/module.xml: <module name="org.hibernate.validator"/>
./system/layers/base/org/jboss/ironjacamar/impl/main/module.xml: <module name="org.hibernate.validator"/>
./system/layers/base/org/jboss/ironjacamar/jdbcadapters/main/module.xml: <module name="org.hibernate.validator"/>
Then you could know which modules you need and from which you need to exclude it. Here I'm posting my configuration...maybe it will help you
<deployment>
<exclusions>
<module name="org.apache.log4j"/>
<module name="org.apache.commons.logging"/>
<module name="org.slf4j"/>
<module name="org.jboss.logging"/>
<module name="org.hibernate"/>
<module name="org.hibernate.validator"/>
<module name="javaee.api"/>
<module name="javax.el.api"/>
<module name="javax.enterprise.api"/>
<module name="javax.faces.api"/>
<module name="javax.persistence.api"/>
<module name="javax.servlet.jsp.api"/>
<module name="javax.validation.api"/>
</exclusions>
<dependencies>
<module name="javax.annotation.api" export="true"/>
<module name="javax.ejb.api" export="true"/>
<module name="javax.interceptor.api" export="true"/>
<module name="org.jboss.modules" export="true"/>
<module name="javax.servlet.jsp.api" export="true">
<imports>
<include path="/**"/>
<exclude-set>
<path name="javax/el"/>
</exclude-set>
</imports>
</module>
<module name="javax.enterprise.api" export="true">
<imports>
<include path="/**"/>
<exclude-set>
<path name="javax/el"/>
</exclude-set>
</imports>
</module>
</dependencies>
</deployment>
<sub-deployment name="admin.war">
<exclusions>
<module name="javaee.api"/>
<module name="javax.el.api"/>
<module name="javax.enterprise.api"/>
<module name="javax.faces.api"/>
<module name="javax.persistence.api"/>
<module name="javax.servlet.jsp.api"/>
<module name="javax.validation.api"/>
<module name="org.apache.commons.logging"/>
<module name="org.apache.log4j"/>
<module name="org.jboss.logging"/>
<module name="org.hibernate"/>
<module name="org.hibernate.validator"/>
<module name="org.slf4j"/>
</exclusions>
<local-last value="true"/>
</sub-deployment>
for me worked when I removed javax/el
Upvotes: 1