Stash as a service

Hi all,

I successfully got Stash running as a console application and set it up to connect to a sql server db using integrated authentication. The next piece of the puzzle is to get it running as a windows service (I'm using 64bit Win2008R2). I followed the instructions, installed the 64 bit JDK, altered the tomcat exe & dll to use the 64 bit versions etc. but I can't get it to work.

The browser just seems to try to load and the tomcat.exe process on the server spins right up to 99% CPU usage.

An excerpt from the log file says this -

2013-03-15 14:59:41,991 ERROR [localhost-startStop-1] c.a.e.i.AsynchronousAbleEventDispatcher There was an exception thrown trying to dispatch event 'com.atlassian.plugin.event.events.PluginModuleDisabledEvent@4fa860ba' from the invoker 'SingleParameterMethodListenerInvoker{method=public void com.atlassian.stash.internal.event.EventListenerRegistrar.onPluginModuleDisabled(com.atlassian.plugin.event.events.PluginModuleDisabledEvent), listener=com.atlassian.stash.internal.event.EventListenerRegistrar@2bc7005b}'.

java.lang.RuntimeException: PermGen space

I did some research into the PermGen exception and tried increasing the STASH_MAX_PERM_SIZE to 512m without luck. This is a brand new installation so it shouldn't need anything out of the ordinary however.

A side note that may or may not be relevant is that the JDK paths did not match what was in service.bat.

ie: if not exist "%JAVA_HOME%\jre\bin\java.exe" goto noJavaHome

I needed to alter (all instances of) to

if not exist "%JAVA_HOME%\jre7\bin\java.exe" goto noJavaHome

Any help is appreciated.

Greg

1 answer

1 accepted

This widget could not be displayed.

Hi Greg,

A few things. The JAVA_HOME you want should actually include 'jre7'. That is to say JAVA_HOME should always include a 'bin' directory with 'java'. What you're actually using is the JDK_HOME which is slightly different, the scripts themselves are fine.

More importantly , 512m should definitely be enough permgen to get Stash running. What is possibly the case is that your actual Windows service hasn't been updated. Apparently when you modify the service.bat you will need to re-install the service to see the changes. You can also manually do what our permgenservice.bat is doing and add the parameter:

//US//%SERVICE_NAME% ++JvmOptions "-XX:MaxPermSize=512m"

This is similar to what we talk about here regarding max memory:

https://confluence.atlassian.com/display/STASH/Running+Stash+as+a+Windows+service

I hope this helps.

Charles

Hi Charles,

Thanks. It was an issue with the environment variables. I had both JAVA_HOME & JDK_HOME defined. Once I removed JAVA_HOME it started working correctly.

Greg

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
Published 8 hours ago in Marketplace Apps

The 7 hacks of highly successful automation

...there's anything I've learnt from working, it's that people are lazy! No offense to anyone reading this, but it's true and we can all admit it. The easier you make something for someone, the more...

42 views 0 8
Read article

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