4 Replies Latest reply: Jul 21, 2011 7:32 AM by 865028 RSS

    JSF 2.x in weblogic 10.3.0 is not working

    865028
      We have weblogic server 10.3.0 and I am planning to use the latest JSF implementation for a new project. So I created a sample application with index.xhtml and I dowloaded the JSF 2.0.6 and JSTL 1.2 jars and copied those under WEB-INF/lib in the war file. And I added the below line in weblogic.xml but got some exceptions when opening the page. Am I missing any other jars or steps?

      weblogic.xml
      <container-descriptor>
      <prefer-web-inf-classes>true</prefer-web-inf-classes>
      </container-descriptor>


      Exception:
      SEVERE: JSF1030: The specified InjectionProvider implementation 'com.bea.faces.W
      eblogicInjectionProvider' cannot be loaded.
      Jul 18, 2011 4:51:24 PM com.sun.faces.spi.InjectionProviderFactory createInstanc
      e
      INFO: JSF1048: PostConstruct/PreDestroy annotations present. ManagedBeans metho
      ds marked with these annotations will have said annotations processed.
      Jul 18, 2011 4:51:52 PM com.sun.faces.renderkit.RenderKitUtils renderHtmlErrorPa
      ge
      WARNING: jsf.facelets.error.page.response.committed
      Jul 18, 2011 4:51:52 PM com.sun.faces.renderkit.RenderKitUtils renderHtmlErrorPa
      ge
      SEVERE: javax.faces.FacesException: null source
      javax.faces.FacesException: null source
      at com.sun.faces.context.ExceptionHandlerImpl.handle(ExceptionHandlerImp
      l.java:140)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:119)
      at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.jav
      a:111)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run
      (StubSecurityHelper.java:227)
      at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri
      tyHelper.java:125)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
      a:292)
      at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
      va:42)
      at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsF
      ilter.java:27)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja


      I followed the steps in this URL http://download.oracle.com/docs/cd/E11035_01/wls100/webapp/configurejsfandjtsl.html and is working. Are we restricted to use JSF that comes only with weblogic or are there any work around to use JSF 2.x in weblogic 10.3.0?

      Appreciate your help.
        • 1. Re: JSF 2.x in weblogic 10.3.0 is not working
          Steve Button-Oracle
          Hi -- first off let me state that we only tested JSF 2.0 (and therefore support it) from WLS 10.3.2 onwards.

          But if you want to proceed here with WLS 10.3.0 then here's some information that may help.
          SEVERE: JSF1030: The specified InjectionProvider implementation 'com.bea.faces.WeblogicInjectionProvider' cannot be loaded.
          Jul 18, 2011 4:51:24 PM com.sun.faces.spi.InjectionProviderFactory createInstance
          INFO: JSF1048: PostConstruct/PreDestroy annotations present. ManagedBeans methods marked with these annotations will have said annotations processed.
          You are using dependency injection in Managed Beans.

          In order to support the use of DI in Managed Beans, the JSF specification requires that a vendor provides an implementation of the "com.sun.faces.spi.InjectionProvider" interface in order to fulfill the DI request.

          With WebLogic Server, we bundle the implementation of this interface within the shared-library we provide to support JSF 2.0. So it works automatically.

          I'd suggest either grabbing the jsf-2.0.war from a WLS 10.3.3 (or alter) distribution and seeing if that can be deployed and used on WLS 10.3.

          Or if you do not want to follow the documented approach with using shared-libraries, then crack open the jsf-1.2.war you'll see in your WLS 10.3 installation, and copy the wls.jsf.di.jar file into your WEB-INF/lib directory where you have the JSF libraries, and see if that works.

          I have some more details on all of this here: http://buttso.blogspot.com/2011/03/jsf-with-managed-beans-and-dependency.html

          Let us know how it goes.

          -steve-
          • 2. Re: JSF 2.x in weblogic 10.3.0 is not working
            865028
            Thanks for your reply.

            I tried two options:

            1. I downloaded JSF 2.0 war file from weblogic 10.3.4 and installed as a shared library
            2. I extracted wls.jsf.di.jar from JSF 2.0 war and copied into WEB-INF/lib along with other jsf 2.x jars (jsf-impl,jsf-api,jstl-impl-1.2,jstl-api-1.2)

            Both the above options didnt work for me. I had the below weblogic.xml when I was trying option1

            <?xml version="1.0" encoding="UTF-8"?>
            <weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90" xmlns:j2ee="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">
            <context-root>/Sample</context-root>
            <library-ref>
            <library-name>jsf2.0</library-name>
            <specification-version>2.0</specification-version>
            <implementation-version>1.0.0.0_2-0-2</implementation-version>

            </library-ref>

            </weblogic-web-app>
            • 3. Re: JSF 2.x in weblogic 10.3.0 is not working
              Steve Button-Oracle
              For option #1:

              If you are using the Oracle jsf-2.0.war shared-library, then the library-name element should be set to jsf not jsf2.0
              <?xml version="1.0" encoding="UTF-8"?>
              <weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90" xmlns:j2ee="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">
              <context-root>/Sample</context-root>
              <library-ref>
              <library-name>jsf</library-name>
              <specification-version>2.0</specification-version>
              <implementation-version>1.0.0.0_2-0-2</implementation-version>
              For option #2: was the error still the same or something different?

              -steve-

              Edited by: Steve Button on Jul 21, 2011 3:16 PM
              • 4. Re: JSF 2.x in weblogic 10.3.0 is not working
                865028
                Option #1
                I alreaday have JSF1.2 installed as a shared library in weblogic and the library name is jsf and I was not able to install JSF 2.0 war with the same name. So I modified manifest file to rename the library name.

                Option 2#
                Its the same error.