在Google App Engine JAVA(gae)上运行时获取Liquibase中的数据库锁定

时间:2015-03-16 15:04:59

标签: java google-app-engine liquibase

我在应用程序上下文中使用Liquibase版本3.3.2。

<bean id="liquibase" class="liquibase.integration.spring.SpringLiquibase">
          <property name="dataSource" ref="writeDataSource" />
          <property name="changeLog" value="classpath:sql/liquibase.xml" />
          <property name="contexts" value="default" />   
</bean>  

<bean id="writeDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
       <property name="url" value="jdbc:google:mysql://url" />
       <property name="driverClassName" value="com.mysql.jdbc.GoogleDriver" />
       <property name="username" value="****" />
       <property name="password" value="****" />
    </bean>

在Google App Engine上运行它会引发以下错误。似乎Liquibase无法在Google应用引擎上获取数据库锁定。这是GAE或我的代码端的问题。请帮忙。

 Uncaught exception from servlet
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerError
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:700)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
        at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
        at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
        at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
        at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
        at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
        at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
        at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:199)
        at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:174)
        at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:134)
        at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:527)
        at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:437)
        at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:444)
        at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:220)
        at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:308)
        at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:300)
        at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:441)
        at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
        at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.ExceptionInInitializerError
        at com.google.appengine.runtime.Request.process-d6e09a1f7d48b622(Request.java)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:46)
        at liquibase.sqlgenerator.SqlGeneratorFactory.<init>(SqlGeneratorFactory.java:40)
        at liquibase.sqlgenerator.SqlGeneratorFactory.getInstance(SqlGeneratorFactory.java:54)
        at liquibase.executor.AbstractExecutor.applyVisitors(AbstractExecutor.java:23)
        at liquibase.executor.jvm.JdbcExecutor.access$700(JdbcExecutor.java:36)
        at liquibase.executor.jvm.JdbcExecutor$QueryStatementCallback.doInStatement(JdbcExecutor.java:345)
        at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
        at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:135)
        at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:143)
        at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:151)
        at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:166)
        at liquibase.executor.jvm.JdbcExecutor.queryForInt(JdbcExecutor.java:187)
        at liquibase.executor.jvm.JdbcExecutor.queryForInt(JdbcExecutor.java:182)
        at liquibase.lockservice.StandardLockService.isDatabaseChangeLogLockTableInitialized(StandardLockService.java:118)
        at liquibase.lockservice.StandardLockService.init(StandardLockService.java:94)enter code here
        at liquibase.lockservice.StandardLockService.acquireLock(StandardLockService.java:188)
        at liquibase.lockservice.StandardLockService.waitForLock(StandardLockService.java:154)
        at liquibase.Liquibase.update(Liquibase.java:186)
        at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:353)
        at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:317)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$6.run(AbstractAutowireCapableBeanFactory.java:1602)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1599)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:300)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:700)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
        at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
        at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548)
        at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
        at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
        at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
        at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
        at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
        at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:437)
        at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:444)
        at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:220)
        at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref..

0 个答案:

没有答案