Hi,
Do you have any suggestions on how to start Lucee-express-6.1.0.243 on Windows? When you double-click on /bin/startup.bat, you get a CMD screen saying:
Java version not found.
Press any key to continue . . .
The cause was clear when I examined the file startup.bat. The file refers to the registry path "javaKey=HKLM\SOFTWARE\JavaSoft\Java Runtime Environment". But, as you can see in the attached image, there is no such path in the Windows Registry.
I had a similar problem with starting Lucee-express-5.4.2.17. Changing the path from "javaKey=HKLM\SOFTWARE\JavaSoft\Java Runtime Environment" to "javaKey=HKLM\SOFTWARE\JavaSoft\JDK" solved the problem then.
However, doing the same fails to solve the problem on Lucee-express-6.1.0.243. When you double-click on /bin/startup.bat, the CMD screen flashes for a brief moment then disappears. The URL localhost:8888 shows that Lucee 6.1 is not yet running. Nothing is logged in Lucee.
Double-clicking on startup.bat was enough to get Lucee started. There was no need to do anything about setenv.bat.
Setting the Java environment variable is probably not the issue. To see how I arrive at this conclusion, edit lucee-express-6.1.0.243\startup.bat by adding the lines
echo Java directory found
echo %javaDir%
pause
directly after the line
SET JAVA_HOME=%javaDir%
When you then double-click lucee-express-6.1.0.243\startup.bat, you get a CMD screen saying:
Java directory found
C:\Program Files\Java\jdk-17
Press any key to continue . . .
Press [ENTER] to continue, and Lucee-express-6.1.0.243 fails to start.
Download and install the new download of Lucee Release 6.1.0.243 (Jul 19, 2024) Express version https://cdn.lucee.org/lucee-express-6.1.0.243.zip (they removed the javakey from catalina.bat)
Download and install Java 11 (Lucee 6.1 is not compatible with Java 1.8)
Adjust manually the next Windows environment variables:
a) PATH: remove any other java reference and include <java11_dir>\bin
b) JAVA_HOME: change to <java11_dir>
Fix catalina.bat file: remove all occurrences of the following string (java.endorsed.dirs is not compatible with java 11)
-Djava.endorsed.dirs=“%JAVA_ENDORSED_DIRS%”
Thanks for the tip, @obonilla66.
When I remove all occurrences of
-Djava.endorsed.dirs=“%JAVA_ENDORSED_DIRS%”
from catalina.bat, I can indeed get Lucee to start. But then, with severe errors:
22-Sep-2024 19:27:55.341 SEVERE [main] org.apache.catalina.core.JreMemoryLeakPreventionListener.lifecycleEvent Failed to trigger creation of the GC Daemon thread during Tomcat start to prevent possible memory leaks. This is expected on non-Sun JVMs.
java.lang.ClassNotFoundException: sun.misc.GC
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:592)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:375)
at org.apache.catalina.core.JreMemoryLeakPreventionListener.lifecycleEvent(JreMemoryLeakPreventionListener.java:286)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:394)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:99)
at org.apache.catalina.startup.Catalina.load(Catalina.java:580)
at org.apache.catalina.startup.Catalina.load(Catalina.java:603)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:310)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:484)
22-Sep-2024 19:27:55.526 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8888"]
22-Sep-2024 19:27:55.635 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
22-Sep-2024 19:27:55.639 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
22-Sep-2024 19:27:55.641 SEVERE [main] org.apache.coyote.AbstractProtocol.init Failed to initialize end point associated with ProtocolHandler ["ajp-nio-8009"]
java.lang.IllegalArgumentException: timeout < 0
at java.base/sun.nio.ch.ServerSocketAdaptor.setSoTimeout(ServerSocketAdaptor.java:162)
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:353)
at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:748)
at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:459)
at org.apache.catalina.connector.Connector.initInternal(Connector.java:960)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.core.StandardService.initInternal(StandardService.java:568)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:869)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.startup.Catalina.load(Catalina.java:580)
at org.apache.catalina.startup.Catalina.load(Catalina.java:603)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:310)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:484)
22-Sep-2024 19:27:55.642 SEVERE [main] org.apache.catalina.core.StandardService.initInternal Failed to initialize connector [Connector[AJP/1.3-8009]]
org.apache.catalina.LifecycleException: Failed to initialize component [Connector[AJP/1.3-8009]]
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:106)
at org.apache.catalina.core.StandardService.initInternal(StandardService.java:568)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:869)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.startup.Catalina.load(Catalina.java:580)
at org.apache.catalina.startup.Catalina.load(Catalina.java:603)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:310)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:484)
Caused by: org.apache.catalina.LifecycleException: Protocol handler initialization failed
at org.apache.catalina.connector.Connector.initInternal(Connector.java:962)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
... 12 more
Caused by: java.lang.IllegalArgumentException: timeout < 0
at java.base/sun.nio.ch.ServerSocketAdaptor.setSoTimeout(ServerSocketAdaptor.java:162)
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:353)
at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:748)
at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:459)
at org.apache.catalina.connector.Connector.initInternal(Connector.java:960)
... 13 more
22-Sep-2024 19:27:55.643 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 745 ms
22-Sep-2024 19:27:55.694 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
22-Sep-2024 19:27:55.695 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.36
22-Sep-2024 19:27:55.709 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\bin\lucee-express-6.1.0.243\webapps\ROOT
22-Sep-2024 19:27:55.840 INFO [localhost-startStop-1] org.apache.catalina.loader.WebappLoader.buildClassPath Unknown loader jdk.internal.loader.ClassLoaders$AppClassLoader@659e0bfd class jdk.internal.loader.ClassLoaders$AppClassLoader
22-Sep-2024 19:27:56.059 SEVERE [localhost-startStop-1] org.apache.catalina.startup.ContextConfig.processAnnotationsJar Unable to process Jar entry [module-info.class] from Jar [file:/C:/bin/lucee-express-6.1.0.243/lib/ext/lucee.jar] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19
at org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:97)
at org.apache.tomcat.util.bcel.classfile.ConstantPool.<init>(ConstantPool.java:55)
at org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:176)
at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:85)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2042)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1988)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1958)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1912)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1157)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:779)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:306)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5202)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1092)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1834)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:842)
22-Sep-2024 19:27:56.296 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
22-Sep-2024 19:28:00.831 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\bin\lucee-express-6.1.0.243\webapps\ROOT has finished in 5,121 ms
22-Sep-2024 19:28:00.833 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8888"]
22-Sep-2024 19:28:00.846 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 5203 ms
I only have one error but after startup it worked normally, (the same error in 2 different computers, one with RedHat java-11-openjdk-11.0.24.0.8-1, and the other with Eclipse Adoptium\jre-11.0.24.8-hotspot):
21-Sep-2024 20:21:01.040 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\CF_lucee61\webapps\ROOT
21-Sep-2024 20:21:01.143 INFO [localhost-startStop-1] org.apache.catalina.loader.WebappLoader.buildClassPath Unknown loader jdk.internal.loader.ClassLoaders$AppClassLoader@66d33a class jdk.internal.loader.ClassLoaders$AppClassLoader
21-Sep-2024 20:21:01.311 SEVERE [localhost-startStop-1] org.apache.catalina.startup.ContextConfig.processAnnotationsJar Unable to process Jar entry [module-info.class] from Jar [file:/C:/CF_lucee61/lib/ext/lucee.jar] for annotations
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19
at org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:97)
at org.apache.tomcat.util.bcel.classfile.ConstantPool.<init>(ConstantPool.java:55)
at org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:176)
at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:85)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2042)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1988)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1958)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1912)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1157)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:779)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:306)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5202)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1092)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1834)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
21-Sep-2024 20:21:01.523 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
21-Sep-2024 20:21:02.175 INFO [localhost-startStop-1] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [629] milliseconds.
21-Sep-2024 20:21:16.068 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\CF_lucee61\webapps\ROOT has finished in 15,028 ms
21-Sep-2024 20:21:16.071 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8888"]
21-Sep-2024 20:21:16.082 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
21-Sep-2024 20:21:16.085 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 15123 ms
The 6.1.x Lucee express comes with tomcat 8…while that for lucee 6.0.x and even 5.4.3.x had come with tomcat 9. This seems a mistake. It seems also to relate to the “endorsed dirs” matter, and it would certainly seem to relate to problems running with Java 17.
To be clear, the majority of files in express are really just a tomcat deployment with some embedded lucee-specific files–which are 6.1 and seemingly designed to run on tomcat 9. Most of the other files are pure tomcat, so having the wrong tomcat would seem like running a petrol car on diesel.
One last matter: it’s not often mentioned in discussions about express, but beware that there’s a startup.bat (and .sh) file in both the root of the zip AND in the bin…and the instructions on both the lucee site and the text files in that root folder (which again are tomcat-provided) refer to running bin/startup rather than the root startup.
It really begs the question why there’s a startup in the root. I wasn’t sure how best to raise these issues, so I though I’d start here.