How to setup java-service-wrapper for stash

I am trying to setup java-service-wrapper for our stash implementation but not sure how to configure it. The application tries to start but according to the logs, times out then retries.

This is what i have added/edited from the defaults:

Config file - conf/stash.conf

wrapper.java.command=/usr/bin/java

wrapper.java.mainclass=org.apache.catalina.startup.Bootstrap

wrapper.java.classpath.1=/usr/local/src/atlassian-stash-latest/lib/wrapper.jar
wrapper.java.classpath.2=/usr/local/src/atlassian-stash-latest/bin/bootstrap.jar
wrapper.java.classpath.3=/usr/local/src/atlassian-stash-latest/bin/commons-daemon.jar
wrapper.java.classpath.4=/usr/local/src/atlassian-stash-latest/bin/tomcat-juli.jar

wrapper.java.additional.1=-Dstash.home=/srv/stash

Script - bin/stash

# Application
APP_NAME="stash"
APP_LONG_NAME="Stash Application"

# Wrapper
WRAPPER_CMD="wrapper"
WRAPPER_CONF="../conf/stash.conf"

Here is the output when running - bin/stash console

Running Stash Application...
wrapper  | --> Wrapper Started as Console
wrapper  | Java Service Wrapper Community Edition 64-bit 3.5.21
wrapper  |   Copyright (C) 1999-2013 Tanuki Software, Ltd. All Rights Reserved.
wrapper  |     http://wrapper.tanukisoftware.com
wrapper  | 
wrapper  | Launching a JVM...
jvm 1    | Nov 19, 2013 5:13:55 PM org.apache.catalina.core.AprLifecycleListener init
jvm 1    | INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: ../lib
jvm 1    | Nov 19, 2013 5:13:55 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
jvm 1    | WARNING: [SetPropertiesRule]{Server/Service/Engine/Host} Setting property 'xmlValidation' to 'false' did not find a matching property.
jvm 1    | Nov 19, 2013 5:13:55 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
jvm 1    | WARNING: [SetPropertiesRule]{Server/Service/Engine/Host} Setting property 'xmlNamespaceAware' to 'false' did not find a matching property.
jvm 1    | Nov 19, 2013 5:13:55 PM org.apache.coyote.AbstractProtocol init
jvm 1    | INFO: Initializing ProtocolHandler ["http-bio-7990"]
jvm 1    | Nov 19, 2013 5:13:56 PM org.apache.coyote.AbstractProtocol init
jvm 1    | INFO: Initializing ProtocolHandler ["http-bio-8443"]
jvm 1    | Nov 19, 2013 5:13:56 PM org.apache.catalina.startup.Catalina load
jvm 1    | INFO: Initialization processed in 1234 ms
jvm 1    | Nov 19, 2013 5:13:56 PM org.apache.catalina.core.StandardService startInternal
jvm 1    | INFO: Starting service Catalina
jvm 1    | Nov 19, 2013 5:13:56 PM org.apache.catalina.core.StandardEngine startInternal
jvm 1    | INFO: Starting Servlet Engine: Apache Tomcat/7.0.40
jvm 1    | Nov 19, 2013 5:14:04 PM org.apache.catalina.core.ApplicationContext log
jvm 1    | INFO: No Spring WebApplicationInitializer types detected on classpath
jvm 1    | Nov 19, 2013 5:14:04 PM org.apache.catalina.core.ApplicationContext log
jvm 1    | INFO: Installing JUL to SLF4J bridge
jvm 1    | Nov 19, 2013 5:14:04 PM org.apache.catalina.core.ApplicationContext log
jvm 1    | INFO: Initializing Spring root WebApplicationContext
jvm 1    | Nov 19, 2013 5:14:10 PM org.apache.catalina.core.ApplicationContext log
jvm 1    | INFO: org.tuckey.web.filters.urlrewrite.UrlRewriteFilter INFO: loaded (conf ok)
jvm 1    | Nov 19, 2013 5:14:10 PM org.apache.catalina.core.ApplicationContext log
jvm 1    | INFO: Initializing Spring FrameworkServlet 'spring-mvc'
jvm 1    | Nov 19, 2013 5:14:10 PM org.apache.coyote.AbstractProtocol start
jvm 1    | INFO: Starting ProtocolHandler ["http-bio-7990"]
jvm 1    | Nov 19, 2013 5:14:10 PM org.apache.coyote.AbstractProtocol start
jvm 1    | INFO: Starting ProtocolHandler ["http-bio-8443"]
jvm 1    | Nov 19, 2013 5:14:10 PM org.apache.catalina.startup.Catalina start
jvm 1    | INFO: Server startup in 14012 ms
wrapper  | Startup failed: Timed out waiting for a signal from the JVM.
wrapper  | 
wrapper  | ------------------------------------------------------------------------
wrapper  | Advice:
wrapper  | The Wrapper consists of a native component as well as a set of classes
wrapper  | which run within the JVM that it launches.  The Java component of the
wrapper  | Wrapper must be initialized promptly after the JVM is launched or the
wrapper  | Wrapper will timeout, as just happened.  Most likely the main class
wrapper  | specified in the Wrapper configuration file is not correctly initializing
wrapper  | the Wrapper classes:
wrapper  |     org.apache.catalina.startup.Bootstrap
wrapper  | While it is possible to do so manually, the Wrapper ships with helper
wrapper  | classes to make this initialization processes automatic.
wrapper  | Please review the integration section of the Wrapper's documentation
wrapper  | for the various methods which can be employed to launch an application
wrapper  | within the Wrapper:
wrapper  |     http://wrapper.tanukisoftware.com/doc/english/integrate.html
wrapper  | ------------------------------------------------------------------------
wrapper  | 
wrapper  | JVM did not exit on request, termination requested.
wrapper  | JVM received a signal SIGKILL (9).
wrapper  | JVM process is gone.
wrapper  | JVM exited after being requested to terminate.

1 answer

Hi - I read your other post about support for startup of Atlassian products, which led me to this post. I'm also a bit unsure as to how to start Stash (now Bitbucket Server) via the Java Service Wrapper. Can I ask what solution you went with in the end?

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 Tuesday in Uncategorized

Friday fun: how many celebrates Midsummer holiday or is this a Swedish tradition only?

Any other country that celebrates Midsummer holiday (this friday 22 June)?  

44 views 3 1
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