Exactly! It's a classpath problem, liquibase uses a weird approach to swap his crappy log system to use slf4j, it scans a classpath and "swaps" the reference. When you install liquibase and liquibase-slf4j as separated bundles, the liquibase bundle does not look for the liquibase-slf4j exported packages, and when you make the liquibase-slf4j a fragment of liquibase, the liquibase bundle can scan the liquibase-slf4j classpath.
This happens quite a lot when you work with libraries that works with classpaths and weren't created with osgi in mind, a pain in the a** if you ask me. Em sex, 26 de mai de 2017 às 16:49, Steinar Bang [via Karaf] < [email protected]> escreveu: > >>>>> Castor <[hidden email] > <http:///user/SendEmail.jtp?type=node&node=4050472&i=0>>: > > > Hello Steinar! I'm using liquibase in karaf for some time, and to fix > that > > you need to repackage the liquibase-slf4j for it to be a fragment of the > > liquibase bundle. Here's how: > > > https://gist.github.com/YgorCastor/44fb3a13520d28aa328c4975f8bf5e8c > [snip!] > > Right! Thanks! Fragments have always been a mystery to me...:-) > Any idea why thi will work and the more regular OSGi ways don't work? > Something to do with classloaders...? > > > You can also do the same thing using the wrap protocol, without the need > to > > repackage liquibase-slf4j, but i remember i had some problems with that, > i > > don't recall what happened. > > I've tried using the wrap protocol in karaf with the existing > liquibase-slf4j maven dependency but that didn't work. > > And what I have now is similar: I've subclassed AbstractLogger in a > class residing in package liquibase.ext.logging. > > This works in the unit tests, but not in an OSGi context. > > The bundle exports the liquibase.ext.logging > > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://karaf.922171.n3.nabble.com/Experiences-with-karaf-and-liquibase-tp4050470p4050472.html > To unsubscribe from Experiences with karaf and liquibase?, click here > <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4050470&code=eWdvcmNhc3RvckBnbWFpbC5jb218NDA1MDQ3MHwtMzgxNTQ3NDAw> > . > NAML > <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- View this message in context: http://karaf.922171.n3.nabble.com/Experiences-with-karaf-and-liquibase-tp4050470p4050473.html Sent from the Karaf - User mailing list archive at Nabble.com.
