Skip to content

Application can't be started because of DubboWebApplicationInitializer #1998

@ATAKing1023

Description

@ATAKing1023

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

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

exception-stacktrace.txt

12:48:06,305 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/naoms.server]] (ServerService Thread Pool -- 7) JBWEB000287: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener: java.lang.IllegalStateException: Cannot initialize context because there is already a root application context present - check whether you have multiple ContextLoader* definitions in your web.xml!
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:296) [spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE]
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107) [spring-web-4.3.16.RELEASE.jar:4.3.16.RELEASE]
	at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.5.26.Final-redhat-1.jar:7.5.26.Final-redhat-1]
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:3780) [jbossweb-7.5.26.Final-redhat-1.jar:7.5.26.Final-redhat-1]
	at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:163) [jboss-as-web-7.5.18.Final-redhat-1.jar:7.5.18.Final-redhat-1]
	at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:61) [jboss-as-web-7.5.18.Final-redhat-1.jar:7.5.18.Final-redhat-1]
	at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96) [jboss-as-web-7.5.18.Final-redhat-1.jar:7.5.18.Final-redhat-1]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_131]
	at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) [rt.jar:1.8.0_131]
	at java.util.concurrent.FutureTask.run(FutureTask.java) [rt.jar:1.8.0_131]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_131]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_131]
	at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_131]
	at org.jboss.threads.JBossThread.run(JBossThread.java:122)

web-xml.txt

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="http://java.sun.com/xml/ns/javaee"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
	id="WebApp_ID" version="3.0">
	<display-name>fims.webappserver</display-name>
	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<!-- Dubbo Configuration -->
		<param-value>classpath:base-context.xml,classpath:base-dubbo.xml,classpath:dubbo-provider.xml
		</param-value>
	</context-param>
</web-app>

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions