I have upgraded DXA(Java) 1.5 to 1.8, Java 1.7 to 1.8 & spring 3.1.4 to 4.3.0 - I can able to compile successfully but when I start to execute my app in tomcat 9 am getting runtime exception: SEVERE: A child container failed during start java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]

I after this fail log. I'm getting an exception

INFO  InitializationUtils - Failed to register com.tridion.transport.HTTPSReceiverServlet

WARN  InitializationUtils - Failed to register com.tridion.webservices.odata.ODataContextListener, class is not in classpath

Executed mvn dependency:tree and resolve:

tree.log: http://www.filedropper.com/tree_8
resolve.log: http://www.filedropper.com/resolve_1

Can you please help me to resolve this issue?

Exception details:

2018-11-26 16:20:50,752 DEBUG InitializationUtils - Loaded resources [class path resource [dxa.defaults.properties], URL [jar:file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%209.0_64/apache-tomcat-9.0.13/wtpwebapps/dxaWeb/WEB-INF/lib/dxa-tridion-provider-1.8.0.jar!/dxa.modules.tridion.properties], class path resource [dxa.properties], file [C:\Program Files\Apache Software Foundation\Tomcat 9.0_64\apache-tomcat-9.0.13\wtpwebapps\dxaWeb\WEB-INF\classes\dxa.addons.device-families.properties], URL [jar:file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%209.0_64/apache-tomcat-9.0.13/wtpwebapps/dxaWeb/WEB-INF/lib/dxa-common-impl-1.8.0.jar!/dxa.addons.device-families.properties]]
2018-11-26 16:20:50,776 DEBUG InitializationUtils - Properties from class path resource [dxa.defaults.properties] are loaded
2018-11-26 16:20:50,777 DEBUG InitializationUtils - Properties from URL [jar:file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%209.0_64/apache-tomcat-9.0.13/wtpwebapps/dxaWeb/WEB-INF/lib/dxa-tridion-provider-1.8.0.jar!/dxa.modules.tridion.properties] are loaded
2018-11-26 16:20:50,779 DEBUG InitializationUtils - Properties from class path resource [dxa.properties] are loaded
2018-11-26 16:20:50,780 DEBUG InitializationUtils - Properties from file [C:\Program Files\Apache Software Foundation\Tomcat 9.0_64\apache-tomcat-9.0.13\wtpwebapps\dxaWeb\WEB-INF\classes\dxa.addons.device-families.properties] are loaded
2018-11-26 16:20:50,781 DEBUG InitializationUtils - Properties from URL [jar:file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%209.0_64/apache-tomcat-9.0.13/wtpwebapps/dxaWeb/WEB-INF/lib/dxa-common-impl-1.8.0.jar!/dxa.addons.device-families.properties] are loaded
2018-11-26 16:20:50,784 DEBUG InitializationUtils - Registered com.sun.jersey.spi.container.servlet.ServletContainer for mapping /cd_preview_webservice/ws/*
2018-11-26 16:20:51,068 INFO  InitializationUtils - Registered org.springframework.web.filter.CharacterEncodingFilter for mapping [/*]
2018-11-26 16:20:51,078 INFO  InitializationUtils - Failed to register com.tridion.transport.HTTPSReceiverServlet
2018-11-26 16:20:51,089 INFO  InitializationUtils - Registered com.tridion.storage.persistence.session.SessionManagementContextListener
2018-11-26 16:20:51,096 WARN  InitializationUtils - Failed to register com.tridion.webservices.odata.ODataContextListener, class is not in classpath
2018-11-26 16:20:51,097 INFO  DxaWebInitialization - Default DXA web application initialization complete.
2018-11-26 16:20:51,097 DEBUG WebAppInitializer - Initializing servlet application context
2018-11-26 16:20:51,153 DEBUG WebAppInitializer - Registering Spring ContextLoaderListener
2018-11-26 16:20:51,162 INFO  InitializationUtils - Registered org.springframework.web.context.ContextLoaderListener
2018-11-26 16:20:51,162 DEBUG WebAppInitializer - Registering Spring DispatcherServlet
2018-11-26 16:20:51,172 INFO  InitializationUtils - Registered class org.springframework.web.servlet.DispatcherServlet for mapping /
Nov 26, 2018 4:20:51 PM org.apache.catalina.core.ContainerBase startInternal
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:192)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:951)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:831)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1432)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1422)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
    at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:944)
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:261)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:801)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:695)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
    at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:441)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1432)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1422)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
    at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:944)
    ... 21 more
Caused by: java.lang.NoSuchMethodError: org.springframework.web.context.ConfigurableWebApplicationContext.getEnvironment()Lorg/springframework/web/context/ConfigurableWebEnvironment;
    at com.sdl.webapp.common.util.InitializationUtils.addActiveProfiles(InitializationUtils.java:200)
    at com.sdl.webapp.common.util.InitializationUtils.loadActiveSpringProfiles(InitializationUtils.java:194)
    at com.sdl.webapp.main.WebAppInitializer.onStartup(WebAppInitializer.java:36)
    at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:169)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5098)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
    ... 27 more

You can see in your stacktrace that the root cause of your error is this

java.lang.NoSuchMethodError: org.springframework.web.context.ConfigurableWebApplicationContext.getEnvironment

This means that your web application is trying to call this method, but the spring framework jars that are loaded in the webapp don't contain this function, hence the error. This could happen if your project contains several different projects, which use different versions of spring. This could explain why the code builds but doesn't execute.

I would check if there are no more references to spring 3.1.4.

If you are using maven, you could run this command :

mvn dependency:tree

This would give you an overview of which libraries depend on which other libraries. This way, you can see where you would need to update the old references to spring.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.