[
https://issues.jboss.org/browse/GTNPC-76?page=com.atlassian.jira.plugin.s...
]
Matt Wringe commented on GTNPC-76:
----------------------------------
The issue is pretty simple and WCI was never designed to handle the situation where a
portlet would require a servlet to be initialized first (nor do I think the portlet spec
has anything to say about this). Its not a bug, its just not designed to work this way.
During a normal startup, the servlet gets initialized first, because we are waiting for
the portlet container to start and then we initialize all the available portlets (so
during normal startup, the portlet is available first to wci, but the pc is not ready for
it yet, so the servlet gets a chance to start while the pc initializes itself). During a
hot deploy, the pc is already up and running and can start the portlet right away. This is
why there is a difference in the order of the initializations.
We could handle this situation if we were to use the WCI generic setup instead of the
jboss/tomcat implementation (since this uses a servlet to do the deploy, and we can set
the load-on-start of this servlet), but this requires all portlet wars to be modified to
include this special servlet. The best approach might be to look at supporting both the
WCI generic and native setups at the same time, but this gets a bit tricky with callbacks
and such.
Hotdeploy of a portlet war, see the portlet.xml loaded before the
web.xml
-------------------------------------------------------------------------
Key: GTNPC-76
URL:
https://issues.jboss.org/browse/GTNPC-76
Project: GateIn Portlet Container
Issue Type: Quality Risk
Environment: JBoss EPP-5.1.0
Reporter: Dimitri BAELI
Assignee: Matt Wringe
Attachments: PortletAndServletLoadOrderTest.war, PortletServletLoadOrder.zip
CONTEXT:
* A war with a portlet deployed in EPP/GateIn
PROBLEM:
* As seen in the Forum (
http://community.jboss.org/thread/157804) the servlet / portlet
init order is changing between normal startup and hotdeploy.
* This breaks the hotdeployment of Spring MVC Portlets (which requires the Spring
RootContext to be initialized).
* This is a quality risk as the loading order is not consitent
* This breaks the hotdeployment feature of JBossStudio of manual HotDeployment, and
it's a huge pain for developpers
REPRODUCE:
* To reproduce, I've created a minimalist project (without Spring) that shows the
difference between start order init order (normal/hotdeploy).
* Put the war in a EPP/GateIn deploy dir
* Start the server
* The logs will contain this for the fresh start-up:
{code}
03:14:47,514 INFO [STDOUT] SampleServlet init.
...
03:15:38,088 INFO [STDOUT] HelloWorldPortlet init.
{code}
* Touch the war file in the deploy dir
* The logs will contain this for the fresh start-up:
{code}
03:16:24,907 INFO [TomcatDeployment] undeploy, ctxPath=/PortletAndServletLoadOrderTest
03:16:24,979 INFO [STDOUT] HelloWorldPortlet destroy.
03:16:25,180 WARN [MainResourceResolver] Cannot find servlet context module
03:16:25,181 INFO [STDOUT] SampleServlet destroy.
03:16:25,322 INFO [TomcatDeployment] deploy, ctxPath=/PortletAndServletLoadOrderTest
03:16:25,461 INFO [STDOUT] HelloWorldPortlet init.
03:16:25,467 INFO [STDOUT] SampleServlet init.
{code}
* Where we see that the Portlet is inited before the portlet
EXPECTED:
* web.xml is initialized before portlet.xml when the war is Hotdeployed, like during a
normal startup
--
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