Best approach for upgrading Lucee production install on Ubuntu

Hi all,

What is the best approach on upgrading java and tomcat on a Lucee production installl?

  1. Just reinstall Lucee and copy the configuration?
  2. Upgrade both Java and Tomcat by replacing the pointers and/or tomcat folder but keep configuration like server.xml?

I found this guide to change the JRE, but it seems pretty old:

Is there some instruction available that could help me with this?

Cheers,
Marcel

OS: Ubuntu
Java Version: 1.8
Tomcat Version: 8
Lucee Version: 5.3.5.92

use cfconfig to extract your settings and do a fresh install

1 Like

Thanks. I just tried to install cfconfig through commandbox, but it fails with a NullPointer exception. So once I figured this out, I will share my journey.

it’s always @bdw429s fault :slight_smile:

are you running the latest commandbox?

Yes, just installed commandbox fresh. Then tried to install cfonfig

It starts installing, it still seems to successfully install package [forgebox:JSONPrettyPrint@^1.2.6]
and then it starts throwing this constantly:

Please sit tight while your shell reloads...
*** java.lang.instrument ASSERTION FAILED ***: "!errorOutstanding" with message find class on InstrumentationImpl failed at ./src/java.instrument/share/native/libinstrument/JPLISAgent.c line: 494
*** java.lang.instrument ASSERTION FAILED ***: "success" at ./src/java.instrument/share/native/libinstrument/InvocationAdapter.c line: 417
Agent failed to start!

And after that if you run box, I get:

There was an error loading module [commandbox-cfconfig].  Check the logs for more info ( system-log | open ).
>    java.lang.NullPointerException
>    /root/.CommandBox/cfml/system/services/ModuleService.cfc:655

If uninstall cfconfig and install it again I get a lot of information, something wrong with java.util.zip.Deflater:

× | Installing package [forgebox:commandbox-cfconfig]
   |----------------------------------------------------------------
   | Verifying package 'commandbox-cfconfig' in forgebox, please wait...
   | Aww man,  forgebox isn't feeling well.
   | Uh-oh, ForgeBox returned something other than JSON.  Run "system-log | open" to see the full response.  GET https://www.forgebox.io/api/v1/entry/commandb
   | ox-cfconfig Unknown host: null
   | Connection Failure. Status code unavailable.
   | We're going to look in your local artifacts cache and see if one of those versions will work.
   | Sweet! We found a local version of [1.0.8] that we can use in your artifacts.
   | Decompressing...                                                                                                                                              | Shell will be reloaded after installation.
   | /root/.CommandBox/cfml/box.json updated with dependency.
   |----------------------------------------------------------------

ERROR (5.0.1+00137)



/system/services/PackageService.cfc: line 504
502: 					return true;
503: 				}
504: 			});
505:
506: 			// Stupid annoying fix For *nix file systems because Lucee LOSES the executable bit on files when zipping or copying them
called from /system/modules_app/package-commands/commands/package/install.cfc: line 161
called from /system/services/CommandService.cfc: line 343
called from /system/services/CommandService.cfc: line 139
called from /system/Shell.cfc: line 771
called from /system/Shell.cfc: line 591
called from /system/Bootstrap.cfm: line 154

To enable full stack trace, run config set verboseErrors=true

BOOM GOES THE DYNAMITE!!
We're truly sorry, but something horrible has gone wrong when starting up CommandBox.
Here's what we know:.

Message:
Could not initialize class java.util.zip.Deflater


Tag Context:
/root/.CommandBox/cfml/system/wirebox/system/ioc/Injector.cfc: line 263
called from /root/.CommandBox/cfml/system/Bootstrap.cfm: line 174

lucee.runtime.exp.NativeException: Could not initialize class java.util.zip.Deflater
	at java.base/java.util.zip.ZipOutputStream.<init>(ZipOutputStream.java:134)
	at java.base/java.util.zip.ZipOutputStream.<init>(ZipOutputStream.java:120)
	at java.base/java.util.jar.JarOutputStream.<init>(JarOutputStream.java:58)
	at lucee.runtime.instrumentation.InstrumentationFactoryExternal$AgentProvider$ForByteBuddyAgent.createJarFile(InstrumentationFactoryExternal.java:1160)
	at lucee.runtime.instrumentation.InstrumentationFactoryExternal$AgentProvider$ForByteBuddyAgent.resolve(InstrumentationFactoryExternal.java:1184)
	at lucee.runtime.instrumentation.InstrumentationFactoryExternal.install(InstrumentationFactoryExternal.java:394)
	at lucee.runtime.instrumentation.InstrumentationFactoryExternal.install(InstrumentationFactoryExternal.java:375)
	at lucee.runtime.instrumentation.InstrumentationFactoryExternal.install(InstrumentationFactoryExternal.java:344)
	at lucee.runtime.instrumentation.InstrumentationFactoryExternal.install(InstrumentationFactoryExternal.java:330)
	at lucee.runtime.instrumentation.InstrumentationFactory.getInstrumentation(InstrumentationFactory.java:126)
	at lucee.commons.lang.PhysicalClassLoader.loadClass(PhysicalClassLoader.java:192)
	at lucee.runtime.MappingImpl.getPhysicalClass(MappingImpl.java:253)
	at lucee.runtime.PageSourceImpl.loadPhysical(PageSourceImpl.java:336)
	at lucee.runtime.PageSourceImpl.loadPage(PageSourceImpl.java:202)
	at lucee.runtime.type.util.ComponentUtil.getPage(ComponentUtil.java:760)
	at lucee.runtime.type.UDFPropertiesBase.getPage(UDFPropertiesBase.java:46)
	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:342)
	at lucee.runtime.type.UDFImpl.call(UDFImpl.java:215)
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:680)
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:568)
	at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1898)
	at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:785)
	at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1709)
	at _commandbox46.cfml.system.wirebox.system.ioc.injector_cfc$cf.udfCall1(/__commandbox_root/.CommandBox/cfml/system/wirebox/system/ioc/Injector.cfc:263)
	at _commandbox46.cfml.system.wirebox.system.ioc.injector_cfc$cf.udfCall(/__commandbox_root/.CommandBox/cfml/system/wirebox/system/ioc/Injector.cfc)
	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:106)
	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:342)
	at lucee.runtime.type.UDFImpl.call(UDFImpl.java:215)
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:680)
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:568)
	at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1898)
	at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:785)
	at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1709)
	at _commandbox46.cfml.system.bootstrap_cfm$cf.call(/__commandbox_root/.CommandBox/cfml/system/Bootstrap.cfm:174)
	at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:944)
	at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:836)
	at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:818)
	at 1hakaskpj4qmq.call(Unknown Source)
	at lucee.runtime.compiler.Renderer.tag(Renderer.java:108)
	at lucee.runtime.compiler.Renderer.script(Renderer.java:98)
	at lucee.runtime.jsr223.ScriptEngineImpl.eval(ScriptEngineImpl.java:62)
	at lucee.runtime.jsr223.ScriptEngineImpl.eval(ScriptEngineImpl.java:193)
	at cliloader.LoaderCLIMain.execute(LoaderCLIMain.java:328)
	at cliloader.LoaderCLIMain.execute(LoaderCLIMain.java:153)
	at cliloader.LoaderCLIMain.main(LoaderCLIMain.java:552)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class java.util.zip.Deflater
	... 46 more

I have installed OpenJDK11. My java version is:
openjdk 11.0.7

Something from the COmmandBox logs tells me it cannot reach https://www.forgebox.io/api/v1/entry/commandbox-cfconfig
whilst I can do a wget on it, so not sure why CommandBox does not reach it…

"ERROR","FILEAPPENDER","05/05/2020","15:12:40","commandbox.system.util.ForgeBox","Something other than JSON returned. GET https://www.forgebox.io/api/v1/entry/commandbox-cfconfig Unknown host: null
Connection Failure. Status code unavailable. Actual HTTP Response: Connection Failure"
"WARN","FILEAPPENDER","05/05/2020","15:19:40","commandbox.system.services.ModuleService","The module (commandbox-cfconfig) cannot be loaded as it does not have a ModuleConfig.cfc in its root. Path Checked: /root/.CommandBox/cfml/modules/commandbox-cfconfig"

Sorry for letting this question take an entirely different route… ;-(

I’ve noticed Commandbox throwing similar errors too lately, and generally behaving a little erratically. I wonder if it’s to do with the recent JDK updates.

I’m sure Brad will be able to help.

Use java 11.0.6. people have been reporting that error on 11.0.7 but for some reason only on Mac and Linux. Windows seems fine, go figure. The latest version of Lucee has reworked the offending code, but I’m waiting for 5.3.6 to release before I can use it.

I’m on Windows Brad, and yes I updated java to 11.0.7 before this and other erratic behaviour started happening.

Good to know. I’ve been testing 11.0.7 on Windows for a while with no issues, but I’ve also been testing newer versions of Lucee where I think this bug has been removed. Unfortunately CommandBox is stuck between a rock and a hard place again-- we’re still on Lucee 5.3.4 because 5.3.5 was just chock full of regressions-- major ones like entire Ortus libraries not working, and 5.3.6 looks stable, but is not released yet! I don’t know what it is about Java 11.0.7 but I’m really hoping the latest version of Lucee will help once we are able to upgrade to it in CommandBox. I’ve probably dealt with a dozen of these error reports this week from people who update to java 11.0.7 and then Lucee craps out :confused:

1 Like

I run under Ubuntu LTS with Lucee installer. For major LTS updates I re-install and setup. For minor updates I just update files.

Tomcat: download zip from Apache and throw libs/*.jar into /opt/lucee/tomcat/libs. You can also download a newer mod_cfml if needed.
Java: download from OpenJDK and extract to /opt/lucee/jdk. While lucee is stopped rename old jre directory to somethings else and the jdk directory to jre.

I usually do all this while I do an apt update/upgrade.

2 Likes

@kabutotx Thanks for the tips on the tomcat and java updates.

I managed to upgrade it like that and have it working on my local machine.

I also installed Lucee 5.3.6.53-RC

(But the error from my other post is still the same :

invalid definition of the attribute taglib [/sometagname]

)
So for the record.
Java
Installed the dreaded Java 11.0.7 by simply doing

sudo apt-get install default-jdk

It will put your java here:
/usr/lib/jvm/java-11-openjdk-amd64/
renamed /opt/lucee/jdk/jre to jre_old
copied this /usr/lib/jvm/java-11-openjdk-amd64 to /opt/lucee/jdk/
so basically you first get /opt/lucee/jdk/java-11-openjdk-amd64
then rename it to /opt/lucee/jdk/jre

Tomcat
I copied the lib folder from tomcat9 into my /opt/lucee/tomcat
I also copied the bin folder from tomcat 9, because it failed because of missing things in my catalina.sh,
I had to remove org.apache.catalina.core.JasperListener from my server.xml since it is no longer required and will fail your startup.
And finally I had to manually add the mod_cfml jar version from https://viviotech.github.io/mod_cfml/
to my tomcat/lib.
Then it turned out that since I installed tomcat9 it was giving me conflicting portbinding on 8005 for it was using tcp6 on that port, but that I solved by uninstalling tomcat9 again and restarted the machine.

My lucee server is now up to date, although I do not dare to upgrade my production server yet.