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

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.

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.

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. :/

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

I am logged in as Root.

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

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

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

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'

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

yum install libgcc_s.so.1

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted 2 hours ago in Off-topic

Miscellaneous Monday - CreatatronV3

You may remember, not so long ago, that together we invented the most evil of machines: The Destructo5000!  The effects of missing Durian rippled over nations. Complete chaos as goat chee...

36 views 2 2
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