Uploaded image for project: 'Spring XD'
  1. Spring XD
  2. XD-1916

Batch jobs using Spring Batch MongoDB support require adding MongoDB dependencies to the shared libs folder

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Done
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: M7
    • Fix Version/s: 1.0 GA
    • Component/s: None
    • Labels:
      None
    • Story Points:
      0
    • Rank (Obsolete):
      1738
    • Sprint:
      Sprint 32

      Description

      Using the MongoDB out-of-the-box capabilities of Spring Batch such as MongoItemReader and MongoItemWriter require that spring-data-mongodb and mongo-driver are added to xd/libs.

      The above mentioned classes have dependencies on classes found in mongo-driver and spring-data-mongodb. Due to the fact that Spring Batch classes are loaded in the parent class loader, adding the complementary jars to the module will not make their dependencies visible to the deployment, resulting in a NoClassDefFoundError on spring-data-mongodb classes in this scenario.

      There are a few possible solutions:

      • requiring the user to add the missing jars to the shared libs folder - this is the straightforward solution, but has the disadvantage of putting the onus on enhancing the distribution on the user (who must have knowledge of the proper version(s) to include);
      • including the missing jars in the distribution (which can potentially increase its size to satisfy an optional scenario);
      • increasing the granularity of the packaged Spring Batch distribution and allowing the users to add the classes on demand;

      Essentially, this applies to any other dependencies of Spring Batch that are not part of the distribution.

        Attachments

          Activity

            People

            Assignee:
            grenfro Glenn Renfro
            Reporter:
            mbogoevici Marius Bogoevici
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: