spring-boot-batch with mongodb

Souraji

this is my first post on this forum so please go easy on me if a made mistake or else. I'm using spring-boot batch with mongdb and everything works fine but I running in trouble when i have to test my batch. My Batchconfiguration is based on multiple jobs (4 jobs) , so

  1. 1st trouble when i used JobLauncherTestUtils spring don't know wich job to inject and i don't know how to specify that to test the jobs one by one.
  2. 2nd trouble when I separate my configuration to testing only one job, JobLauncherTestUtils couldn't been creating because it's need dataSource, as I used MongoDb with mongotemplate I don't use dataSource.

the stack error look like : Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'jobRepositoryTestUtils': Unsatisfied dependency expressed through method 'setDataSource' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'javax.sql.DataSource' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}

Hope anybody will help me to find a solution . Thanks in advance.

Mahmoud Ben Hassine

1st trouble when i used JobLauncherTestUtils spring don't know wich job to inject and i don't know how to specify that to test the jobs one by one.

You can specify which job to launch using JobLauncherTestUtils#setJob. Please see JobLauncherTestUtils throws NoUniqueBeanDefinitionException while trying to test spring batch steps

2nd trouble when I separate my configuration to testing only one job, JobLauncherTestUtils couldn't been creating because it's need dataSource, as I used MongoDb with mongotemplate I don't use dataSource.

According to the error Error creating bean with name 'jobRepositoryTestUtils', it is not JobLauncherTestUtils that could not be created but jobRepositoryTestUtils. The repository test utils is a convenience class to create and remove job executions from a database (See its javadoc). So it requires a datasource. If you don't have a data source in your test context, you need to remove this bean declaration.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

mongodbを使用したspring-boot-batch

分類Dev

Spring Batch + Spring Boot + Couchbase

分類Dev

Spring Boot + Spring Batch + Spring JPA

分類Dev

Spring Boot mongoDB jars

分類Dev

How to fix UnsatisfiedDependencyException in spring boot with mongodb application?

分類Dev

MongoDB + HibernateOGM + Spring Boot auto create database

分類Dev

Spring Boot Batch-JobLauncherCommandLineRunnerを除く

分類Dev

Spring Boot + Batch:Injected / AutowiredBeanがItemReaderでnull

分類Dev

Spring Batch not seeing H2 DataSource bean in Spring Boot application

分類Dev

Spring boot / Java、mongodb SSL / TLS接続

分類Dev

OneToMany(ManyToOne)関係のMongoDB Spring Boot定義

分類Dev

Spring Bootのcom.mongodb.util.JSONParseException?

分類Dev

how to configure both mongodb and postgres in spring boot application.yml?

分類Dev

Spring Boot mongoDB autowirednullリポジトリ

分類Dev

Spring Batchは常にSpring Bootで始まります:spring.batch.job.enabled = false動作しません

分類Dev

Spring Boot mongodb java.lang.NoClassDefFoundError:com / mongodb / MongoException $ DuplicateKey

分類Dev

複数のSpring Boot Batch Configurationクラスを持つ方法

分類Dev

Spring Batchのライターに相当するMongoDb?

分類Dev

Spring Batchジョブを特定の順序で実行する方法(Spring Boot)?

分類Dev

Spring Batchジョブを特定の順序で実行する方法(Spring Boot)?

分類Dev

CallableTaskletAdapter Spring Batch

分類Dev

Spring Batch Writer

分類Dev

Spring Batch FlatFile Formatting

分類Dev

Spring Batch MultiLineItemReader with MultiResourcePartitioner

分類Dev

Transaction management with Spring Batch

分類Dev

Spring Batch : custom ItemReader

分類Dev

テキスト検索がSpring Boot MongoDBで機能しない

分類Dev

Java Spring Boot-MongoDB findByIdコンパイルエラー

分類Dev

Spring Boot、MongoDBでネストされたオブジェクト

Related 関連記事

  1. 1

    mongodbを使用したspring-boot-batch

  2. 2

    Spring Batch + Spring Boot + Couchbase

  3. 3

    Spring Boot + Spring Batch + Spring JPA

  4. 4

    Spring Boot mongoDB jars

  5. 5

    How to fix UnsatisfiedDependencyException in spring boot with mongodb application?

  6. 6

    MongoDB + HibernateOGM + Spring Boot auto create database

  7. 7

    Spring Boot Batch-JobLauncherCommandLineRunnerを除く

  8. 8

    Spring Boot + Batch:Injected / AutowiredBeanがItemReaderでnull

  9. 9

    Spring Batch not seeing H2 DataSource bean in Spring Boot application

  10. 10

    Spring boot / Java、mongodb SSL / TLS接続

  11. 11

    OneToMany(ManyToOne)関係のMongoDB Spring Boot定義

  12. 12

    Spring Bootのcom.mongodb.util.JSONParseException?

  13. 13

    how to configure both mongodb and postgres in spring boot application.yml?

  14. 14

    Spring Boot mongoDB autowirednullリポジトリ

  15. 15

    Spring Batchは常にSpring Bootで始まります:spring.batch.job.enabled = false動作しません

  16. 16

    Spring Boot mongodb java.lang.NoClassDefFoundError:com / mongodb / MongoException $ DuplicateKey

  17. 17

    複数のSpring Boot Batch Configurationクラスを持つ方法

  18. 18

    Spring Batchのライターに相当するMongoDb?

  19. 19

    Spring Batchジョブを特定の順序で実行する方法(Spring Boot)?

  20. 20

    Spring Batchジョブを特定の順序で実行する方法(Spring Boot)?

  21. 21

    CallableTaskletAdapter Spring Batch

  22. 22

    Spring Batch Writer

  23. 23

    Spring Batch FlatFile Formatting

  24. 24

    Spring Batch MultiLineItemReader with MultiResourcePartitioner

  25. 25

    Transaction management with Spring Batch

  26. 26

    Spring Batch : custom ItemReader

  27. 27

    テキスト検索がSpring Boot MongoDBで機能しない

  28. 28

    Java Spring Boot-MongoDB findByIdコンパイルエラー

  29. 29

    Spring Boot、MongoDBでネストされたオブジェクト

ホットタグ

アーカイブ