Non-empty onSessionStart gives javax.servlet.http.HttpUpgradeHandler not found by lucee.core


I updated my Lucee installation to 4.5 to 5 recently.

The error pattern was that the first load of a page would produce the error javax.servlet.http.HttpUpgradeHandler not found by lucee.core.

There was a mailing list suggestion that this was an upgrade problem, and replacing the tomcat-servlet-api.jar would make the problem go away.

A fresh install of lucee demonstrated that the problem wasn't isolated to upgrade installs for me. So I replaced the system tomcat-servlet-api.jar with the one from the mailing list.

This did not help my situation. The problem would always come back – once – every morning on my development machine.

The backtrace showed a line in Application.cfc inside onSessionStart. The code was only checking a server variable and setting a session variable. Since this was trivial to work around, I removed it. My problem went away.


Using lucee jar with system java and tomcat.



Michael Offner
June 30, 2016, 6:02 AM

what exactly happens here?

Michael Offner
June 30, 2016, 7:03 AM
Michael Offner
June 30, 2016, 7:05 AM

please reopen ticket if it still happen in your env

Juan Aguilar
July 18, 2016, 2:30 PM

Pardon the ignorance. Not quite sure how to re-open the ticket (unless this comment re-opens it).

I'm running:

Version Lucee
Servlet Container Apache Tomcat/7.0.70
Java 1.8.0_91 (Oracle Corporation) 64bit

The following code:

try {
tmpURL = getPageContext().getRequest().getRequestURL();
catch (Any excpt) {

Throws the following error:

Message: javax.servlet.http.HttpUpgradeHandler

additional.cause: java.lang.ClassNotFoundException

StackTrace: lucee.runtime.exp.NativeException: javax.servlet.http.HttpUpgradeHandler at at java.lang.ClassLoader.loadClass( at java.lang.ClassLoader.loadClass( at org.apache.felix.framework.ExtensionManager$ExtensionManagerWiring.getClassByDelegation( at org.apache.felix.framework.BundleWiringImpl.searchImports( at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation( at org.apache.felix.framework.BundleWiringImpl.access$400( at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass( at java.lang.ClassLoader.loadClass( at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods( at java.lang.Class.privateGetPublicMethods( at java.lang.Class.getMethods( at at at lucee.runtime.reflection.Reflector.getMethodInstanceEL( at lucee.runtime.reflection.Reflector.callMethod( at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues( at lucee.runtime.PageContextImpl.getFunction( [...]

tom chiverton
November 1, 2018, 10:26 AM

Ack - happened on a 4.5 upgrade to 5.x today too.

I had to replace /opt/lucee/tomcat/lib/servlet-api.jar with the one from ot any code like this line in Taffy```GetPageContext().getRequest().getHeader("Authorization")``` would throw.

The original .jar I replaced would have come from the latest Tomcat 7.x on their site.



Michael Offner


Alan Schmidt





Fix versions

Affects versions