[
https://issues.apache.org/jira/browse/WICKET-5146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13635599#comment-13635599
]
bernard commented on WICKET-5146:
---------------------------------
I have attached the quickstart as requested. But to reproduce the problem you
have to deploy the app to the server in a way that the libraries are not
deployed with it. You can do this by adding an attribute to the dependencies
<scope>provided</scope>
You could try this on an application server e.g. GlassFish that installs itself
with NetBeans as follows:
- Install the app server
- copy wicket libraries to the domain's lib folder
- Run the app with the exception in init()
- Take out the exception, recompile and run again
In the error scenario, private static final Map<String, Application>
applicationKeyToApplication is not cleared. I don't know how the patch
addresses this.
> Application not destroyed if WicketFilter#init() fails
> ------------------------------------------------------
>
> Key: WICKET-5146
> URL: https://issues.apache.org/jira/browse/WICKET-5146
> Project: Wicket
> Issue Type: Bug
> Affects Versions: 6.7.0
> Reporter: bernard
> Attachments: fix-WICKET-5146.patch, testcase.zip
>
>
> 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.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira