WicketFilter calls Application#initApplication() which calls Application#init().
In case of Exception thrown in the application's init() method, there is no cleanup in WicketFilter's finally block.
The result of this is, in case where Wicket is in the application server's libraries (not deployed with the war file), that the application cannot be re-deployed withhout re-starting the application server.
That is because Application#setName() crashes with IllegalStateException("Application name can only be set once.").
In Application, private static final Map<String, Application> applicationKeyToApplication holds a reference to the crashed instance after the application is undeployed.