Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

Mark Ridley October 14, 2012

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

1 vote
Lance Lance May 3, 2013

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. :/
1 vote
Peter Lenagh November 8, 2012
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.
1 vote
AjayA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 16, 2012

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.

0 votes
Albert Garcia May 12, 2013

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!

0 votes
Moonshine January 5, 2013

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

yum install libgcc_s.so.1

0 votes
Moonshine January 5, 2013

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'

0 votes
Martin Rädlinger November 25, 2012

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)

Jens Schumacher [Atlassian]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 25, 2012

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

0 votes
Martin Rädlinger November 25, 2012

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

0 votes
Damien Ramé November 23, 2012

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

0 votes
Ellery Blank November 8, 2012

I am logged in as Root.

0 votes
Ellery Blank November 8, 2012

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events