Java error each time box is started.

Hi,

Every time I start commandbox, I get a java error message. I’ve completely uninstalled and reinstalled commandbox both with and without java. I’ve also uninstalled and reinstalled java on my machine. Not sure why this is happening.

Here is everything that comes up when I start:

PS D:\Developer\websites<REDACTED>> box
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(Unknown Source)
at java.util.zip.ZipFile.(Unknown Source)
at java.util.jar.JarFile.(Unknown Source)
at java.util.jar.JarFile.(Unknown Source)
at lucee.loader.osgi.BundleLoader.loadBundleInfo(BundleLoader.java:192)
at lucee.loader.osgi.BundleLoader.loadAvailableBundles(BundleLoader.java:182)
at lucee.loader.osgi.BundleLoader.loadBundles(BundleLoader.java:118)
at lucee.loader.engine.CFMLEngineFactory.initEngine(CFMLEngineFactory.java:363)
at lucee.loader.engine.CFMLEngineFactory.initEngineIfNecessary(CFMLEngineFactory.java:262)
at lucee.loader.engine.CFMLEngineFactory.getInstance(CFMLEngineFactory.java:168)
at lucee.runtime.script.BaseScriptEngineFactory.(BaseScriptEngineFactory.java:59)
at lucee.runtime.script.LuceeScriptEngineFactory.(LuceeScriptEngineFactory.java:27)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at java.util.ServiceLoader$LazyIterator.nextService(Unknown Source)
at java.util.ServiceLoader$LazyIterator.next(Unknown Source)
at java.util.ServiceLoader$1.next(Unknown Source)
at javax.script.ScriptEngineManager.initEngines(Unknown Source)
at javax.script.ScriptEngineManager.init(Unknown Source)
at javax.script.ScriptEngineManager.(Unknown Source)
at cliloader.LoaderCLIMain.execute(LoaderCLIMain.java:303)
at cliloader.LoaderCLIMain.execute(LoaderCLIMain.java:153)
at cliloader.LoaderCLIMain.main(LoaderCLIMain.java:552)
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(Unknown Source)
at java.util.zip.ZipFile.(Unknown Source)
at java.util.jar.JarFile.(Unknown Source)
at java.util.jar.JarFile.(Unknown Source)
at lucee.loader.osgi.BundleLoader.loadBundleInfo(BundleLoader.java:192)
at lucee.loader.osgi.BundleLoader.loadAvailableBundles(BundleLoader.java:182)
at lucee.loader.osgi.BundleLoader.loadBundles(BundleLoader.java:118)
at lucee.loader.engine.CFMLEngineFactory.initEngine(CFMLEngineFactory.java:363)
at lucee.loader.engine.CFMLEngineFactory.initEngineIfNecessary(CFMLEngineFactory.java:262)
at lucee.loader.engine.CFMLEngineFactory.getInstance(CFMLEngineFactory.java:168)
at lucee.runtime.script.BaseScriptEngineFactory.(BaseScriptEngineFactory.java:59)
at lucee.runtime.script.LuceeScriptEngineFactory.(LuceeScriptEngineFactory.java:27)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at java.util.ServiceLoader$LazyIterator.nextService(Unknown Source)
at java.util.ServiceLoader$LazyIterator.next(Unknown Source)
at java.util.ServiceLoader$1.next(Unknown Source)
at javax.script.ScriptEngineManager.initEngines(Unknown Source)
at javax.script.ScriptEngineManager.init(Unknown Source)
at javax.script.ScriptEngineManager.(Unknown Source)
at cliloader.LoaderCLIMain.execute(LoaderCLIMain.java:303)
at cliloader.LoaderCLIMain.execute(LoaderCLIMain.java:153)
at cliloader.LoaderCLIMain.main(LoaderCLIMain.java:552)


/ / ____ ___ ____ ___ ____ _____ / / __ ) _ __
/ / / __ / __ __ \/ __
_ / __ `/ __ / __ / __ / __ | |//
/ /
/ // / / / / / / / / / / / // / / / / // / // / // /> <
_
/_// // /// // //_,// //_,/__/_//|_| ® v5.1.1+00191

No ASCII Art was harmed in the making of this CLI

Welcome to CommandBox!

It seems to work after the error, but seeing the error every time is a little unnerving. Any ideas what could be happening and how I might solve it?

Thanks,
Steve Durette

My guess is you have an antivirus software that is corrupting or blocking one of the OSGI bundle jars that Lucee is trying to load. Of course, the error doesn’t tell us which one, so it’s hard to say. You could check the Lucee bundles folder in your CommandBox home and see if any of them look invalid or 0k or something. The bundled folder is located here

C:\Users\you.CommandBox\engine\cfml\cli\lucee-server\bundles

Not much CommandBox itself can do about this. The actual error is coming from the JDK which is called by Lucee which is bundled by CommandBox.

In fact, there’s the line of the Lucee source code that’s failing:
https://github.com/lucee/Lucee/blob/5.3.6/loader/src/main/java/lucee/loader/osgi/BundleLoader.java#L192

You can see, it’s just:

JarFile jf = new JarFile(jar);

The jar file is either corrupt or being blocked at the file system. If you really care to find out the issue, you could compile a custom lucee.jar where you add in some debugging code that logs the path to the jar file in question before it’s loaded. Then at least you’d know which jar is having the issue. All you’d need would be to System.println( jars[i].toString() ) right here
https://github.com/lucee/Lucee/blob/5.3.6/loader/src/main/java/lucee/loader/osgi/BundleLoader.java#L185

Let me know if you want me to make a jar for you to try with this debugging code in it.

I just submitted a ticket and pull request to Lucee to improve the terrible error logging around this error.

https://luceeserver.atlassian.net/browse/LDEV-3096

https://github.com/lucee/Lucee/pull/1059