ServiceLocator fails to find liquibase.logging.Logger implementation when launched via Java Web Start offline

Description

In my app I launch Liquibase update via a Spring bean embedded in my app. The app is deployed via Java Web Start. Liquibase seems to try to download its jar file tens of time while launching the app. The app has already been downloaded over the net and it's in the JWS cache. Still liquibase tries to download its jar again. This happens only to liquibase jar (liquibase-core-2.0.1.jar). My app depends on 10+ other jars and none of them causes symptoms like the above.

This is what Java Console shows while launching my app:

network: Connecting http://94.23.238.67:8181/ruch/lib/liquibase-core-2.0.1.jar with proxy=DIRECT network: Connecting socket://94.23.238.67:8181 with proxy=DIRECT network: Connecting http://94.23.238.67:8181/ruch/lib/liquibase-core-2.0.1.jar with proxy=DIRECT network: Connecting socket://94.23.238.67:8181 with proxy=DIRECT network: Connecting http://94.23.238.67:8181/ruch/lib/liquibase-core-2.0.1.jar with proxy=DIRECT network: Connecting socket://94.23.238.67:8181 with proxy=DIRECT network: Connecting http://94.23.238.67:8181/ruch/lib/liquibase-core-2.0.1.jar with proxy=DIRECT network: Connecting socket://94.23.238.67:8181 with proxy=DIRECT security: JAVAWS AppPolicy Permission requested for: http://94.23.238.67:8181/ruch/lib/commons-betwixt-0.8.jar security: Istrusted: http://94.23.238.67:8181/ruch/RuchSFA.jnlp true security: JAVAWS AppPolicy Permission requested for: http://94.23.238.67:8181/ruch/lib/commons-digester-1.7.jar security: Istrusted: http://94.23.238.67:8181/ruch/RuchSFA.jnlp true network: Connecting http://94.23.238.67:8181/ruch/lib/liquibase-core-2.0.1.jar with proxy=DIRECT network: Connecting socket://94.23.238.67:8181 with proxy=DIRECT network: Connecting http://94.23.238.67:8181/ruch/lib/liquibase-core-2.0.1.jar with proxy=DIRECT network: Connecting socket://94.23.238.67:8181 with proxy=DIRECT network: Connecting http://94.23.238.67:8181/ruch/lib/liquibase-core-2.0.1.jar with proxy=DIRECT network: Connecting socket://94.23.238.67:8181 with proxy=DIRECT

Also if the app is launched with no network connectivity (offline mode) the liquibase spring beans fails to inititialize because it's unable to find implmenentation of liquibase.logging.Logger.

13:51:38.299 [AWT-EventQueue-0] ERROR p.o.ruch.terminal.TerminalSFA - Initialization Error java.util.concurrent.ExecutionException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [app-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [liquibase.integration.spring.SpringLiquibase]: Constructor threw exception; nested exception is liquibase.exception.ServiceNotFoundException: liquibase.exception.ServiceNotFoundException: liquibase.exception.ServiceNotFoundException: Could not find implementation of liquibase.logging.Logger at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source) [na:1.6.0_26] at java.util.concurrent.FutureTask.get(Unknown Source) [na:1.6.0_26] at javax.swing.SwingWorker.get(Unknown Source) [na:1.6.0_26] at pl.outofmemory.ruch.terminal.TerminalSFA$2.done(TerminalSFA.java:255) [ruch-terminal-sfa.jar:1.0-beta9] at javax.swing.SwingWorker$5.run(Unknown Source) [na:1.6.0_26] at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(Unknown Source) [na:1.6.0_26] at sun.swing.AccumulativeRunnable.run(Unknown Source) [na:1.6.0_26] at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(Unknown Source) [na:1.6.0_26] at javax.swing.Timer.fireActionPerformed(Unknown Source) [na:1.6.0_26] at javax.swing.Timer$DoPostEvent.run(Unknown Source) [na:1.6.0_26] at java.awt.event.InvocationEvent.dispatch(Unknown Source) [na:1.6.0_26] at java.awt.EventQueue.dispatchEventImpl(Unknown Source) [na:1.6.0_26] at java.awt.EventQueue.access$000(Unknown Source) [na:1.6.0_26] at java.awt.EventQueue$1.run(Unknown Source) [na:1.6.0_26] at java.awt.EventQueue$1.run(Unknown Source) [na:1.6.0_26] at java.security.AccessController.doPrivileged(Native Method) [na:1.6.0_26] at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source) [na:1.6.0_26] at java.awt.EventQueue.dispatchEvent(Unknown Source) [na:1.6.0_26] at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) [na:1.6.0_26] at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) [na:1.6.0_26] at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) [na:1.6.0_26] at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [na:1.6.0_26] at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [na:1.6.0_26] at java.awt.EventDispatchThread.run(Unknown Source) [na:1.6.0_26] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [app-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [liquibase.integration.spring.SpringLiquibase]: Constructor threw exception; nested exception is liquibase.exception.ServiceNotFoundException: liquibase.exception.ServiceNotFoundException: liquibase.exception.ServiceNotFoundException: Could not find implementation of liquibase.logging.Logger at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:965) [spring-beans-3.0.4.RELEASE.jar:3.0.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911) [spring-beans-3.0.4.RELEASE.jar:3.0.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485) [spring-beans-3.0.4.RELEASE.jar:3.0.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) [spring-beans-3.0.4.RELEASE.jar:3.0.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) [spring-beans-3.0.4.RELEASE.jar:3.0.4.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) [spring-beans-3.0.4.RELEASE.jar:3.0.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288) [spring-beans-3.0.4.RELEASE.jar:3.0.4.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190) [spring-beans-3.0.4.RELEASE.jar:3.0.4.RELEASE] at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1075) [spring-context-3.0.4.RELEASE.jar:3.0.4.RELEASE] at pl.outofmemory.ruch.terminal.TerminalSFA$2.doInBackground(TerminalSFA.java:127) [ruch-terminal-sfa.jar:1.0-beta9] at pl.outofmemory.ruch.terminal.TerminalSFA$2.doInBackground(TerminalSFA.java:109) [ruch-terminal-sfa.jar:1.0-beta9] at javax.swing.SwingWorker$1.call(Unknown Source) [na:1.6.0_26] at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) [na:1.6.0_26] at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.6.0_26] at javax.swing.SwingWorker.run(Unknown Source) [na:1.6.0_26] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [na:1.6.0_26] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.6.0_26] at java.lang.Thread.run(Unknown Source) [na:1.6.0_26] Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [liquibase.integration.spring.SpringLiquibase]: Constructor threw exception; nested exception is liquibase.exception.ServiceNotFoundException: liquibase.exception.ServiceNotFoundException: liquibase.exception.ServiceNotFoundException: Could not find implementation of liquibase.logging.Logger at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:141) [spring-beans-3.0.4.RELEASE.jar:3.0.4.RELEASE] at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:74) [spring-beans-3.0.4.RELEASE.jar:3.0.4.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$3.run(AbstractAutowireCapableBeanFactory.java:953) [spring-beans-3.0.4.RELEASE.jar:3.0.4.RELEASE] at java.security.AccessController.doPrivileged(Native Method) [na:1.6.0_26] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:951) [spring-beans-3.0.4.RELEASE.jar:3.0.4.RELEASE] ... 17 common frames omitted 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) [liquibase-core-2.0.1.jar:na] at liquibase.integration.spring.SpringLiquibase.<init>(SpringLiquibase.java:126) [liquibase-core-2.0.1.jar:na] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [na:1.6.0_26] at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) [na:1.6.0_26] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) [na:1.6.0_26] at java.lang.reflect.Constructor.newInstance(Unknown Source) [na:1.6.0_26] at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126) [spring-beans-3.0.4.RELEASE.jar:3.0.4.RELEASE] ... 21 common frames omitted Caused by: liquibase.exception.ServiceNotFoundException: liquibase.exception.ServiceNotFoundException: Could not find implementation of liquibase.logging.Logger at liquibase.servicelocator.ServiceLocator.newInstance(ServiceLocator.java:160) [liquibase-core-2.0.1.jar:na] at liquibase.logging.LogFactory.getLogger(LogFactory.java:17) [liquibase-core-2.0.1.jar:na] ... 27 common frames omitted Caused by: liquibase.exception.ServiceNotFoundException: Could not find implementation of liquibase.logging.Logger at liquibase.servicelocator.ServiceLocator.findClass(ServiceLocator.java:126) [liquibase-core-2.0.1.jar:na] at liquibase.servicelocator.ServiceLocator.newInstance(ServiceLocator.java:158) [liquibase-core-2.0.1.jar:na] ... 28 common frames omitted

I guess it's the same problem as mine: http://forum.liquibase.org/topic/servicelocator-and-java-web-start

Environment

java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)

Activity

Show:

RobertR October 8, 2012 at 9:35 AM

Something similar happens when running 2.0.5 in a Tomcat 7 OSGi environment:

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.integration.servlet.LiquibaseServletListener.contextInitialized(LiquibaseServletListener.java:73)

Nathan Voxland September 11, 2011 at 6:03 AM

Will take some good debugging to integrate the referenced code, and I don't have a good environment at this point

Nathan Voxland September 8, 2011 at 4:31 PM

I'll look at that. Thanks

Marcin palka September 7, 2011 at 7:50 PM
Edited

The best would if ServiceLocator(or actually it's ClassLoader) looked for jars in local JWS cache first before requesting for them over network.

This may be useful:
http://www.objectdefinitions.com/odblog/2008/workaround-for-bug-id-6753651-find-path-to-jar-in-cache-under-webstart/

Details

Reporter

Affects versions

Priority

Created September 7, 2011 at 1:54 PM
Updated February 27, 2013 at 5:57 AM

Flag notifications