[jboss-jira] [JBoss JIRA] (JBMETA-346) LoadOnStartup annotation of a servlet is ignored if servlet is mentioned in the web.xml even without a load-on-startup element
Robert Panzer (Resolved) (JIRA)
jira-events at lists.jboss.org
Mon Dec 12 02:49:09 EST 2011
[ https://issues.jboss.org/browse/JBMETA-346?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Panzer resolved JBMETA-346.
----------------------------------
Resolution: Done
The issue does not show up any longer with the last commit 8aa869d.
But I really do not like the idea, that it is a must now, to call setLoadOnStartup() as well as setLoadOnStartupInt() afterwards. Sequence of the calls matters!
Especially when someone enters an illegal value into the deployment descriptor, no error message is given and the order of the servlet initializations changes unpredictably.
I would prefer not storing the string content of the load-on-startup element at all and instead stop the deployment when recognizing illegal content. The setter setLoadOnStartup(String) could stay but it should just try to convert the given string and set corresponding int member or throw an exception if the content is not numeric.
I don't want to add a test case using this approach, but it works now as expected so imo the issue can be closed now.
> LoadOnStartup annotation of a servlet is ignored if servlet is mentioned in the web.xml even without a load-on-startup element
> ------------------------------------------------------------------------------------------------------------------------------
>
> Key: JBMETA-346
> URL: https://issues.jboss.org/browse/JBMETA-346
> Project: JBoss Metadata
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: web
> Environment: JBoss 7.1.0.CR1-SNAPSHOT, Win7 64Bit, JDK 1.6.0-29 64Bit
> Reporter: Robert Panzer
> Assignee: Robert Panzer
>
> I have a servlet that defines a loadOnStartup value using an annotation.
> Additionally I have a web.xml that mentions this servlet but does not contain a load-on-startup element and is not metadata-complete.
> Then the annotated value is ignored and the loadOnStartup value falls back to a "default" of 0 (instead of -1 being the predefined default).
> I already found the bug and will attach a pull request
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list