Stash fails with "The Spring WebApplicationContext could not be started"

We are evaluating Stash as an alternative to Gitlab and TFS and have installed it on a fresh installation of CentOS 6.3 Minimal.

The following is a similar error, but seems not to be the cause:

https://confluence.atlassian.com/display/STASHKB/The+Spring+WebApplicationContext+could+not+be+started

Stash is configured in setenv.sh to run from /var/stash

The server is running Java 1.7.0_07 and git 1.7.12.3, using the latest 1.3.0 version of Stash.

On accessing the server with a browser (http://localhost:7990), the logs show errors similar to this:

Oct 15, 2012 2:49:00 PM org.apache.catalina.core.StandardContext loadOnStartup

SEVERE: Servlet threw load() exception

java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?

at org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationContextUtils.java:90)

at org.springframework.web.context.support.HttpRequestHandlerServlet.init(HttpRequestHandlerServlet.java:56)

at javax.servlet.GenericServlet.init(GenericServlet.java:212)

at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)

at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)

at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4420)

at org.apache.catalina.core.StandardContext.start(StandardContext.java:4733)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)

at org.apache.catalina.core.StandardService.start(StandardService.java:525)

at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)

at org.apache.catalina.startup.Catalina.start(Catalina.java:595)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:601)

at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

Unfortunately, this is outside of our sphere of expertise - could you advise with any options on where to look to chase this?

Many thanks,

Mark

11 answers

This widget could not be displayed.

Hey Mark,

I suspect that we're missing the nested caused by exception.

Can you attach the entire stack trace or attach the logs to a support ticket on https://support.atlassian.com

Cheers,

Ajay.

This widget could not be displayed.
Maybe the user you're running the start up script as doesn't have the right privileges. I had a similar error and sudo'ing fixed it.
This widget could not be displayed.

I was running stash on a Amazon EC2 instance, had the same problem, ran stash in the foreground:

# /opt/stash/bin/start-stash.sh -fg

and saw a "java.net.UnknownHostException" exception. Fixed it by running:

# echo 127.0.0.1 `hostname`  >> /etc/hosts
Ec2 instances don't have a route to their own hostname. :/
This widget could not be displayed.

Any answer to this? I am also having the same issues with Spring.

This widget could not be displayed.

I am logged in as Root.

This widget could not be displayed.

I am having the same issue on a brand new installation of Stash 1.3.1

This widget could not be displayed.

same here with Stash 1.3.0 ... Stash was working for 3 or 4 weeks and now suddenly doesn't startup anymore.
I've attached the log file

This widget could not be displayed.

same here with Stash 1.3.0 ... Stash was working for 3 or 4 weeks and now suddenly doesn't startup anymore.
I've attached the log file (atlassian-stash.log)

The above exception does not show the actual cause and your issue is likely unrelated. Please create a support request under https://support.atlassian.com and our engineers will get you up and running again.

Cheers
Jens

This widget could not be displayed.

Seeing the same thing on CentOS 6.3 (fresh install) with Java 1.7.0 and Stash 2.0.1.

Not sure what informaton might be helpful, but I see this in the localhost log.

Jan 05, 2013 8:11:19 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Jan 05, 2013 8:11:20 PM org.apache.catalina.core.ApplicationContext log
INFO: Installing JUL to SLF4J bridge
Jan 05, 2013 8:11:20 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
Jan 05, 2013 8:11:53 PM org.apache.catalina.core.ApplicationContext log
INFO: org.tuckey.web.filters.urlrewrite.UrlRewriteFilter INFO: loaded (conf ok)
Jan 05, 2013 8:11:53 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'spring-mvc'

This widget could not be displayed.

Installing the following allowed Spring to start up properly for me. :)

yum install libgcc_s.so.1

This widget could not be displayed.

I've the same problem, and I found what is wrong thanks to atlassian support. When I update from stash 2.3.1 to 2.4.1, I've copied the new directory into to the old install dir.

The correct way is to rename the old install dir and then copy the new dir.

At the end, the easy way for next updates is to make a soft link:

ls -la / opt/atlassian:

stash -> atlassian-stash-2.4.1
atlassian-stash-2.3.1  
atlassian-stash-2.4.1

Hope this helps!

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in Statuspage

What are your best incident management tips and stories? #HugOps

 👋Community members! Downtime happens. And great incident response takes a village. Teams like Support, Dev, SRE, Ops, IT, and Marketing have to come together to resolve the problem while keep...

81 views 4 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you