The publisher implementation needs to be made more defensive, have logging (be informative in general) and fail early and fail hard when it can't bring itself up. The ServletContainerBridge run method specifically needs to be hardened for production use. I can't imagine going to production with dozens of features, resources, filters, AbstractBinders etc and having a problem.
I'm working on replacing Spring/Karaf with Jax-RS / Karaf. I've lost 3 days in total over the last three weeks to various issues that are indecipherable till you understand all the moving parts in place (Jersey, pax-web, Http Service, Karaf, Bundles and dependencies in environment etc). 65% of the problems hung on a "Jersey is not available" error with no way to figure out if it's bundle load sequencing, bundle wiring, my use of the jax-rs-connector, the HttpService, my container etc etc.
The run method in the ServletContainerBridge has been the focus point for all the errors I have faced:
It does not handle exceptions.
It does not put itself in a failure state.
it does nothing to inform the user about what is wrong.
I've now embedded the publisher source code in my own framework bundle in Karaf and I am adding shell commands to introspect the state of jersey etc. I've also started hardening the code. I'm doing this in Scala (Shell commands) and with log4j (extending the publisher with logging) so I doubt it will be of general use.
The publisher implementation needs to be made more defensive, have logging (be informative in general) and fail early and fail hard when it can't bring itself up. The ServletContainerBridge run method specifically needs to be hardened for production use. I can't imagine going to production with dozens of features, resources, filters, AbstractBinders etc and having a problem.
I'm working on replacing Spring/Karaf with Jax-RS / Karaf. I've lost 3 days in total over the last three weeks to various issues that are indecipherable till you understand all the moving parts in place (Jersey, pax-web, Http Service, Karaf, Bundles and dependencies in environment etc). 65% of the problems hung on a "Jersey is not available" error with no way to figure out if it's bundle load sequencing, bundle wiring, my use of the jax-rs-connector, the HttpService, my container etc etc.
The run method in the ServletContainerBridge has been the focus point for all the errors I have faced:
I've now embedded the publisher source code in my own framework bundle in Karaf and I am adding shell commands to introspect the state of jersey etc. I've also started hardening the code. I'm doing this in Scala (Shell commands) and with log4j (extending the publisher with logging) so I doubt it will be of general use.
The snippet below is what I am using for now.
https://gist.github.com/hsyed/76573e255c8de6d2f83b