Monday, April 21, 2008

Commons-el.jar and glassfish

I know, been a long time. If you place the commons_el.jar file from the jakarta project anywhere in the glassfish lib dirs (glassfish/lib glassfish/domain1/domain/lib) glassfish will start just fine, but weird things happen in the web gui. When you try to deploy an ear,war,jar you will get a:

javax.servlet.ServletException: String index out of range: -1

root cause

java.lang.StringIndexOutOfBoundsException: String index out of range: -1


This doesn't always happen, as sometimes it will work and you get to the deploy page.
Other times, you can be misled like it is deploying, then you get the error.
To avoid this, you will need to bundle the commons_el.jar with the web app and not
make it global. At least that is the only way I've found so far...