1

I am currently working on a Java8 WebApp with Hibernate and Vaadin and Liquibase as a dependency which I tried to run on Azure for testing.
I didn't write this app myself and the version that was given to me was originally using Liquibase 3.0.7 and apparently running on a Tomcat 8.0.28

I updated this to 3.7.0 (see bottom for specific reasons why) and now get the following error:

liquibase.exception.UnexpectedLiquibaseException: Cannot find LockService for unsupported
    liquibase.lockservice.LockServiceFactory.getLockService(LockServiceFactory.java:74)
    liquibase.Liquibase.update(Liquibase.java:183)
    liquibase.Liquibase.update(Liquibase.java:179)
    liquibase.Liquibase.update(Liquibase.java:175)
    liquibase.Liquibase.update(Liquibase.java:168)
    com.app.test.AppServlet.initDB(AppServlet.java:86)
    com.app.test.AppServlet.servletInitialized(AppServlet.java:44)
    com.vaadin.server.VaadinServlet.init(VaadinServlet.java:217)
    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
    org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:660)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
    org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798)
    org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:808)
    org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
    org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    java.lang.Thread.run(Thread.java:748)


I am testing locally with a tomcat 8.5.47 and a Tomcat 7 as well as the tomcat7 maven plugin that allows me to run the app with maven and see all the logging in the console. I am trying to deploy the .war to a Tomcat 8.5 on Azure.
So I got the following Servers:

Tomcat 8.5.47 (local)
Tomcat 7.0.96 (local)
Tomcat 7.x (Maven Plugin)
Tomcat 8.5.41 (Azure)

The above problem occurs only on Azure
All the local Servers seem to work (I did not go too deep into testing though, but at least they render the front-page).

The database is a MariaDB also running on Azure and all of the configuration for the connection is made in the code via hibernate config or in the jdbc connection string, so all the servers run the same code and connect to the exact same db.

I already tried the latest Version 3.8.0 but have the same problem there so I got back to 3.7.0

How can I fix this error?

Update:
I found more errors in the server log after activating verbose logging:

2019-10-23T13:30:58.611225727Z Caused by: liquibase.exception.ServiceNotFoundException: liquibase.exception.ServiceNotFoundException: Could not find unique implementation of liquibase.executor.Executor.  Found 0 implementations
2019-10-23T13:30:58.611235727Z     at liquibase.servicelocator.ServiceLocator.newInstance(ServiceLocator.java:216) ~[liquibase-core-3.7.0.jar:na]
2019-10-23T13:30:58.611246427Z     at liquibase.executor.ExecutorService.lambda$getExecutor$0(ExecutorService.java:26) ~[liquibase-core-3.7.0.jar:na]
2019-10-23T13:30:58.611256327Z     ... 31 common frames omitted
2019-10-23T13:30:58.611265628Z Caused by: liquibase.exception.ServiceNotFoundException: Could not find unique implementation of liquibase.executor.Executor.  Found 0 implementations
2019-10-23T13:30:58.611275428Z     at liquibase.servicelocator.ServiceLocator.findClass(ServiceLocator.java:188) ~[liquibase-core-3.7.0.jar:na]
2019-10-23T13:30:58.611285028Z     at liquibase.servicelocator.ServiceLocator.newInstance(ServiceLocator.java:214) ~[liquibase-core-3.7.0.jar:na]
2019-10-23T13:30:58.611294328Z     ... 32 common frames omitted

and

2019-10-24T08:59:39.545505776Z 24.10.2019 08:59:39.483 INFO  com.app.test.AppServlet - servletInitialized
2019-10-24T08:59:39.546076490Z 24.10.2019 08:59:39.492 INFO  com.app.test.AppServlet - initDB
2019-10-24T08:59:40.130035108Z 24.10.2019 08:59:40.129 WARN  liquibase.database.DatabaseFactory - Unknown database: MySQL
2019-10-24T08:59:40.162920831Z 24.10.2019 08:59:40.162 INFO  l.database.core.UnsupportedDatabase - Error getting default schema
2019-10-24T08:59:40.162974433Z liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.ServiceNotFoundException: liquibase.exception.ServiceNotFoundException: Could not find
 unique implementation of liquibase.executor.Executor.  Found 0 implementations


More Background
Azure only allows me to create App Services with Tomcat 8.5 or 9 and the App in it's original state would not work on both of the Tomcat 8.5 servers. I received an error: Could not find implementation of liquibase.logging.Logger
Updating Liquibase to 3.2.3 (because that's where the error should've been fixed) fixed this for all of my local machines, but I still received it on Azure.
After updating to 3.7.0 I do not receive the could not find implementation.. error anymore but now receive the error above as well as a problem with my xml scheme which doesn't seem to crash the app though and doesn't seem to be related:

Caused by: org.xml.sax.SAXParseException: s4s-elt-schema-ns: Namespace des Elements 'databaseChangeLog' muss aus dem Schema-Namespace 'http://www.w3.org/2001/XMLSchema' stammen.
Chaz
  • 672
  • 1
  • 5
  • 19
  • When you say, "all the servers run the same code and connect to the exact same db", is this the same as in schema and data wise, or do you mean the same logical instance on the same server? You mentioned your "local" servers working. If the connection string is referencing an on-premise instance of MariaDB, does it actually have connectivity to the instance? – Architect Jamie Oct 23 '19 at 13:11
  • It's the same db-server and the same db on that server. I do not know exactly how Azure handles the db services but I assume it's the same instance. I also assume that all of the servers have connectivity to the instance but for the Azure instance I can't tell for sure because the error happens directly on the DB init because that's where the Liquibase gets invoked. – Chaz Oct 23 '19 at 13:29
  • I actually don't think its related to the database connection itself. Liquibase uses a plugin system to find logic implementations, even for logic that ships with Liquibase. The StandardLockService class will say it works for any database, but the error is saying even it is not being found. Is there a difference in HOW the app is being deployed on Azure? Like as a war vs. a fat-jar or exploded directory etc? – Nathan Voxland Oct 23 '19 at 13:33
  • The app is being deployed as a .war but I I tested it the same way on my local tomcat servers and I think the embedded maven plugin also uses the .war The only difference I can think of right now is maybe the Java runtime? Its a Java 8 but I don't know any details about how MS implements this in their App Service, I think its just a docker container. – Chaz Oct 23 '19 at 13:38
  • They are pretty much. The runtimes come from Zulu OpenJDK developed and maintained by Azul and Microsoft. – Architect Jamie Oct 23 '19 at 17:10
  • Are you getting any liquibase-package logs in your log file? Especially debug-level ones? You may need to modify your logging system's loglevel for them to show correctly. If you are not comfortable posting them here, you can email them to be at nathan@liquibase.org. I'm mainly looking to see how the classloading system is looking for the LockService implementations. – Nathan Voxland Oct 23 '19 at 18:56
  • I am seeing a few more errors in the log files, I posted those as an update above. Unfortunately I don't see any debug messages, and I am not sure how to increase the logging level. Do I have to do that in the tomcat server config somewhere or in my Java Code? – Chaz Oct 24 '19 at 09:03
  • I found more on the server and added it to the post, still no debug messages though – Chaz Oct 24 '19 at 09:14
  • Thanks. The "Could not find unique implementation of liquibase.executor.Executor. Found 0 implementations" error is definitely pointing to it being a problem with how the classloader and/or deployment is set up vs. a database issue. Unfortunately, there is some DEBUG level messages that would help us understand more why it is not but it looks like the logs are only coming through at INFO level. Are you able to increase your log config a bit? – Nathan Voxland Oct 25 '19 at 19:22

0 Answers0