Scenario 1 – Nondeterministic program output

Behaviour of application may seem non deterministic as it fails time-to-time.

Cause:

  • Application contains classes duplicated in various libraries
  • Java uses simple resolution → classpath order
  • Classpath order differs on each environment
  • Change of environment triggers loading of different classes
  • Consequence is failure when another (incompatible) class is loaded

Scenario 1 is often consequence of Scenario 2 (Hidden dependency problems).

Scenario 2 – Hidden dependency problems

 Project contains incompatible library versions or multiple versions of one library.

  • There can be many dependencies when downloading necessary 3rd party libraries and these can be easily overlooked by developers.

Root cause:

  • API of 3rd party libraries evolve to accommodate change requests
  • Not only client uses libraries as libraries use their API mutually.

Difficult to predict as libraries sometimes require other libraries in disjunctive version ranges.