Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Stash as a service

gkennedy1 March 17, 2013

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

0 votes
Answer accepted
cofarrell
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.
March 17, 2013

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

gkennedy1 March 17, 2013

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
TAGS
AUG Leaders

Atlassian Community Events