Could not find implementation of liquibase.logging.Logger

Description

Now get the following exception when runnign under spring-boot:

Caused by: liquibase.exception.ServiceNotFoundException: liquibase.exception.ServiceNotFoundException: Could not find implementation of liquibase.logging.Logger
at liquibase.servicelocator.ServiceLocator.newInstance(ServiceLocator.java:192)
at liquibase.logging.LogFactory.getLog(LogFactory.java:44)
... 37 common frames omitted
Caused by: liquibase.exception.ServiceNotFoundException: Could not find implementation of liquibase.logging.Logger
at liquibase.servicelocator.ServiceLocator.findClass(ServiceLocator.java:158)
at liquibase.servicelocator.ServiceLocator.newInstance(ServiceLocator.java:190)
... 38 common frames omitted

Environment

Java 8, Spring-Boot 1.1.4.RELEASE

Activity

Show:
Francisco Alejandro Lozano López
September 11, 2014, 4:51 PM

I suspect it may have something to see with:

this resourceAccessor.toClassLoader() in the spring integration is:

I'm using Spring 4.0.7.RELEASE, Java 1.8.0_20 and Tomcat 8.0.9.

Francisco Alejandro Lozano López
September 11, 2014, 5:23 PM

Same WAR file but with Tomcat 7.0.54 seems to work well.

Francisco Alejandro Lozano López
September 17, 2014, 5:36 PM

issue still happens with Java 8, Spring 4.1.0, Tomcat 8.0.12

Nathan Voxland
September 23, 2014, 4:21 PM

Fixed with

Jelte van der Hoek
April 2, 2015, 8:58 AM

I'm not sure this is fixed properly in liquibase 3.3.2.
It all depends on whether the tomcat server is set to unpackWARs. If unpackWAR is set to true, things work fine but if wars are not unpacked tomcat will classload from the warfile itself rather than the file system.

Inside DefaultPackageScanClassResolver this gives urlPaths like:

{{war:file:/path/to/the/warfile.war^/WEB-INF/lib/liquibase-core-3.3.2.jar!/liquibase/logging/
}}
which are not handled by the class resolver causing nothing to be found.

This then results in a very early:

{{
Caused by: liquibase.exception.ServiceNotFoundException: liquibase.exception.ServiceNotFoundException: liquibase.exception.ServiceNotFoundException: Could not find implementation of liquibase.logging.Logger
at liquibase.logging.LogFactory.getLog(LogFactory.java:46)
at liquibase.logging.LogFactory.getLogger(LogFactory.java:37)
at liquibase.integration.spring.SpringLiquibase.<init>(SpringLiquibase.java:142)
}}

(Also because the SpringLiquibase bean instantiates a logger in a field initialiser, whereas most of the other loggers are only instantiated when something goes wrong)

Reporter

Jason Shattu

Components

Fix versions

Affects versions

Priority

Blocker
Configure