title: WebLogic: CDI deployment failure: org.hibernate.validator.internal.cdi.ValidationExtension?
body: <p>I am migrating a project from Jboss 6.1 to weblogic 12.2.1 .
  i am using jsf 2,ejb3 and hibernate </p>
  
  <p><strong>Project structre :</strong></p>
  
  <p>I have 2 WAR projects and 1 JAR project all includes in on EAR.</p>
  
  <p>While deploying the EAR i got below exception  :</p>
  
  <pre><code>weblogic.management.DeploymentException: CDI deployment failure:Error instantiating class org.hibernate.validator.internal.cdi.ValidationExtension
  </code></pre>
  
  <p>However hibernate3.jar and hibernate-validator-cdi-5.0.0.final-sources is already in the EAR  build path.</p>
  
  <p>The full stacktrace :</p>
  
  <pre><code>&lt;Jul 14, 2016, 12:52:35,196 PM EEST&gt; &lt;Error&gt; &lt;Deployer&gt; &lt;BEA-149265&gt; &lt;Failure occurred in the execution of deployment request with ID "1800397380822" for task "0" on [partition-name: DOMAIN]. Error is: "weblogic.management.DeploymentException: CDI deployment failure:Error instantiating class org.hibernate.validator.internal.cdi.ValidationExtension"
  weblogic.management.DeploymentException: CDI deployment failure:Error instantiating class org.hibernate.validator.internal.cdi.ValidationExtension
      at com.oracle.injection.integration.CDIAppDeploymentExtension.initCdi(CDIAppDeploymentExtension.java:95)
      at com.oracle.injection.integration.CDIAppDeploymentExtension.activate(CDIAppDeploymentExtension.java:43)
      at weblogic.application.internal.flow.AppDeploymentExtensionFlow.activate(AppDeploymentExtensionFlow.java:39)
      at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:754)
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
      Truncated. see log file for complete stacktrace
  Caused By: java.util.ServiceConfigurationError: javax.xml.stream.XMLInputFactory: Provider com.ctc.wstx.stax.WstxInputFactory not found
      at java.util.ServiceLoader.fail(ServiceLoader.java:239)
      at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
      at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:372)
      at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
      at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
      Truncated. see log file for complete stacktrace
  &gt; 
  &lt;Jul 14, 2016, 12:52:35,216 PM EEST&gt; &lt;Error&gt; &lt;Deployer&gt; &lt;BEA-149202&gt; &lt;Encountered an exception while attempting to commit the 9 task for the application "Contest_EAR" on [partition-name: DOMAIN].&gt; 
  &lt;Jul 14, 2016, 12:52:35,233 PM EEST&gt; &lt;Warning&gt; &lt;Deployer&gt; &lt;BEA-149004&gt; &lt;Failures were detected while initiating deploy task for application "Contest_EAR".&gt; 
  &lt;Jul 14, 2016, 12:52:35,233 PM EEST&gt; &lt;Warning&gt; &lt;Deployer&gt; &lt;BEA-149078&gt; &lt;Stack trace for message 149004
  weblogic.management.DeploymentException: CDI deployment failure:Error instantiating class org.hibernate.validator.internal.cdi.ValidationExtension
      at com.oracle.injection.integration.CDIAppDeploymentExtension.initCdi(CDIAppDeploymentExtension.java:95)
      at com.oracle.injection.integration.CDIAppDeploymentExtension.activate(CDIAppDeploymentExtension.java:43)
      at weblogic.application.internal.flow.AppDeploymentExtensionFlow.activate(AppDeploymentExtensionFlow.java:39)
      at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:754)
      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
      Truncated. see log file for complete stacktrace
  Caused By: java.util.ServiceConfigurationError: javax.xml.stream.XMLInputFactory: Provider com.ctc.wstx.stax.WstxInputFactory not found
      at java.util.ServiceLoader.fail(ServiceLoader.java:239)
      at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
      at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:372)
      at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
      at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
      Truncated. see log file for complete stacktrace
  </code></pre>
  
  <p>My weblogic.xml file :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;wls:weblogic-web-app
      xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.8/weblogic-web-app.xsd"&gt;
  
      &lt;wls:container-descriptor&gt;
  
          &lt;wls:prefer-application-packages&gt;
  //these lines resolved my jsf exception ..
              &lt;wls:package-name&gt;com.ctc.wstx.*&lt;/wls:package-name&gt;
              &lt;wls:package-name&gt;org.codehaus.stax2.*&lt;/wls:package-name&gt;
              &lt;wls:package-name&gt;com.sun.xml.messaging.saaj.*&lt;/wls:package-name&gt;
  
              &lt;wls:package-name&gt;com.google.common.*&lt;/wls:package-name&gt;
  
              &lt;wls:package-name&gt;org.bouncycastle.*&lt;/wls:package-name&gt;
  
          &lt;/wls:prefer-application-packages&gt;
      &lt;/wls:container-descriptor&gt;
  &lt;/wls:weblogic-web-app&gt;
  </code></pre>
  
  <p>Can anyone help me with this exception?! </p>