Installing Bamboo with MS SQL Server fails with a "No WebApplicationContext found" exception
Platform Notice: Data Center Only - This article only applies to Atlassian apps on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Configuring a fresh Bamboo installation with Microsoft SQL Server stalls on the database step. The following will be thrown in the logs:
2021-02-26 11:57:50,391 INFO [performSetupDatabaseConnectionBackgroundThread] [BrokerService] Using Persistence Adapter: KahaDBPersistenceAdapter[/data/bamboo-home/jms-store/bamboo/KahaDB]
2021-02-26 11:57:50,407 INFO [performSetupDatabaseConnectionBackgroundThread] [SharedFileLocker] Database /data/bamboo-home/jms-store/bamboo/KahaDB/lock is locked by another server. This broker is now in slave mode waiting a lock to be acquired
2021-02-26 11:57:53,789 ERROR [http-nio-8085-exec-17] [FiveOhOh] 500 Exception was thrown.
java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
at org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationContextUtils.java:85)
at org.springframework.orm.hibernate5.support.OpenSessionInViewFilter.lookupSessionFactory(OpenSessionInViewFilter.java:194)
at org.springframework.orm.hibernate5.support.OpenSessionInViewFilter.lookupSessionFactory(OpenSessionInViewFilter.java:180)
at org.springframework.orm.hibernate5.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:131)
at com.atlassian.bamboo.persistence.BambooSessionInViewFilter.doFilterInternal(BambooSessionInViewFilter.java:24)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.atlassian.bamboo.filter.BambooCompressingFilter.doFilter(BambooCompressingFilter.java:39)
(...)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.valves.StuckThreadDetectionValve.invoke(StuckThreadDetectionValve.java:206)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:615)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:818)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1626)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Environment
Bamboo with Microsoft SQL Server as the database
Cause
A lock file is preventing Bamboo from connecting to the database.
Solution
Below is a workaround for this issue:
Shutdown all Bamboo instances. Check for and kill any processes related to Bamboo (including Java and Tomcat ones)
Delete the whole
bamboo-homefolderDrop the MS SQL Server database created for Bamboo, in order to avoid any corruptions
Create a new database to be used by Bamboo following these specific steps
Ensure that the user which will be used to start Bamboo has complete ownership and full access to both
bamboo-homeandbamboo-installationfoldersRestart the installation
Was this helpful?