Skip to content

Commit

Permalink
Add comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralf0131 committed May 17, 2018
1 parent 9dd6c6f commit a20eb73
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,19 @@
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.XmlWebApplicationContext;


/**
* An initializer to register {@link DubboApplicationListener}
* to the ApplicationContext seamlessly.
*/
public class DubboWebApplicationInitializer extends AbstractContextLoaderInitializer {

/**
* This method won't be triggered if running on spring-boot.
* It only works when running under a servlet container.
* @return a WebApplicationContext with DubboApplicationListener registered.
*/
@Override
protected WebApplicationContext createRootApplicationContext() {
// TODO need to verify under spring-boot
XmlWebApplicationContext webApplicationContext = new XmlWebApplicationContext();
webApplicationContext.addApplicationListener(new DubboApplicationListener());
return webApplicationContext;
Expand Down

3 comments on commit a20eb73

@ATAKing1023
Copy link
Contributor

@ATAKing1023 ATAKing1023 commented on a20eb73 Jun 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DubboWebApplicationInitializer will create a root application context, which is conflict with the SpringContextLoaderListener in webxml. See below stacktrace and web configuration for detail.

P.S. Running dubbo web application in JBoss EAP 6.

How should I avoid this issue? thanks.

exception-stacktrace.txt

web-xml.txt

@ralf0131
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, Can you report an issue?

@ATAKing1023
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue 1998 raised, please note. #1998

Please sign in to comment.