dubbo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] ralf0131 commented on issue #1998: Application can't be started because of DubboWebApplicationInitializer
Date Mon, 02 Jul 2018 08:09:25 GMT
ralf0131 commented on issue #1998: Application can't be started because of DubboWebApplicationInitializer
URL: https://github.com/apache/incubator-dubbo/issues/1998#issuecomment-401705672
 
 
   > Is it possible for dubbo to implement it's own ServletContextListener?
   
   Yes. But that also requires user to change their configuration. Actually it is possible
to configure the `DubboApplicationListener` in your applicationContext.xml or using annotations.
   
   The primary concern here is how to enable that feature without user being aware of it.
So I use the ServletContainerInitializer to implement that.
   
   If you check the source code of `org.springframework.web.context.AbstractContextLoaderInitializer#registerContextLoaderListener`
   
   ```java
   	protected void registerContextLoaderListener(ServletContext servletContext) {
   		WebApplicationContext rootAppContext = createRootApplicationContext();
   		if (rootAppContext != null) {
   			ContextLoaderListener listener = new ContextLoaderListener(rootAppContext);
   			listener.setContextInitializers(getRootApplicationContextInitializers());
   			servletContext.addListener(listener);
   		}
   		else {
   			logger.debug("No ContextLoaderListener registered, as " +
   					"createRootApplicationContext() did not return an application context");
   		}
   	}
   ```
   
   You will find that it does the same thing for you. So you will not need to specify the
`ContextLoaderListener` anymore.
   
   So I am suggesting that you remove the `ContextLoaderListener` configuration in your web.xml.
Does that make sense?
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Mime
View raw message