2

I have Weblogic 10.3.5 installed. I deployed a WAR with JSF 2.0 and JSTL 1.2 on the server. But I need EL 2.2 functionality as well. What JARs do I need? It'd be great if someone can point me to a step-by-step guide from scratch as I've been trying to set this up for hours with no luck.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Murat Derya Özen
  • 2,154
  • 8
  • 31
  • 44
  • Answered in another post: [http://stackoverflow.com/questions/8884906/weblogic10-3-jsf2-built-in-jars][1] - see Levent Tokmak's Answer. [1]: http://stackoverflow.com/questions/8884906/weblogic10-3-jsf2-built-in-jars – Glen Best Apr 10 '13 at 07:14

3 Answers3

7

Easiest is to drop jboss-el.jar, which is an EL 2.1 compatible implementation offering the same features as EL 2.2, in /WEB-INF/lib and tell the JSF implementation to use that EL implementation instead. How to do that depends on the JSF implementation being used. In case of Mojarra, you need to add the following context parameter to the web.xml:

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

And in case of MyFaces, it's the following context parameter:

<context-param>     
    <param-name>org.apache.myfaces.EXPRESSION_FACTORY</param-name>
    <param-value>org.jboss.el.ExpressionFactoryImpl</param-value>   
</context-param>

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • But the container ships with `glassfish.el_1.0.0.0_2-1.jar` out of the box. Wouldn't it be better to use what it provides by default? – Murat Derya Özen Jan 16 '12 at 18:06
  • 1
    JBoss EL is an EL 2.1 **implementation** with [enhanced EL](http://docs.jboss.org/seam/latest/reference/en-US/html/elenhancements.html) support, not an EL 2.1 **API**. You still need container's own EL 2.1 API. Just keep it untouched and make sure that you do not have any container specific libraries in `/WEB-INF/lib`. Note that the "JBoss" name does not imply that it originates from JBoss AS server. "JBoss" is just a software company name, like "Apache" and "Oracle". – BalusC Jan 16 '12 at 18:07
  • So that glassfish thing is the API but not the implementation? – Murat Derya Özen Jan 16 '12 at 18:10
  • Thanks BalusC, I'll give it a try once more. – Murat Derya Özen Jan 16 '12 at 18:11
  • Sorry Bauke, my apologies :) I appreciate your help. – Murat Derya Özen Jan 16 '12 at 20:49
  • @BalusC Thanks for the edit, and I see how this should work, but Weblogic still loads its bundled EL libraries. I added the `` element to weblogic.xml and this is ignored. It is extremely frustrating that EL 2.2 implementations have been out for **years** and the major application containers still have so much trouble supporting them! :( – maple_shaft Apr 09 '13 at 17:43
  • @Maple: I'm not sure how that forms a problem. How did you observe that it didn't work? Haven't you placed some EL API libraries in `/WEB-INF/lib`? (no they don't belong there; just a single JBoss EL JAR file is sufficient) Note that WebLogic 10.3.x is a Servlet 2.5 container which offers EL 2.1 API out the box and thus manually providing EL 2.2 API (let alone impl) from the webapp on ain't going to work without changing the server. – BalusC Apr 09 '13 at 17:47
  • @BalusC perhaps we can meet in chat? It will be easier than communicating through comments. http://chat.stackoverflow.com/rooms/27888/balusc-and-mapleshaft – maple_shaft Apr 09 '13 at 17:51
  • @maple: I didn't get notified of the new messages in chat. Sorry for the delay in reply. – BalusC Apr 11 '13 at 01:42
  • @BalusC Yeah thats strange... I replied to your reply just now – maple_shaft Apr 11 '13 at 11:23
  • @BalusC Your answer seems to be correct, but there is another way I found that I posted below. I awarded you the bounty. – maple_shaft Apr 15 '13 at 13:22
2

I feel that the accepted answer may or may not work for every situation, and of course the hook is that you will be stuck to a single JBoss release of EL without any of the support of continuing bug fixes in future patch releases of a proper 2.2 implementation.

Ultimately here is what worked for me on a WebLogic 10.3.6 server.

I downloaded the EL 2.2 API and Implementation jars from Glassfish and included those in the WEB-INF/lib folder of my web application.

el-api-2.2.jar

el-impl-2.2.0-SNAPSHOT.jar

After doing this you would normally need to add a context parameter to web.xml to signify the class to load for the new EL implementation like in BalusC's answer. Weblogic doesn't seem to care about this however, its classloader has its own way of things. You need to specify in your weblogic.xml to give preferential class loading to the EL classes in WEB-INF/lib. This will allow your Glassfish implementation to be loaded in place of the older EL implementation bundled with WebLogic.

 <container-descriptor>
    <prefer-application-packages>
     <package-name>com.sun.el.*</package-name>
     <package-name>javax.el.*</package-name>
  </prefer-application-packages>
</container-descriptor>
Community
  • 1
  • 1
maple_shaft
  • 10,435
  • 6
  • 46
  • 74
0

I got to reanimate the question as i found out that the jboss implementation of el 2.2 has a permgenspace memory leak upon redeploying. I tried several other implementations available, namely

  • juel 2.2.1
  • tomcat-jasper-el 7.0.35

but got none running. Using the 2.2 glassfish implementation didn't work either (even with prefer-web-inf-classes, or prefer-application-package), cause of classloading problems.

I'd appreciate any suggestions which implementation is up to date and works with weblogic without changes in the server classpath.

dag
  • 1,133
  • 12
  • 25
  • If you are still curious about this issue, then see my following answer. The Glassfish implementation does work, I am sure that you just have a build or deployment problem somewhere. – maple_shaft Apr 15 '13 at 13:23