title: Can MyFaces + CDI be used on WebLogic 12c?
body: <p>I've been trying to get this setup running for a couple of days now but still no luck. Here's the test application i've been using:</p>
  
  <pre><code>@Named
  @RequestScoped
  public class Test {
  
      private String test = "test";
      public String getTest() { return test; }
      public void setTest(String test) { this.test = test; }
  }
  </code></pre>
  
  <p>And in the jsf page:</p>
  
  <pre><code>&lt;h:outputText value="#{test.test}"/&gt;
  </code></pre>
  
  <p>Running this sample without MyFaces works fine (renders "test" like it should), but when i deploy MyFaces in the WAR file and do the necessary configuration within weblogic.xml CDI seems to stop working (or at least, the integration bewteen JSF and CDI) and nothing is displayed in the output html. MyFaces itself seems to be ok, though.</p>
  
  <p>My basic configuration is as follows: </p>
  
  <ul>
  <li>WebLogic Server 12c (12.1.1.0), patches should be up-to-date as i just downloaded a development version yesterday just to be sure</li>
  <li>MyFaces-2.1.10, deployed within WEB-INF/libs</li>
  <li>Beans.xml is in place</li>
  <li>org.apache.myfaces.webapp.StartupServletContextListener has been registered in web.xml</li>
  <li>WebLogic is configured to use MyFaces using weblogic.xml</li>
  </ul>
  
  <p>Weblogic.xml contents:</p>
  
  <pre><code>&lt;prefer-application-packages&gt;
      &lt;package-name&gt;javax.faces.*&lt;/package-name&gt;
      &lt;package-name&gt;com.sun.faces.*&lt;/package-name&gt;
      &lt;package-name&gt;com.bea.faces.*&lt;/package-name&gt;
  &lt;/prefer-application-packages&gt;
  &lt;prefer-application-resources&gt;
      &lt;resource-name&gt;javax.faces.*&lt;/resource-name&gt;
      &lt;resource-name&gt;com.sun.faces.*&lt;/resource-name&gt;
      &lt;resource-name&gt;com.bea.faces.*&lt;/resource-name&gt;
      &lt;resource-name&gt;META-INF/services/javax.servlet.ServletContainerInitializer&lt;/resource-name&gt;
      &lt;resource-name&gt;META-INF/services/com.sun.faces.spi.FacesConfigResourceProvider&lt;/resource-name&gt;
  &lt;/prefer-application-resources&gt;
  </code></pre>
  
  <p>What i've learned so far:</p>
  
  <ul>
  <li>WL12c is equipped with Weld 1.1.3 as it's CDI implementation.</li>
  <li>I read somewhere (can't remember where) that whenever you decide to switch JSF implementation you're responsible for integrating JSF/CDI yourself. Is this true (sure hope not)?</li>
  </ul>
  
  <p>Things i've tried so far:</p>
  
  <ul>
  <li>Add MyFaces CODI into the mix, hoping it would somehow glue Weld and MyFaces together, but it didn't. </li>
  <li>Replace Weld by OpenWebBeans as the CDI implementation. This seemed to work at first but gave all kinds of interesting ClassCastExceptions later on in some internal sun.reflection package. This is a solution i'd rather avoid anyway.</li>
  <li>Manually trigger Weld using various options in web.xml and faces-config.xml. This seems to get Weld going in that it floods the log with all kinds of error messages. To some degree these can be "fixed" by upgrading weblogic to a newer Weld version but each time i do this i bump into the next error. Again, i'd rather avoid this route also.</li>
  </ul>
  
  <p>Is it really that hard to use MyFaces on WL12c while preserving CDI support or am i just missing the obvious ? Thanks for any help.</p>