[opencms-dev] Small problem when calling the cmsshell - difficult to nail down error - jdk.internal.util.jar.InvalidJarIndexError: Invalid index

Jan Michael Greiner jan0michael at yahoo.com
Mon Dec 6 16:41:35 CET 2021


Hello,


somehow I "managed" to make my OpenCms main/admin site not to work any more.

When starting the cmsshell, I get the following errors:

root at tomcat:/etc/tomcat9# TOMCAT_HOME=/usr/share/tomcat9 /var/www/opencms/WEB-INF/cmsshell.sh
OpenCms WEB-INF path:  "/var/www/opencms/WEB-INF".
OpenCms property file: "/var/www/opencms/WEB-INF/config/opencms.properties".

jdk.internal.util.jar.InvalidJarIndexError: Invalid index
        at java.base/jdk.internal.loader.URLClassPath$JarLoader.getResource(URLClassPath.java:1025)
        at java.base/jdk.internal.loader.URLClassPath$JarLoader.getResource(URLClassPath.java:937)
        at java.base/jdk.internal.loader.URLClassPath.getResource(URLClassPath.java:314)
        at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:695)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
        at org.opencms.main.OpenCmsCore.initConfiguration(OpenCmsCore.java:1774)
        at org.opencms.main.OpenCmsCore.upgradeRunlevel(OpenCmsCore.java:2507)
        at org.opencms.main.CmsShell.<init>(CmsShell.java:569)
        at org.opencms.main.CmsShell.main(CmsShell.java:676)

Exception in thread "main" java.lang.NullPointerException
        at java.base/java.lang.Throwable.printStackTrace(Throwable.java:657)
        at java.base/java.lang.Throwable.printStackTrace(Throwable.java:648)
        at org.opencms.main.CmsShell.execute(CmsShell.java:826)
        at org.opencms.main.CmsShell.execute(CmsShell.java:741)
        at org.opencms.main.CmsShell.main(CmsShell.java:686)



The second exeception comes up, when I press enter after the first exception is displayed.
Unfortunately OpenCmsCore.initConfiguration is quite a lengthy method, so I am not sure, where exactly to search for the error.


I tried to search, what could be the problem by looking at the source code:
https://github.com/alkacon/opencms-core/blob/master/src/org/opencms/main/OpenCmsCore.java

I also looked in branch_12_0_x and build_12_0_0, but did not find out what exacly happens in line 1774.

I suggest split method initConfiguration in smaller sub-methods.


Best regards, and thank you for OpenCms!

Jan Michael Greiner


More information about the opencms-dev mailing list