Lucee 7: Preside fails to start with strange error accessing super class functions

The error:

Component [preside.system.coldboxModifications.services.InterceptorService] has no private function with name [registerInterceptor]

Accessible functions are [ …, REGISTERINTERCEPTOR, …]

The code here looks like this:

component extends="coldbox.system.web.services.InterceptorService" {

	// ...

	public any function registerInterceptors() {
		_registeringInterceptors = true;

		super.registerInterceptors( argumentCollection=arguments );

		_registeringInterceptors = false;
	}

	public any function registerInterceptor( string interceptorClass ) {
		if ( StructKeyExists( arguments, "interceptorClass" ) ) {
			_currentRegisteringInterceptor = arguments.interceptorClass;
		}

		// error happens here
		return super.registerInterceptor( argumentCollection=arguments );
	}
// ...

The registerInterceptor method exists in the base component. What is even more strange is that if I add a throw() or abort into the code of the base class method, it does get executed without this error.

Repro using commandbox

Requires a mysql database instance

box
preside new site // then follow the wizard to setup a preside app with default options
preside start cfengine=lucee@7 // complete the database connection setup wizard

Then wait for browser to open and app to start up. Error then shows.


Don’t forget to tell us about your stack!

OS: Debian based linux’s
Java Version: 21
Tomcat Version: N/A
Lucee Version: All 7.x versions

@dom_watson I’m having a look, this is kinda related, but i thought we already solved this?

https://luceeserver.atlassian.net/browse/LDEV-5913

1 Like

some yak shaving, while investigating, the error message is confusing

https://luceeserver.atlassian.net/browse/LDEV-6055

The following change makes the error go away. In Lucee/core/src/main/java/lucee/runtime/ComponentImpl.java at 7.0 · lucee/Lucee · GitHub

From:

if (superAccess) {
	return _udfs.get(key);
}

To:

if (superAccess) {
	Member member = _udfs.get(key);
	if ( member != null ) return member;
}

That code has not changed in 7 years though so presumably related to something around how _udfs is populated or somesuch. Hopefully this is useful information to a permanent fix.

2 Likes

i think bug this was introduced around 7.0.0.258 ?

I’m not able to verify that as 7.0.0.257 has some issues that prevent the system from working for me.

I’m having trouble getting a working repo for the issue, are you able to put together a reduced test case?

I’ve tried but cannot create a simplified repro. Were you able to repro using the preside repro in the first message?

@dom_watson figured it out, then after fixing / bypassing some ( javax (headers, cfconcurrent) / servlet setStatus() / omg he’s on windows) tech debt, it’s working for me locally

will review and merge tomorrow

Super star. Thanks @Zackster !

1 Like

@micstriit is reviewing the PR

1 Like

Should also be fixed since 7.0.2.54-SNAPSHOT

Underlying issue was the logic comparing if components were the same changed approach which exposed some other tech debt which we have now solved.