Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace the dual JAR/WAR with a JAR-only distribution #339

Closed
adolski opened this issue Dec 18, 2019 · 0 comments
Closed

Replace the dual JAR/WAR with a JAR-only distribution #339

adolski opened this issue Dec 18, 2019 · 0 comments
Milestone

Comments

@adolski
Copy link
Contributor

adolski commented Dec 18, 2019

Most Java web applications are packaged as JAR or WAR files that can run on the command line or in a Servlet container but not both. Cantaloupe is distributed as a dual JAR/WAR that can run either way. But this is an unusual way of packaging an application that has several disadvantages:

  1. It deviates from the standard build processes that Maven, Gradle, etc. all want to do. For example, you can see all of the hackery in pom.xml that is needed to get this working.
  2. There are class-loading issues when running as a JAR. Before the Servlet context has loaded, the system class loader only has access to a few classes and care must be taken not to include any dependencies that have other dependencies that would bloat the JAR/WAR as well as cause problems once the Servlet class loader takes over. SLF4J/Logback are a couple of these dependencies and a recent change to Jetty has resulted in Nothing is getting written to the access.log #338. Fixing this will be difficult and error-prone.
  3. The dual JAR/WAR is somewhat larger than a dedicated JAR or WAR would be as it contains some duplicate classes.
  4. It requires more maintenance and testing.

Tangential to this issue are the usual arguments against containers, which IMO are strong and would weigh on a decision about whether to drop the dual JAR/WAR in favor of an ordinary JAR.

Version 5.x would be a good time to do a switch. But, I know that this would inconvenience some container users, and I'm willing to consider arguments in opposition.

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

No branches or pull requests

1 participant