Categories
Java Tomcat

javax.el.ELException: Function ‘:empty’ not found

After installing Continuum 1.1 and Archiva 1.1.1 a number of web pages failed to load throwing exceptions such as javax.el.ELException: Function ‘:empty’ not found. As it turns out, this has to do with Tomcat version 6.0.18 and the EL library that it comes with.

As always, when on Linux, a script can fix things and save a lot of time. So here is my attempt at “fixing” java webapps (such as Continuum and Archiva) which encounter this error.


#!/bin/sh
#
# This script modifies EL expressions to run on Tomcat 6.0.18
#
# www.europheus.com
#

find $1 -name *.jsp -print | xargs sed -i -e "s/empty(/empty (/g"
find $1 -name *.jspf -print | xargs sed -i -e "s/empty(/empty (/g"
find $1 -name *.tag -print | xargs sudo sed -i -e "s/empty(/empty (/g"

find $1 -name *.jsp -print | xargs sed -i -e "s/not(/not (/g"
find $1 -name *.jspf -print | xargs sed -i -e "s/not(/not (/g"
find $1 -name *.tag -print | xargs sudo sed -i -e "s/not(/not (/g"

All you need to do is create a script file with this contents then run the script file with the root directory of the java web application. For example, try the following:


vi fix_el.sh
 (copy and paste the script contents)
 save fix_el.sh
chmod +x fix_el.sh
./fix_el.sh /var/www/vhosts/mydomain.com/webapps/ROOT/

Enjoy!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.