数据处理---Spring Batch之实践
<batch:job id="job1"> 在META-INF下面加个persistence.xml <?xml version="1.0" encoding="UTF-8"?> Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'exampleConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.batch.core.repository.JobRepository com.test.batch.ExampleConfiguration.jobRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jobRepository': Cannot resolve reference to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [launch-context.xml]: Cannot resolve reference to bean 'entityManagerFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [launch-context.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: No persistence unit with name 'spring' found 运行的时辰碰着上面的错误,就是没有上面的设置的缘故起因 org.springframework.transaction.InvalidIsolationLevelException: Standard JPA does not support custom isolation levels - use a special JpaDialect for your JPA implementation 碰着这样的错误,是由于默认的JPA不支持自界说的事物断绝级别。可以自界说一个CustomHibernateJpaDialect extends HibernateJpaDialect,详细代码没有列出,可以找下。 在用Quartz的时辰碰着 Caused by: java.lang.IncompatibleClassChangeError: class org.springframework.scheduling.quartz.CronTriggerBean has interface org.quartz.CronTrigger as super class ? 这个是因为网上的许多例子都是quartz版本稍旧的缘故起因,我用的是quartz?2.1.7 错误:Jobs added with no trigger must be durable 坑真的是不少,必要一个个办理。最后测试一下,是不是按时执行我们的job: public class App { 祝你好运,可以或许乐成,。 (编辑:湖南网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |