Skip to content

Conversation

@nickrobison
Copy link

@nickrobison nickrobison commented May 7, 2025

When upgrading a project from Quartz 2.3.2 to 2.5.0 we ran into the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: com/mchange/v2/c3p0/ComboPooledDataSource
	at org.quartz.utils.C3p0PoolingConnectionProvider.initialize(C3p0PoolingConnectionProvider.java:187)
	at org.quartz.utils.C3p0PoolingConnectionProvider.<init>(C3p0PoolingConnectionProvider.java:106)
	at com.rms.mapping.system.scheduler.QuartzSchedulerManager$.init(QuartzSchedulerManager.scala:225)
	at com.rms.mapping.system.scheduler.QuartzSchedulerManager$.apply(QuartzSchedulerManager.scala:201)

Looking at the Gradle build, it look like the c3p0 dependency is declared as implementation which means it's not exposed on the runtime class path. While the workaround from #1310 is sufficient if these types are exposed in the library API then it seems to make sense to change their declaration scope.

This PR updates the dependency declaration to restore the behavior of the 2.3.x library.

If these dependencies were intentionally hidden then perhaps a comment in the release notes or the README would be helpful?

Fixes issue #1310

Changes

  • Update Gradle dependency scope

Checklist

  • tested locally
  • updated the docs
  • added appropriate test
  • signed-off on the DCO referenced in the CONTRIBUTING link below via git commit -s on my commits, and submit this code under terms of the Apache 2.0 license and assign copyright to the Quartz project owners
    (If you're not using command-line, you can use a browser extension )

In submitting this contribution, I agree to the terms of contributing as referred to here:
https://github.com/quartz-scheduler/contributing/blob/main/CONTRIBUTING.md

When upgrading a project from Quartz 2.3.2 to 2.5.0 we ran into the following error:

```
Exception in thread "main" java.lang.NoClassDefFoundError: com/mchange/v2/c3p0/ComboPooledDataSource
	at org.quartz.utils.C3p0PoolingConnectionProvider.initialize(C3p0PoolingConnectionProvider.java:187)
	at org.quartz.utils.C3p0PoolingConnectionProvider.<init>(C3p0PoolingConnectionProvider.java:106)
	at com.rms.mapping.system.scheduler.QuartzSchedulerManager$.init(QuartzSchedulerManager.scala:225)
	at com.rms.mapping.system.scheduler.QuartzSchedulerManager$.apply(QuartzSchedulerManager.scala:201)
```

Looking at the Gradle build, it look like the `c3p0` dependency is declared as `implementation` which means it's not exposed on the runtime class path. While the workaround from quartz-scheduler#1310 is sufficient if these types are exposed in the library API then it seems to make sense to change their declaration scope.

 This PR updates the dependency declaration to restore the behavior of the 2.3.x library.

If these dependencies were intentionally hidden then perhaps a comment in the release notes or the README would be helpful?

Signed-off-by: Nick Robison <[email protected]>
@jhouserizer jhouserizer added the needs:review Needs review / investigation label Jul 2, 2025
@jhouserizer
Copy link
Contributor

It was intentional - but with some hesitation. In light of your report I will review/ponder.

@jhouserizer
Copy link
Contributor

The concerns here are:

  • More than half of the users of Quartz use JDBCJobStore and hence end up needing these dependencies. So its arguably a regression not to.
  • A large portion (but a bit less than half) of Quartz users are using RAMJobStore and don't want these dependencies dragged in. So it's an improvement not to.

@jhouserizer
Copy link
Contributor

Also relates to #1384

@jhouserizer
Copy link
Contributor

Hi after consideration, and discussion with a couple of others, I don't believe this change can / should be made in a dot release. Especially considering there is another set of users that would be annoyed in the opposite direction. Also if we were to take care of the one you mentioned, there are several others that should be reviewed.

Will prepare some comments to add to the release notes and/or installation docs to help users out. Thanks for reporting.

@jhouserizer jhouserizer removed the needs:review Needs review / investigation label Oct 22, 2025
@jhouserizer
Copy link
Contributor

Deferring for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants