6 Replies Latest reply: Oct 3, 2012 8:15 AM by 965902 RSS

    expression language 2 on weblogic 10

    732131
      Hi

      I'm trying to use the unified el 2 in my EAR project ( ejb + jsf 1.2 + facelets)

      I tried to put the jars ( api and impl) on web-inf/lib, app-inf/lib and servers' lib directory

      but looks like weblogic just ignores them no matter what.

      I want to use the method call feature of el 2:

      ${myBean.myMethod('myParam')}

      here are the jars
      http://blogs.sun.com/rlubke/entry/unified_expression_language_is_and

      any help is welcome
      thanks

      Junico
        • 1. Re: expression language 2 on weblogic 10
          732131
          here is the error stack:
          javax.el.ELException: Error Parsing: #{userBean.can('ctr.nivel1')}
               at com.sun.el.lang.ExpressionBuilder.createNodeInternal(ExpressionBuilder.java:160)
               at com.sun.el.lang.ExpressionBuilder.build(ExpressionBuilder.java:177)
               at com.sun.el.lang.ExpressionBuilder.createValueExpression(ExpressionBuilder.java:221)
               at com.sun.el.ExpressionFactoryImpl.createValueExpression(ExpressionFactoryImpl.java:81)
               at com.sun.facelets.tag.TagAttribute.getValueExpression(TagAttribute.java:256)
               at com.sun.facelets.tag.jsf.ComponentRule$ValueExpressionMetadata.applyMetadata(ComponentRule.java:69)
               at com.sun.facelets.tag.MetadataImpl.applyMetadata(MetadataImpl.java:36)
               at com.sun.facelets.tag.MetaTagHandler.setAttributes(MetaTagHandler.java:62)
               at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:144)
               at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
               at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
               at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
               at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
               at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
               at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
               at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
               at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
               at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
               at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
               at com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
               at com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
               at com.sun.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:64)
               at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:131)
               at com.sun.facelets.impl.DefaultFaceletContext$TemplateManager.apply(DefaultFaceletContext.java:337)
               at com.sun.facelets.impl.DefaultFaceletContext.includeDefinition(DefaultFaceletContext.java:307)
               at com.sun.facelets.tag.ui.InsertHandler.apply(InsertHandler.java:68)
               at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
               at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
               at com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
               at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
               at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
               at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
               at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
               at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:140)
               at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)
               at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
               at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
               at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
               at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:524)
               at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567)
               at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
               at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
               at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
               at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
               at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
               at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
               at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
               at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
               at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
               at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
               at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
               at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
               at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
               at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:368)
               at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:495)
               at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
               at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
               at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
               at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
               at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
               at weblogic.security.service.SecurityManager.runAs(Unknown Source)
               at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
               at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
               at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
               at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
               at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
          Caused by: com.sun.el.parser.ParseException: Encountered "(" at line 1, column 15.
          Was expecting one of:
          "}" ...
          "." ...
          "[" ...
          ">" ...
          "gt" ...
          "<" ...
          "lt" ...
          ">=" ...
          "ge" ...
          "<=" ...
          "le" ...
          "==" ...
          "eq" ...
          "!=" ...
          "ne" ...
          "&&" ...
          "and" ...
          "||" ...
          "or" ...
          "*" ...
          "+" ...
          "-" ...
          "?" ...
          "/" ...
          "div" ...
          "%" ...
          "mod" ...

               at com.sun.el.parser.ELParser.generateParseException(ELParser.java:1651)
               at com.sun.el.parser.ELParser.jj_consume_token(ELParser.java:1531)
               at com.sun.el.parser.ELParser.DeferredExpression(ELParser.java:134)
               at com.sun.el.parser.ELParser.CompositeExpression(ELParser.java:61)
               at com.sun.el.lang.ExpressionBuilder.createNodeInternal(ExpressionBuilder.java:128)
               ... 65 more
          • 2. Re: expression language 2 on weblogic 10
            730338
            I think you can put the el 2.0 library in the /WEB-INF/lib directory and configure the weblogic.xml. The "<prefer-web-inf-classes>true</prefer-web-inf-classes>" is to make web container to load classes first in the webapp.
            • 3. Re: expression language 2 on weblogic 10
              839021
              That didn't help, it still goes "Error Parsing".
              Any other ideas to try and force it to use el-impl.2.0.jar?
              • 4. Re: expression language 2 on weblogic 10
                839021
                For other classes "prefer" seems to work, but not for EL.
                I ended up doing this way (changing domain configuration is better than changing the configuration of the whole server):

                <tt>--- user_projects/domains/base_domain/bin/setDomainEnv.sh.orig 2011-02-15 14:52:27.050375701 +0100
                +++ user_projects/domains/base_domain/bin/setDomainEnv.sh 2011-02-15 11:35:18.654379340 +0100
                @@ -207,6 +207,7 @@
                # PATCH_LIBPATH=[myPatchLibpath] (unix)
                # PATCH_PATH=[myPatchPath] (unix)

                +PATCH_CLASSPATH="/home/alex/el-api-2.2.jar:/home/alex/el-impl-2.2.jar"
                . ${WL_HOME}/common/bin/commEnv.sh

                WLS_HOME="${WL_HOME}/server"</tt>
                • 5. Re: expression language 2 on weblogic 10
                  434278
                  1. Copy the both el-api-2.2.jar and el.impl-2.2.jar to <web-applicaiton>WEB-INF/lib

                  2. Add below context param to web.xml

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

                  3. Add below to weblogic.xml

                  <container-descriptor>
                  <prefer-application-packages>
                  <package-name>com.sun.el.*</package-name>
                  <package-name>javax.el.*</package-name>
                  </prefer-application-packages>
                  </container-descriptor>

                  And it works in weblogic 10.3.5

                  Edited by: venur on Nov 9, 2011 9:29 AM
                  • 6. Re: expression language 2 on weblogic 10
                    965902
                    For me the following worked:

                    Weblogic 10.3.5.0

                    I have a JavaEE application with both ejbs in EJB container and Facelets in Web container.

                    I added <earfile>/META_INF/weblogic-application.xml :
                    <?xml version = '1.0' encoding = 'windows-1252'?>
                    <weblogic-application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                    xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-application http://xmlns.oracle.com/weblogic/weblogic-application/1.1/weblogic-application.xsd"
                    xmlns="http://xmlns.oracle.com/weblogic/weblogic-application">
                    <prefer-application-packages>
                    <package-name>com.sun.el.*</package-name>
                    <package-name>javax.el.*</package-name>
                    </prefer-application-packages>
                    </weblogic-application>



                    Included el-api-2.2.jar and el-impl-2.2.jar to the WEB-INF/lib library.

                    -> it works, it does not work for me when using the weblogic.xml