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

Use ServletContextInitializer for application initialization #132

Merged
merged 1 commit into from Jul 25, 2017

Conversation

kinow
Copy link
Contributor

@kinow kinow commented Jul 25, 2017

Hi,

This commit introduces a new ServletContextListener, ApplicationInitializer, which offloads parts of the responsibilities from EntryServlet. The EntryServlet was both serving as Jersey entry point servlet, but also as handling application initialization.

This is now done in the listener. The ConfigurationFactory is also throwing an exception when there is no configuration file, instead of printing to stderr and later throwing a NullPointerException.

With these changes, it is easy to identify when the application fails to initialize. Which is useful when a WAR application is deployed to a platform like AWS Elastic Beanstalk.

…alizer, which

offloads parts of the responsibilities from EntryServlet. The EntryServlet was both
serving as Jersey entry point servlet, but also as handling application initialization.
This is now done in the listener. The ConfigurationFactory is also throwing an
exception when there is no configuration file, instead of printing to stderr and
later throwing a NullPointerException.

With these changes, it is easy to identify when the application fails to initialize.
Which is useful when a WAR application is deployed to a platform like AWS Elastic
Beanstalk.

Simplify
@kinow
Copy link
Contributor Author

kinow commented Jul 25, 2017

Executed the tests a few times, having the following results in order:

Tests run: 1341, Failures: 12, Errors: 206, Skipped: 21
Tests run: 1341, Failures: 11, Errors: 205, Skipped: 21
Tests run: 1341, Failures: 10, Errors: 205, Skipped: 21
Tests run: 1341, Failures: 5, Errors: 103, Skipped: 21

The more I executed the tests, the less failures and errors I got? Tested locally this pull request, and I could successfully serve an image, perform some rotation, zoom in, etc.

@adolski adolski merged commit 4e824da into cantaloupe-project:develop Jul 25, 2017
@adolski
Copy link
Contributor

adolski commented Jul 25, 2017

This is excellent, thanks!

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.

None yet

2 participants