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,
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
I run liquibase from code with something like (Scala):
val database = DatabaseFactory.getInstance.findCorrectDatabaseImplementation(new JdbcConnection(dbConnection))
val classLoader = classOf[SchemaMigration].getClassLoader
val resourceAccessor = new ClassLoaderResourceAccessor(classLoader)
val liquibase = new Liquibase(diffFilePath, resourceAccessor, database)
…
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).
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.
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.
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)