Could not find implementation of liquibase.logging.Logger

Hello,

i’m having problems running liquibase (2.0.5) inside websphere ce 3
Liquibase is wrapt inside an @Singleton @Startup EJB and liquibase is called inside the @PostConstruct Method

With the Thread.currentThread().getContextClassLoader() classloader, and a JdbcConnection optained by an injected @Resource DataSource datasource. [datasource.getConnection()]

This works fine in JBoss6/7 and Weblogic 12c.

But with websphere ce 3 i’m getting following stacktrace,

  1. Caused by: de.company.core.exception.LiquibaseUpdateException[_Pzc3MFsYEe6LG6biO6Txsw]: Unable to update/verifiy database
            at de.company.core.persistence.LiquibaseUpdateBean.update(LiquibaseUpdateBean.java:145)
            at de.company.cmsservice.logic.CmsServiceStartupBean.startup(CmsServiceStartupBean.java:36)
            … 58 more
    Caused by: liquibase.exception.ServiceNotFoundException: liquibase.exception.ServiceNotFoundException: liquibase.exception.ServiceNotFoundException: Could not find implementation of liquibase.logging.Logger
            at liquibase.logging.LogFactory.getLogger(LogFactory.java:19)
            at liquibase.logging.LogFactory.getLogger(LogFactory.java:30)
            at liquibase.database.DatabaseFactory.findCorrectDatabaseImplementation(DatabaseFactory.java:67)
            at de.company.core.persistence.LiquibaseUpdateBean.doUpdate(LiquibaseUpdateBean.java:100)
            at de.company.core.persistence.LiquibaseUpdateBean.update(LiquibaseUpdateBean.java:137)
            … 59 more
    Caused by: liquibase.exception.ServiceNotFoundException: liquibase.exception.ServiceNotFoundException: Could not find implementation of liquibase.logging.Logger
            at liquibase.servicelocator.ServiceLocator.newInstance(ServiceLocator.java:179)
            at liquibase.logging.LogFactory.getLogger(LogFactory.java:17)
            … 63 more
    Caused by: liquibase.exception.ServiceNotFoundException: Could not find implementation of liquibase.logging.Logger
            at liquibase.servicelocator.ServiceLocator.findClass(ServiceLocator.java:145)
            at liquibase.servicelocator.ServiceLocator.newInstance(ServiceLocator.java:177)
            … 64 more


so it might be related to https://liquibase.jira.com/browse/CORE-789

any hints where i could find the error in my setup would be a appreciated.

regards,
frank

I’m having exactly the same problem.

I run liquibase from code with something like (Scala):

  1. val database = DatabaseFactory.getInstance.findCorrectDatabaseImplementation(new JdbcConnection(dbConnection))
  2.     val classLoader = classOf[SchemaMigration].getClassLoader
  3.     val resourceAccessor = new ClassLoaderResourceAccessor(classLoader)
  4.     val liquibase = new Liquibase(diffFilePath, resourceAccessor, database)

  5. liquibase.update(null)

It works fine in Jetty and Tomcat, but when I run it in a standalone app it fails with the same exception as above. I have Scala applications that use Liquibase and they have loggers available and working fine (logback, slf4j).

Not sure what to do.

Maybe there are better ways to run Liquibase from code? I didn’t find any higher level APIs.

I tried with 2.0.5 and 3.0.5 Liquibase versions

That should be the best way to call liquibase through the java APIs. Could you post the stacktrace you are seeing with 3.0.5? 


Nathan

Hi Nathan, thanks for looking into it. Here is the stacktrace:

liquibase.exception.ServiceNotFoundException: liquibase.exception.ServiceNotFoundException: liquibase.exception.ServiceNotFoundException: Could not find implementation of liquibase.logging.Logger
    at liquibase.logging.LogFactory.getLogger(LogFactory.java:19)
    at liquibase.logging.LogFactory.getLogger(LogFactory.java:30)
    at liquibase.database.DatabaseFactory.findCorrectDatabaseImplementation(DatabaseFactory.java:71)
    at com.mycompany.db.migration.SchemaMigration.createLiquibase(SchemaMigration.scala:27)
    at com.mycompany.db.migration.SchemaMigration.updateDb(SchemaMigration.scala:35)
    at com.mycompany.db.migration.SchemaMigration.run(SchemaMigration.scala:55)
    at com.mycompany.server.JobServerRunner.init(JobServerRunner.scala:49)
    at com.mycompany.server.JobServerRunner$.startup(JobServerRunner.scala:67)
    at com.mycompany.server.JobServerRunner$.main(JobServerRunner.scala:79)
    at com.mycompany.server.JobServerRunner.main(JobServerRunner.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.simontuffs.onejar.Boot.run(Boot.java:340)
    at com.simontuffs.onejar.Boot.main(Boot.java:166)
Caused by: liquibase.exception.ServiceNotFoundException: liquibase.exception.ServiceNotFoundException: Could not find implementation of liquibase.logging.Logger
    at liquibase.servicelocator.ServiceLocator.newInstance(ServiceLocator.java:188)
    at liquibase.logging.LogFactory.getLogger(LogFactory.java:17)
    … 15 more
Caused by: liquibase.exception.ServiceNotFoundException: Could not find implementation of liquibase.logging.Logger
    at liquibase.servicelocator.ServiceLocator.findClass(ServiceLocator.java:154)
    at liquibase.servicelocator.ServiceLocator.newInstance(ServiceLocator.java:186)
    … 16 more

So this is a regular jar file (packaged with one-jar). Please let me know if I can do any tests to help clarify this issue.

Thanks

Nathan,

if it helps, I can create a small project (Scala/jar) that reproduces this issue and put it on github for you to look at. Let me know if that could be useful to you.

Thanks

It is still working fine for me. If you could create a jar that reproduces it that would be great. You can put it on github, attach it here or email it to me (nathan.voxland@liquibase.org)


Thanks,

Nathan

Thanks, Nathan

Will make a jar tomorrow