-
1. Re: Loading Order of ServletContextListener, Servlet & Portlet
dbaeli Oct 18, 2011 10:24 AM (in response to llengcai)Hello,
Hot deploying a simple Spring MVC Sample in an EAR or WAR, behaves the same.
On the server side logs with can see the WebApplicationContext is initialized too late in case of Portlet (and webapp being re-deployed).
LOG Content
------------------------------------------
16:01:43,031 INFO [[/PortletEAR]] Destroying Spring FrameworkPortlet 'scorecard'
16:01:43,031 WARN [MainResourceResolver] Cannot find servlet context module
16:01:43,041 INFO [[/PortletEAR]] Closing Spring root WebApplicationContext
16:01:43,081 INFO [DeployHandler] End stop, [vfszip:/D:/newJBOSS/jboss-epp-5.1/jboss-as/server/default/deploy/SampleEAR.ear/]
16:01:43,081 INFO [DeployHandler] Begin start, [vfszip:/D:/newJBOSS/jboss-epp-5.1/jboss-as/server/default/deploy/SampleEAR.ear/]
16:01:43,390 INFO [TomcatDeployment] deploy, ctxPath=/Dummy
16:01:44,592 INFO [[/PortletEAR]] Initializing Spring FrameworkPortlet 'scorecard'
16:01:44,612 ERROR [org.springframework.web.portlet.DispatcherPortlet] (ResourceContainer.invoker.nonDaemon-1) Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scoreCardController' defined in PortletContext resource [/WEB-INF/scorecard-portlet.xml]: Cannot resolve reference to bean 'scoreCardService' while setting bean property 'scoreCardService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'scoreCardService' is defined
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
....
16:01:45,639 INFO [[/PortletEAR]] Initializing Spring root WebApplicationContext
--------------------------------------------
-
2. Re: Loading Order of ServletContextListener, Servlet & Portlet
dbaeli Oct 18, 2011 9:44 PM (in response to dbaeli)A test project (without Spring MVC) has been done to show that the init order is changing between normal startup and hotdeployment of wars.
And an issue in the dedicated project has been opened : https://issues.jboss.org/browse/GTNPC-76
Hoping it will help to identify and fix the unconsistency in the deployment order.
Thanks