Hi there.
I've app project on spring-boot generated by JHipster along with Liquibase 3.4.2. Application works fine if launched by java -jar command but fails to start on tomcat server.
Stacktrace (full in attachment):
I've app project on spring-boot generated by JHipster along with Liquibase 3.4.2. Application works fine if launched by java -jar command but fails to start on tomcat server.
Stacktrace (full in attachment):
- SEVERE 10.08.16 17:46: liquibase: Cannot build ServiceLocator
java.lang.NullPointerException
at liquibase.resource.AbstractResourceAccessor.addRootPath(AbstractResourceAccessor.java:46)
at liquibase.resource.AbstractResourceAccessor.init(AbstractResourceAccessor.java:33)
at liquibase.resource.ClassLoaderResourceAccessor.<init>(ClassLoaderResourceAccessor.java:21)
at liquibase.servicelocator.ServiceLocator.<init>(ServiceLocator.java:49)
at liquibase.servicelocator.ServiceLocator.<clinit>(ServiceLocator.java:33)
After some investigation I've found this code in AbstractResourceAccessor:
- baseUrls = classLoader.getResources("");
Classloader instance provided by org.apache.catalina.loader.WebappClassLoader. It returns some enumeration with null in the end. So when liquibase execute further code:
- protected void addRootPath(URL path) {
String externalForm = path.toExternalForm();
It fails with null pointer exception. How it's even possible? It's fault of tomcat, liquibase or my config? Please help to resolve this sutiation.