如何解决如何在使用BigQuery的Spring应用程序中使用Quartz Scheduler
我正在将Spring Hibernate应用程序从DB2迁移到Big Query。要连接此Java应用程序,我正在使用Simba驱动程序。
此应用程序具有Quartz调度程序。
我在BQ中创建了Quartz调度程序使用的以下表,这些表是: QRTZ_BLOB_TRIGGERS QRTZ_CALENDARS QRTZ_CRON_TRIGGERS QRTZ_FIRED_TRIGGERS QRTZ_JOB_DETAILS QRTZ_LOCKS QRTZ_PAUSED_TRIGGER_GRPS QRTZ_SCHEDULER_STATE QRTZ_SIMPLE_TRIGGERS QRTZ_SIMPROP_TRIGGERS QRTZ_TRIGGERS
applicationContext.xml配置:
<bean id="datafeedScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="schedulerName" value="datafeedScheduler"/>
<property name="dataSource" ref="dataSource"/>
<property name="configLocation" value="classpath:quartz.properties"/>
<property name="autoStartup" value="false"/>
<property name="overwriteExistingJobs" value="true"/>
<property name="waitForJobsToCompleteOnShutdown" value="true"/>
<property name="jobDetails" ref="datafeedJob"/>
</bean>
<bean class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" id="dataSource">
<property name="driverClassName" value="com.simba.googlebigquery.jdbc42.Driver"/>
<property name="url" value="jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;ProjectId=bq-project;DefaultDataset=bq-dataset;OAuthType=0;OAuthServiceAcctEmail=bq-project-email@dev.iam.gserviceaccount.com;OAuthPvtKeyPath=/Users/serviceAccount/<<serviceAccountKey.json>>"/>
<property name="testOnBorrow" value="true"/>
<property name="testOnReturn" value="true"/>
<property name="testWhileIdle" value="true"/>
<property name="timeBetweenEvictionRunsMillis" value="1800000"/>
<property name="numTestsPerEvictionRun" value="3"/>
<property name="minEvictableIdleTimeMillis" value="1800000"/>
<property name="initialSize" value="5"/>
<property name="maxActive" value="20"/>
</bean>
quartz.properties文件:
org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.useProperties=false
org.quartz.scheduler.rmi.export=false
org.quartz.scheduler.rmi.createRegistry=false
org.terracotta.quartz.skipUpdateCheck=true
请注意,我添加的11个表是由Quartz框架强制执行的。现在,对于这些Quartz表中定义的某些数据类型,BigQuery中不存在这些数据类型,例如:BLOB,BIGINT,DECIMAL,因此对于这些数据类型,我将其保留为BLOB的字符串; BIGINT为INT64,十进制为NUMERIC。
- 如何解决这个问题
- 什么是Simba 11380错误
我正在追随异常,
SEVERE: Exception sending context initialized event to listener instance of class [org.springframework.web.context.ContextLoaderListener]
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'datafeedScheduler' defined in file [/Users/b003598/eclipse-workspace/Rahul/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/PDFM/WEB-INF/classes/META-INF/spring/applicationContext.xml]: Invocation of init method failed; nested exception is org.quartz.JobPersistenceException: Couldn't store job: [Simba][JDBC](11380) Null pointer exception. [See nested exception: java.sql.SQLException: [Simba][JDBC](11380) Null pointer exception.]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:736)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:434)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4689)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5155)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1412)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1402)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.quartz.JobPersistenceException: Couldn't store job: [Simba][JDBC](11380) Null pointer exception. [See nested exception: java.sql.SQLException: [Simba][JDBC](11380) Null pointer exception.]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeJob(JobStoreSupport.java:1107)
at org.quartz.impl.jdbcjobstore.JobStoreSupport$3.execute(JobStoreSupport.java:1079)
at org.quartz.impl.jdbcjobstore.JobStoreSupport$45.execute(JobStoreSupport.java:3739)
at org.quartz.impl.jdbcjobstore.JobStoreCMT.executeInLock(JobStoreCMT.java:245)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInLock(JobStoreSupport.java:3735)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.storeJob(JobStoreSupport.java:1075)
at org.quartz.core.QuartzScheduler.addJob(QuartzScheduler.java:920)
at org.quartz.impl.StdScheduler.addJob(StdScheduler.java:269)
at org.springframework.scheduling.quartz.SchedulerAccessor.addJobToScheduler(SchedulerAccessor.java:274)
at org.springframework.scheduling.quartz.SchedulerAccessor.registerJobsAndTriggers(SchedulerAccessor.java:216)
at org.springframework.scheduling.quartz.SchedulerFactoryBean.afterPropertiesSet(SchedulerFactoryBean.java:512)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1633)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1570)
... 21 more
Caused by: java.sql.SQLException: [Simba][JDBC](11380) Null pointer exception.
at com.simba.googlebigquery.googlebigquery.utils.BQCoreUtils.getParamValueAsText(Unknown Source)
at com.simba.googlebigquery.googlebigquery.dataengine.BQSQLExecutor.execute(Unknown Source)
at com.simba.googlebigquery.jdbc.common.SPreparedStatement.executeWithParams(Unknown Source)
at com.simba.googlebigquery.jdbc.common.SPreparedStatement.executeAnyUpdate(Unknown Source)
at com.simba.googlebigquery.jdbc.common.SPreparedStatement.executeUpdate(Unknown Source)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:105)
at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.insertJobDetail(StdJDBCDelegate.java:645)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.s`enter code here`toreJob(JobStoreSupport.java:1101)
... 33 more
Caused by: java.lang.NullPointerException
... 42 more
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。