Uploaded image for project: 'IronJacamar'
  1. IronJacamar
  2. JBJCA-1388

Validator is created using rar ClassLoader as the TCCL

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • None
    • Core
    • None

      org.jboss.jca.core.rar.EndpointImpl.activate is setting the TCCL to be that of the resource adapter's ClassLoader, which would be the rar's custom module if the rar is deployed as a JBoss module, however inside this same block it is creating the Bean Validator, so it goes looking for the provider in the rar's module instead of the JBoss IJ module.

      This would lead to the following exception if the rar is deployed as a module:

      ERROR [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0215: Failed to resume activity org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent$1@3f9a21a1. To resume normal operation it is recommended that you restart the server.: java.lang.RuntimeException: javax.resource.ResourceException: IJ000852: Validation exception
      	at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent.activate(MessageDrivenComponent.java:273)
      	at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent.access$300(MessageDrivenComponent.java:63)
      	at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent$1.resume(MessageDrivenComponent.java:109)
      	at org.jboss.as.server.suspend.SuspendController.resume(SuspendController.java:126)
      	at org.jboss.as.server.ServerService.finishBoot(ServerService.java:430)
      	at org.jboss.as.server.ServerService.boot(ServerService.java:398)
      	at org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:370)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: javax.resource.ResourceException: IJ000852: Validation exception
      	at org.jboss.jca.core.rar.EndpointImpl.activate(EndpointImpl.java:177)
      	at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent.activate(MessageDrivenComponent.java:271)
      	... 7 more
      Caused by: javax.validation.ValidationException: Unable to create a Configuration, because no Bean Validation provider could be found. Add a provider like Hibernate Validator (RI) to your classpath.
      	at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:271)
      	at org.jboss.jca.core.bv.BeanValidationUtil.createValidatorFactory(BeanValidationUtil.java:51)
      	at org.jboss.jca.core.bv.BeanValidationUtil.createValidator(BeanValidationUtil.java:63)
      	at org.jboss.jca.core.rar.EndpointImpl.activate(EndpointImpl.java:165)
      	... 8 more
      

      A workaround is add the implementation specific module to the customer's rar module:

      <module name="org.hibernate.validator" services="export"/>
      

      But dependency on org.hibernate.validator of a rar module should be internal by the IJ implementation, so that dependency should not be necessary.

      More information can be found at: https://issues.jboss.org/browse/JBEAP-16702?focusedCommentId=13720721&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13720721

            rhn-engineering-lgao Lin Gao
            rhn-engineering-lgao Lin Gao
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: