We’re trying to move from Lucee 5 to 6 and while testing the code I came across an issue with Closure Compiler.
The same code works fine on Lucee 5, but on Lucee 6 I’m getting (intermittently) following error:
No matching method for com.google.javascript.jscomp.CompilationLevel.setOptionsForCompilationLevel(com.google.javascript.jscomp.CompilerOptions) found. there are similar methods with the same name, but diferent arguments: setOptionsForCompilationLevel(com.google.javascript.jscomp.CompilerOptions);
Which (aside from the typo) doesn’t make any sense to me - no matching method XYZ, but there’s a similar method XYZ with the same arguments.
I’m using the latest JAR version from here https://mvnrepository.com/artifact/com.google.javascript/closure-compiler
The code looks like this:
local.oOptions = CreateObject("java","com.google.javascript.jscomp.CompilerOptions").init();
local.oLevel = CreateObject("java","com.google.javascript.jscomp.CompilationLevel");
local.oLevel.SIMPLE_OPTIMIZATIONS.setOptionsForCompilationLevel( local.oOptions );
Last line errors out.
Looks like there are some other posts with other Java issues (NoSuchMethodError), so it may be connected.
Stack trace:
lucee.runtime.exp.NativeException: No matching method for com.google.javascript.jscomp.CompilationLevel.setOptionsForCompilationLevel(com.google.javascript.jscomp.CompilerOptions) found. there are similar methods with the same name, but diferent arguments: setOptionsForCompilationLevel(com.google.javascript.jscomp.CompilerOptions); at lucee.transformer.dynamic.meta.Clazz.getMethodMatch(Clazz.java:229) at lucee.runtime.reflection.pairs.MethodInstance.invoke(MethodInstance.java:70) at lucee.runtime.reflection.Reflector.callMethod(Reflector.java:928) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:840) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1988) at emojo.affino._5.closurecompiler_cfc$cf.udfCall(/Emojo/Affino/5/ClosureCompiler.cfc:78) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357) at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:214) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:672) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:588) at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:2048) at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:875) at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:2020) at afcengine.cssoutput_cfm$cf.call(/AffinoMapping/AfcEngine/CSSoutput.cfm:74) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1020) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:944) at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:925) at afcengine.onrequestend_cfm$cf.call(/AffinoMapping/AfcEngine/OnRequestEnd.cfm:131) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1020) at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:944) at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:925) at afcengine.cfc.onrequest_cfc$cf.udfCall(/AffinoMapping/AfcEngine/cfc/OnRequest.cfc:195) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357) at lucee.runtime.type.UDFImpl.callWithNamedValues(UDFImpl.java:214) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:672) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:588) at lucee.runtime.ComponentImpl.callWithNamedValues(ComponentImpl.java:2048) at lucee.runtime.util.VariableUtilImpl.callFunctionWithNamedValues(VariableUtilImpl.java:875) at lucee.runtime.PageContextImpl.getFunctionWithNamedValues(PageContextImpl.java:2020) at application_cfc$cf.udfCall(/Application.cfc:142) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:357) at lucee.runtime.type.UDFImpl.call(UDFImpl.java:224) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:671) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:588) at lucee.runtime.ComponentImpl.call(ComponentImpl.java:2029) at lucee.runtime.listener.ModernAppListener.call(ModernAppListener.java:476) at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:212) at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:41) at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2731) at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2718) at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2689) at lucee.runtime.engine.Request.exe(Request.java:45) at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1155) at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1112) at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:97) at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:51) at javax.servlet.http.HttpServlet.service(HttpServlet.java:623) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:199) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:144) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:168) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:144) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:168) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:761) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:346) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:388) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:928) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1791) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1190) at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63) at java.base/java.lang.Thread.run(Unknown Source) Caused by: java.lang.NoSuchMethodException: No matching method for com.google.javascript.jscomp.CompilationLevel.setOptionsForCompilationLevel(com.google.javascript.jscomp.CompilerOptions) found. there are similar methods with the same name, but diferent arguments: setOptionsForCompilationLevel(com.google.javascript.jscomp.CompilerOptions); … 72 more
OS: Linux 6.8.0-1012-aws
Java Version: Eclipse Adoptium 11.0.23+9 (2024-04-16) | JVM: OpenJDK 64-Bit Server VM
Tomcat Version: Apache Tomcat/9.0.89
Lucee Version: 6.1.0.243 Gelert