5 Replies Latest reply: Jan 12, 2012 5:01 PM by 910786 RSS

    WebLogic 10.3.4.0 and JSF 2.0 via Eclipse 3.6 Helios EE - EAR export issue

    612864
      Hi,
      Update: I think it may the fact that Eclipse adds jars and config to WebLogic when you select "enable JSF facet" - I will add JSF to a fake project on my other machine and/or import the Eclipse projects - and advise.

      I am using the 20110115 version of WebLogic 10.3.4.0.
      I have enabled the JSF facet for WebLogic 10.3.4.0 via the OEPE plugin added in the "add new servers" tab in Eclipse 3.6 Helios EE. The default library supplied by WebLogic 10.3.4.0 looks to be working fine when deploying from within Eclipse and also when dropping in an exported EAR to the "autodeploy" directory on my domain.
      The following URL renders ok on the WebLogic instance connected to my Eclipse IDE
      http://127.0.0.1:7001/collatz/faces/index.xhtml

      Note: JSF 2.0 (including the new .xhtml faclet support) is working fine on WebLogic 10.3.4.0

      My issue is when I try to export that same EAR to a separate identical WebLogic 10.3.4.0 install on another box I fail to deploy the WAR because the weblogic.xml server specific library reference is not getting recognized.


      I see
      Caused By: weblogic.management.DeploymentException: Error: Unresolved Webapp Library references for "ServletContext@64889218[app:_appsdir_org.eclipse.persistence.example.distributed.CollatzEAR_ear module:collatz path:/collatz spec-version:2.5]", defined in weblogic.xml [Extension-Name: jsf, Specification-Version: 2, exact-match: true]
           at weblogic.servlet.internal.WebAppServletContext.processWebAppLibraries(WebAppServletContext.java:2754)
      My weblogic.xml is
      <?xml version="1.0" encoding="UTF-8"?>
      <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_2_5.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.2/weblogic-web-app.xsd">
          <wls:weblogic-version>10.3.4</wls:weblogic-version>
          <wls:context-root>collatz</wls:context-root>
          <wls:library-ref>
              <wls:library-name>jsf</wls:library-name>
              <wls:specification-version>2.0</wls:specification-version>
              <wls:exact-match>true</wls:exact-match>
          </wls:library-ref>
      </wls:weblogic-web-app>
      My web.xml is still JEE5 compliant
      <?xml version="1.0" encoding="UTF-8"?>
      <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
        <display-name>org.eclipse.persistence.example.distributed.CollatzWeb</display-name>
        <welcome-file-list>
          <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
        <servlet>
          <servlet-name>Faces Servlet</servlet-name>
          <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
          <load-on-startup>1</load-on-startup>
        </servlet>
        <servlet-mapping>
          <servlet-name>Faces Servlet</servlet-name>
          <url-pattern>/faces/*</url-pattern>
        </servlet-mapping>
      </web-app>
      I suspect it may be the references to the GlassFish JSF library jars - that would not exist on my other server without an import.
      However glassfish.jsf_1.0.0.0_2-0-4.jar is likely on both servers - I will look after 1400EDT today
      // war classpath
      <?xml version="1.0" encoding="UTF-8"?>
      <classpath>
           <classpathentry kind="src" path="src"/>
           <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/Oracle WebLogic Server 11gR1 PatchSet 3 r20110115 JRE">
                <attributes>
                     <attribute name="owner.project.facets" value="java"/>
                </attributes>
           </classpathentry>
           <classpathentry kind="con" path="oracle.eclipse.tools.weblogic.lib.system">
                <attributes>
                     <attribute name="owner.project.facets" value="jst.web"/>
                </attributes>
           </classpathentry>
           <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
           <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
           <classpathentry kind="con" path="oracle.eclipse.tools.weblogic.lib.application/org.eclipse.persistence.example.distributed.CollatzEAR"/>
           <classpathentry combineaccessrules="false" kind="src" path="/javax.persistence 2.0.0"/>
           <classpathentry kind="con" path="oracle.eclipse.tools.weblogic.lib.shared/jsf/exact/2.0"/>
           <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.example.distributed.CollatzEJB"/>
           <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.persistence.example.distributed.CollatzModel"/>
           <classpathentry kind="output" path="build/classes"/>
      </classpath>
      
      and the facet reference
      #Tue Feb 15 17:01:40 VET 2011
      //_hiddenCategory_\:http\://java.sun.com/jsf/composite=false
      //_hiddenCategory_\:http\://java.sun.com/jsf/core=false
      //_hiddenCategory_\:http\://java.sun.com/jsf/facelets=false
      //_hiddenCategory_\:http\://java.sun.com/jsf/html=false
      //_hiddenCategory_\:http\://java.sun.com/jsp/jstl/core=false
      //_hiddenCategory_\:http\://mojarra.dev.java.net/mojarra_ext=false
      _hiddenCategory_\:DataPalette=false
      _hiddenCategory_\:HTML=false
      eclipse.preferences.version=1
      Here is my faces-config.xml - but I don't think it is part of the issue
      <?xml version="1.0" encoding="UTF-8"?>
      <faces-config
          xmlns="http://java.sun.com/xml/ns/javaee"
          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-facesconfig_2_0.xsd"
          version="2.0">
           <application>
                <message-bundle>resources.application</message-bundle>
                <locale-config>
                     <default-locale>en</default-locale>
                </locale-config>
           </application>
           <!-- manage the managed-bean via annotations -->
           <!-- managed-bean>
                <managed-bean-name>collatzManager</managed-bean-name>
                <managed-bean-class>org.eclipse.persistence.example.distributed.collatz.presentation.CollatzManager</managed-bean-class>
                <managed-bean-scope>session</managed-bean-scope>
           </managed-bean-->
      </faces-config>
      These files are Eclipse IDE generated via the OEPE.
      Tried changing the JSF version to 1.2 - this deployed ok but JSF urls and the new JSF 2.0 .xhtml facelet is not recognized - as expected
      Tried changing to Servlet 3.0 (failed on both - as expected because we still support only 2.5)
      Tried commented the library-ref (failed on both as expected - as JSF classes are not classloaded)

      I'll examine the eclipse specific facet references more, check MANIFEST jar references and update this post if I get further.
      So essentially my issue is that my Eclipse + WebLogic generated EARs are not currently portable to other WLS servers

      thank you
      Michael O'Brien (Oracle)
      http://www.eclipselink.org

      Edited by: michael_obrien on Feb 16, 2011 11:56 AM - try eclipse instrumentation of 2nd WebLogic by importing or loading a fake JSF project and enabling JSF
        • 1. Re: WebLogic 10.3.4.0 and JSF 2.0 via Eclipse 3.6 Helios EE - EAR export issue
          612864
          Update:
          This issue where a JSF 2.0 EAR created for an Eclipse 3.6 managed WebLogic 10.3.4.0 is solved by enabling the same JSF 2.0 library from Eclipse against the other remote WebLogic 10.3.4.0 where the EAR is exported to.
          You should see the following logs on the 2nd WebLogic server console after the specific JSF 2.0 library has been enabled.
          Feb 18, 2011 9:16:11 AM com.sun.faces.config.ConfigureListener contextInitialized
          INFO: Initializing Mojarra 2.0.4 (FCS b05) for context '/collatz'
          Notice that the version is 2.0.4 which is different that the default 1.2 version that the JSF based console uses (from a 3rd server where I have not enabled JSF 2 yet).
          Feb 18, 2011 9:22:19 AM com.sun.faces.config.ConfigureListener contextInitialized
          INFO: Initializing Sun's JavaServer Faces implementation (1.2_03-b04-FCS) for context '/console'
          Feb 18, 2011 9:22:19 AM com.sun.faces.config.ConfigureListener contextInitialized
          INFO: Completed initializing Sun's JavaServer Faces implementation (1.2_03-b04-FCS) for context '/console'
          /Michael
          • 2. Re: WebLogic 10.3.4.0 and JSF 2.0 via Eclipse 3.6 Helios EE - EAR export issue
            Steve Button-Oracle
            gday Michael -- looks like you have it sorted from your last posting based on your development environment and methodology within OEPE. From a WebLogic Server perspective, what the error message is telling you is that the shared-library you are referencing in Collatz isn't present on the server -- the default environment in a WLS domain is that the JSF shared-libraries are not deploye OOB and need to be manually deployed as a library before applications can use them. OEPE (and NetBeans, and I assume JDeveloper although I think they bundle the jars, including wls.di.jsf.jar inside the war file by default) are quite clever when working with WebLogic Server in that if you decide to use JSF (as a facet in OEPE or as framework in NetBeans) they will automate (if necessary) this shared-library deployment under the covers so the application can then be deployed and the shared-library reference satisfied.

            When you export the app as an EAR file and then manually deploy it to another WLS domain, the required JSF library may not be present since OEPE/NetBeans haven't done their under-covers deployment operation. So you can simply deploy the shared-library yourself via either the WLS console or the weblogic.Deployer utility. The shared-libraries reside in the $MW_HOME/wlserver_10.3/server/common/deployable-libraries and should be accsssible from the AdminServer.

            cheers
            -steve-
            • 3. Re: WebLogic 10.3.4.0 and JSF 2.0 via Eclipse 3.6 Helios EE - EAR export issue
              keuller
              Hi, I have the same error described above. But JSF 2 and JSTL libraries were deployed correctly on the server.

              My environment has a cluster with 3 nodes and the libraries has been deployed on the cluster.

              any idea how to solve it ?
              • 4. Re: WebLogic 10.3.4.0 and JSF 2.0 via Eclipse 3.6 Helios EE - EAR export issue
                910786
                Steve,

                I am using JSF2.0 and getting javax.el.ExpressionFactory NoClassDefFound issues.

                OEPE Helios
                Weblogic 10.3.3

                I have an EAR containing one WAR.

                WEB-INF/lib
                el-api-2.2jar
                el-imp-2.2.jar
                jsf-api.jar (2.1.1)
                jsf.impl.jar (2.1.1)
                jstl.jar (1.1.0-D13)

                web.xml has

                     <context-param>
                          <param-name>com.sun.faces.expressionFactory</param-name>
                          <param-value>com.sun.el.ExpressionFactoryImpl</param-value>
                     </context-param>

                EAR has
                weblogic-application.xml with

                <wls:prefer-application-packages>
                <wls:package-name>org.eclipse.persistence.*</wls:package-name>
                <wls:package-name>javax.faces.*</wls:package-name>
                <wls:package-name>com.sun.faces.*</wls:package-name>
                     <wls:package-name>com.sun.el.*</wls:package-name>
                     <wls:package-name>javax.el.*</wls:package-name>
                </wls:prefer-application-packages>


                I see by your post that JSF2.0 support can be solved by either deploying a shared-library or using the weblogic.Deployer utility. Unfortunately, we don't have access to change the Weblogic instance in any way. I was hoping that using the prefer-application-packages would be sufficient to use alternative classes to Weblogic's but I have not been able to get it to work for the javax.el classes. I have tried not including javax.el and the app deploys but then accessing a page produces a javax.el.ELResolver no method found for invoke. Invoke being a newer method defined in el-api-2.2.jar. If I was able to convince them to add some shared libs, what are all the jars that would be required to make this work?

                Any suggestions would be greatly appreciated.

                Thanks

                John
                • 5. Re: WebLogic 10.3.4.0 and JSF 2.0 via Eclipse 3.6 Helios EE - EAR export issue
                  910786
                  Steve,

                  I am using JSF2.0 and getting javax.el.ExpressionFactory NoClassDefFound issues.

                  OEPE Helios
                  Weblogic 10.3.3

                  I have an EAR containing one WAR.

                  WEB-INF/lib
                  el-api-2.2jar
                  el-imp-2.2.jar
                  jsf-api.jar (2.1.1)
                  jsf.impl.jar (2.1.1)
                  jstl.jar (1.1.0-D13)

                  web.xml has

                       <context-param>
                            <param-name>com.sun.faces.expressionFactory</param-name>
                            <param-value>com.sun.el.ExpressionFactoryImpl</param-value>
                       </context-param>

                  EAR has
                  weblogic-application.xml with

                  <wls:prefer-application-packages>
                  <wls:package-name>org.eclipse.persistence.*</wls:package-name>
                  <wls:package-name>javax.faces.*</wls:package-name>
                  <wls:package-name>com.sun.faces.*</wls:package-name>
                       <wls:package-name>com.sun.el.*</wls:package-name>
                       <wls:package-name>javax.el.*</wls:package-name>
                  </wls:prefer-application-packages>


                  I see by your post that JSF2.0 support can be solved by either deploying a shared-library or using the weblogic.Deployer utility. Unfortunately, we don't have access to change the Weblogic instance in any way. I was hoping that using the prefer-application-packages would be sufficient to use alternative classes to Weblogic's but I have not been able to get it to work for the javax.el classes. I have tried not including javax.el and the app deploys but then accessing a page produces a javax.el.ELResolver no method found for invoke. Invoke being a newer method defined in el-api-2.2.jar. If I was able to convince them to add some shared libs, what are all the jars that would be required to make this work?

                  Any suggestions would be greatly appreciated.

                  Thanks

                  John