We're updating the issue view to help you get more done. 

update cf module in folder caused error: class redefinition failed: attempted to change the class modifiers

Description

I think it might be related to Error Run file compile

I attached some test code in the zip, one is for Lucee 4.5.5, and the other one is Lucee 5.2.5

mapping setting is like

step to reproduce -

Access the lucee4 test-include.cfm, the output is "A_1", then try to replace the data.cfm.1 (compiled file) to be data.cfm, then you will see a different output (A_45), then rename the data.cfm back to data.cfm.1, data.cfm.src (updated source code) to be data.cfm, you will see another output (A_4.5.5) based one the code

However, if you apply the same steps tom Lucee 5.2.5, when you use the 'src' file to replace 'complied' file, it shows error like below

Also, "restart Lucee" will not fix this error, I will need to manually remove all files in the "cfclasses" folder, then restart Lucee.

I am pretty sure it was working from Railo/Lucee 4.x - Lucee 5.2.2

===========
Lucee 5.2.5.20 Error (java.lang.UnsupportedOperationException)
Message class redefinition failed: attempted to change the class modifiers
Extended Info failed to load template C:\web\cs10xdev\luceetest\lucee525\com\utilities\data.cfm
Stacktrace The Error Occurred in
/luceetest/test-include.cfm: line 2
Java Stacktrace lucee.runtime.exp.NativeException: class redefinition failed: attempted to change the class modifiers
at sun.instrument.InstrumentationImpl.redefineClasses0(Native Method)
at sun.instrument.InstrumentationImpl.redefineClasses(InstrumentationImpl.java:170)
at lucee.commons.lang.PhysicalClassLoader.loadClass(PhysicalClassLoader.java:180)
at lucee.runtime.MappingImpl.getPhysicalClass(MappingImpl.java:249)
at lucee.runtime.PageSourceImpl._compile(PageSourceImpl.java:404)
at lucee.runtime.PageSourceImpl.compile(PageSourceImpl.java:369)
at lucee.runtime.PageSourceImpl.loadPhysical(PageSourceImpl.java:310)
at lucee.runtime.PageSourceImpl.loadPageThrowTemplateException(PageSourceImpl.java:219)
at lucee.runtime.PageSourceImpl.loadPage(PageSourceImpl.java:946)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:934)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:833)
at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:817)
at test_include_cfm225$cf.call(/luceetest/test-include.cfm:2)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:939)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:833)
at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:223)
at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:43)
at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2405)
at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2395)
at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2363)
at lucee.runtime.engine.Request.exe(Request.java:44)
at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1091)
at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1039)
at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:102)
at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:486)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1457)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.UnsupportedOperationException: class redefinition failed: attempted to change the class modifiers
... 48 more

Environment

None

Status

Assignee

Michael Offner

Reporter

Allen Weng

Labels

None

Sprint

None

Fix versions

Affects versions

5.2.5.20

Priority

Critical