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

Description

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.

Environment

Using lucee jar with system java and tomcat.

tomcat-7.0.54-2.el7_1.noarch
tomcat-servlet-3.0-api-7.0.54-2.el7_1.noarch
java-1.8.0-openjdk-1.8.0.91-0.b14.el7_2.x86_64

Activity

Show:
Michael Offner
June 30, 2016, 6:02 AM

what exactly happens here?
/opt/rh/httpd24/root/var/www/websites/think-soil.com/html/Application.cfc:378

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 5.0.1.28-SNAPSHOT
Servlet Container Apache Tomcat/7.0.70
Java 1.8.0_91 (Oracle Corporation) 64bit

The following code:

<cfscript>
try {
tmpURL = getPageContext().getRequest().getRequestURL();
writeDump(tmpURL);
}
catch (Any excpt) {
writeDump(excpt);
}
</cfscript>

Throws the following error:

Message: javax.servlet.http.HttpUpgradeHandler

additional.cause: java.lang.ClassNotFoundException

StackTrace: lucee.runtime.exp.NativeException: javax.servlet.http.HttpUpgradeHandler at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at org.apache.felix.framework.ExtensionManager$ExtensionManagerWiring.getClassByDelegation(ExtensionManager.java:1010) at org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1579) at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1509) at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79) at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1998) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) at java.lang.Class.privateGetPublicMethods(Class.java:2902) at java.lang.Class.getMethods(Class.java:1615) at lucee.runtime.reflection.storage.SoftMethodStorage.store(SoftMethodStorage.java:68) at lucee.runtime.reflection.storage.SoftMethodStorage.getMethods(SoftMethodStorage.java:50) at lucee.runtime.reflection.Reflector.getMethodInstanceEL(Reflector.java:483) at lucee.runtime.reflection.Reflector.callMethod(Reflector.java:845) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:774) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1576) [...]

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 https://groups.google.com/d/msg/lucee/qRXtFzj03Lc/tYoRjuUKBQAJ 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.

Fixed

Assignee

Michael Offner

Reporter

Alan Schmidt

Priority

New

Labels

None

Fix versions

Affects versions

Configure