[ERROR] Cannot build ServiceLocator

Hi

We started facing this issue recently:

[ERROR] Cannot build ServiceLocator 20:11:49 liquibase.exception.UnexpectedLiquibaseException: java.io.FileNotFoundException: /dev/shm/Log4jHotPatch.jar (No such file or directory) 20:11:49 at liquibase.servicelocator.ServiceLocator.setResourceAccessor(ServiceLocator.java:129) 20:11:49 at liquibase.servicelocator.ServiceLocator.(ServiceLocator.java:59) 20:11:49 at liquibase.servicelocator.ServiceLocator.(ServiceLocator.java:43) 20:11:49 at liquibase.database.DatabaseFactory.(DatabaseFactory.java:28) 20:11:49 at liquibase.database.DatabaseFactory.getInstance(DatabaseFactory.java:46) 20:11:49 at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:97) 20:11:49 at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:67) 20:11:49 at org.liquibase.maven.plugins.AbstractLiquibaseMojo.execute(AbstractLiquibaseMojo.java:316) 20:11:49 at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) 20:11:49 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) 20:11:49 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) 20:11:49 at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) 20:11:49 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) 20:11:49 at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) 20:11:49 at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) 20:11:49 at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) 20:11:49 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) 20:11:49 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) 20:11:49 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) 20:11:49 at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) 20:11:49 at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) 20:11:49 at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) 20:11:49 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 20:11:49 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 20:11:49 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 20:11:49 at java.lang.reflect.Method.invoke(Method.java:498) 20:11:49 at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) 20:11:49 at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) 20:11:49 at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) 20:11:49 at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) 20:11:49 Caused by: java.io.FileNotFoundException: /dev/shm/Log4jHotPatch.jar (No such file or directory) 20:11:49 at java.util.zip.ZipFile.open(Native Method) 20:11:49 at java.util.zip.ZipFile.(ZipFile.java:225) 20:11:49 at java.util.zip.ZipFile.(ZipFile.java:155) 20:11:49 at java.util.jar.JarFile.(JarFile.java:166) 20:11:49 at java.util.jar.JarFile.(JarFile.java:103) 20:11:49 at sun.net.www.protocol.jar.URLJarFile.(URLJarFile.java:93) 20:11:49 at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:69) 20:11:49 at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:99) 20:11:49 at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122) 20:11:49 at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:152) 20:11:49 at liquibase.resource.ClassLoaderResourceAccessor.getResourcesAsStream(ClassLoaderResourceAccessor.java:53) 20:11:49 at liquibase.servicelocator.ServiceLocator.setResourceAccessor(ServiceLocator.java:115) 20:11:49 … 29 more

Anything changed ?

Nothing on our side. It looks like liquibase is looking for a /dev/shm/Log4jHotPatch.jar file which is not something we ship or use. Liquibase doesn’t use log4j so we didn’t have do anything for that.

Is that a file you are including in your classpath setting somewhere but doesn’t actually exist or is set with the wrong path?

Nathan

Thanks, Nathan. It was an AWS EC2 instance issue. They have enabled the security patch for all instances which was interfering.
We disabled the patch and now it is working perfectly.

Thanks