Issues

Select view

Select search mode

 

regression: fusion reactor won't load

Fixed

Description

Here’s a repro case: https://github.com/mjclemente/lucee_6_fr_error_repro

Includes FW/1 as well.

____________________________

https://cfml.slack.com/archives/C06TA0A9W/p1741278286019439

installing the usual way via commandbox

not entirely sure what's causing it, but it's related to FusionReactor - logging goes nuts when the app spins up, with: Caused by: java.lang.ClassNotFoundException: java.management.fusionreactor.Management

Started with 6.0.249. 6.2.0.248 is okay.

https://github.com/lucee/Lucee/compare/6.2.0.248...6.2.0.249

Environment

None

Attachments

1
  • 07 Mar 2025, 02:54 pm

Details

Assignee

Reporter

Priority

Fix versions

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Sprint

Affects versions

Created 7 March 2025 at 11:31
Updated 26 March 2025 at 17:37
Resolved 26 March 2025 at 17:37

Activity

Show:

Michael Offner18 March 2025 at 14:33

I'll expand on my previous JIRA comment to include your analysis:


Issue most likely is with isClassAvailable method causing FusionReactor compatibility problems

Problem:

The isClassAvailable method is failing to detect the existence of the FusionReactor injected class java.management.fusionreactor.Management. This causes a NoClassDefFoundError when the Lucee runtime attempts to use FusionReactor with FW/1 applications.

Analysis:

  • The current implementation of isClassAvailable uses loader.getResource(resourcePath) to check for class existence, which is more efficient than catching ClassNotFoundException exceptions

  • However, this approach fails with dynamically injected classes like java.management.fusionreactor.Management

  • The class can be successfully loaded with loadClass() but isn't discoverable via getResource()

  • This issue only appeared after recent changes to our classloader hierarchy (after version 6.2.0.248)

Root Cause:

The issue appears to be twofold:

  1. As previously identified, the changes in our classloader hierarchy between 6.2.0.248 and newer versions have altered how external classes are loaded. The PhysicalClassLoader in 248 could see the FusionReactor class, but in newer versions it cannot, because it is not part of the SystemClassloader.

  2. The isClassAvailable method itself is problematic for dynamically injected classes. It uses getResource() to check for class existence, but this method fails for classes that are injected at runtime by agents like FusionReactor. While loadClass() can successfully load these classes, getResource() cannot find them because they don't exist as resources in the normal classpath.

The unusual naming pattern with "java.management" prefix might be intended to leverage OSGi class loading behavior, but our changes have affected this mechanism.

Temporary Solution:

I've temporarily disabled the isClassAvailable optimization and reverted to using loadClass() as before. This resolves the immediate compatibility issue with FusionReactor while we work on a more targeted solution.

https://github.com/lucee/Lucee/commit/c25cd91f079eb2617f144caadd1038015dbd86e1

Michael Offner17 March 2025 at 18:03

After extensive debugging with , I've identified the possible root cause of the NoClassDefFoundError: java/management/fusionreactor/Management issue.

Analysis:

  1. The error occurs only in CommandBox environments with FW/1 framework, while it works fine in Express/standalone Lucee deployments.

  2. The issue starts appearing after Lucee 6.2.0.249, suggesting a change in the classloader behavior.

  3. When I added debug logging to the PhysicalClassLoader, I observed the system is attempting to load java.management.fusionreactor.Management and loads it by the super Classloader from PhysicalClassloader .

  4. I confirmed the class exists in the FusionReactor installation (fr-management.jar in the FusionReactor directory), but our classloader changes have affected its visibility (i guess).

  5. The problematic class has an unusual naming pattern with "java.management" prefix, which suggests it might be intended to leverage OSGi class loading behavior.

Root Cause:

The changes in our classloader hierarchy between 6.2.0.248 and newer versions have altered how external classes are loaded. The PhysicalClassLoader in 248 could see the FusionReactor class, but in newer versions it cannot, because it is not part of the SystemClassloader.

The class is likely not being loaded because it's not in the OSGi bootdelegation list, despite having a "java" prefix, what only benefit classes from the system classloader.

Next Steps:

I'll add the java.management.fusionreactor package explicitly to our default.properties bootdelegation list to ensure the class is properly delegated to any classloader when available.

This should at least get rid of this exception and maybe break further down the road, but this will confirm the above assumptions.

Michael Offner17 March 2025 at 14:30

with 6.2.0.248 we see the following on the console:

[ERROR] java.lang.NoClassDefFoundError: java/management/fusionreactor/Management [ERROR] at framework.one_cfc$cf.udfCall(/framework/one.cfc) [ERROR] at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) [ERROR] at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357) [ERROR] at lucee.runtime.type.UDFImpl.call(UDFImpl.java:224) [ERROR] at lucee.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:784) [ERROR] at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:797) [ERROR] at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:2075) [ERROR] at framework.one_cfc$cf.udfCall5(/framework/one.cfc:820) ... [ERROR] at com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:134) [ERROR] at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doNext(FusionReactorRequestHandler.java:698) [ERROR] at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doHttpServletRequest(FusionReactorRequestHandler.java:256) [ERROR] at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doFusionRequest(FusionReactorRequestHandler.java:119) [ERROR] at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.handle(FusionReactorRequestHandler.java:736) [ERROR] at com.intergral.fusionreactor.j2ee.filter.FusionReactorCoreFilter.doFilter(FusionReactorCoreFilter.java:36) [ERROR] at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source) [ERROR] at java.base/java.lang.reflect.Method.invoke(Unknown Source) [ERROR] at com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:71) [ERROR] at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source) [ERROR] at java.base/java.lang.reflect.Method.invoke(Unknown Source) [ERROR] at com.intergral.fusionreactor.agent.filter.FusionReactorStaticFilter.doFilter(FusionReactorStaticFilter.java:54) [ERROR] at com.intergral.fusionreactor.agent.pointcuts.NewFilterChainPointCut$1.invoke(NewFilterChainPointCut.java:50) ... [ERROR] Caused by: java.lang.ClassNotFoundException: java.management.fusionreactor.Management [ERROR] ... 92 more [WARN ] Runwar: responded: Status Code 500 (http://127.0.0.1:54562/)

but it works

Matthew Clemente17 March 2025 at 13:45

I’ll shoot an email to the FusionReactor support team to see if they can take a look. I pinged them in the CFML slack channel as well.

Michael Offner17 March 2025 at 13:36

problem is that fusionreactor injects code into the Lucee bytecode via a java agent, that seems to fail, question is how that code looks like

The error stack trace shows FusionReactor attempting to instrument Lucee's bytecode at runtime, which is failing when looking for the non-existent class java/management/fusionreactor/Management. The agent is likely attempting to insert monitoring hooks into the application startup process.

The injection pattern can be seen in the stack trace where FusionReactor components (WrappedFilterChain, FusionReactorRequestHandler, etc.) are intercepting the request flow. The specific bytecode manipulation is probably attempting to add performance monitoring around method calls but is referencing an incorrect or missing class.

Flag notifications