Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6829193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:28:15+00:00 2026-05-26T22:28:15+00:00

I have a java application running as a windows service using procrun from Commons

  • 0

I have a java application running as a windows service using procrun from Commons Daemon. It is running on Windows XP SP3.

The application depends on ActiveMQ, and I installed the service via the following batch script

@echo off

if "%OS%" == "Windows_NT" setlocal

set "APPLICATION_SERVICE_HOME=%cd%"
set EXECUTABLE_NAME=TestGenerator.exe
set EXECUTABLE=%APPLICATION_SERVICE_HOME%\%EXECUTABLE_NAME%
set SERVICE_NAME=TestGenerator

set CG_START_CLASS=net.test.testgenerator.startup.TestGeneratorApp
set CG_STOP_CLASS=%CG_START_CLASS%
set CG_START_METHOD=controlTestGeneratorService
set CG_STOP_METHOD=%CG_START_METHOD%
set CG_START_PARAMS=start
set CG_STOP_PARAMS=stop
set CG_DEPENDS_ON=ActiveMQ
set CG_STARTUP_TYPE=auto

set PR_DESCRIPTION=Test Generator v1.0
set "PR_INSTALL=%EXECUTABLE%"
set "PR_LOGPATH=%APPLICATION_SERVICE_HOME%\logs"
set  "PR_CLASSPATH=%APPLICATION_SERVICE_HOME%;%APPLICATION_SERVICE_HOME%\testgenerator.jar;%APPLICATION_SERVICE_HOME%\lib"
set PR_DISPLAYNAME=Test Generator Service

echo Installing service '%SERVICE_NAME%' ...

"%EXECUTABLE%" //IS//%SERVICE_NAME%  --Startup %CG_STARTUP_TYPE%  --StartClass %CG_START_CLASS% --StopClass %CG_STOP_CLASS% 
"%EXECUTABLE%" //US//%SERVICE_NAME% --StartMode jvm --StopMode jvm --DependsOn %CG_DEPENDS_ON% 
"%EXECUTABLE%" //US//%SERVICE_NAME% --StartMethod %CG_START_METHOD% --StopMethod  %CG_STOP_METHOD% 
"%EXECUTABLE%" //US//%SERVICE_NAME% --StartParams %CG_START_PARAMS% --StopParams %CG_STOP_PARAMS% 
"%EXECUTABLE%" //US//%SERVICE_NAME% ++JvmOptions "-Djava.io.tmpdir=%APPLICATION_SERVICE_HOME%\temp;" --JvmMs 128 --JvmMx 256
echo The service '%SERVICE_NAME%' was installed.

However, ActiveMQ does not show up as a dependency in the Administrative Tools\Services Dependencies tab.

When I look at HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Procrun 2.0\TestGenerator\Parameters, it has the DependsOn key correctly set to ActiveMQ, but the DependsOnService key in
HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Procrun 2.0\TestGenerator\Parameters does not have ActiveMQ listed.

I am able to set the dependency using SC.exe, but it does not allow me to specify all of the other parameters above.

Can anyone tell me if they have been able to successfully use DependsOn with Procrun and, if so, what am I doing incorrectly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:28:16+00:00Added an answer on May 26, 2026 at 10:28 pm

    I finally figured out that the --DependsOn option, together with a few others e.g. --Startup only work with the //IS or install command and not the //US or update command.

    In the example above moving the --DependsOn option to the //IS command would solve the issue

    "%EXECUTABLE%" //IS//%SERVICE_NAME%  --Startup %CG_STARTUP_TYPE%  --StartClass %CG_START_CLASS% --StopClass %CG_STOP_CLASS% --DependsOn %CG_DEPENDS_ON% 
    

    If anyone else has issues with using procrun I wrote up a few instructions, including this issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a java application ( Atlassian Bamboo) running on port 8085 on Windows
We have a java application which run as server running on a remote windows
I have made an application using Java/Hibernate/MySQL, but whenever I try running it, it
I have an external Windows .exe that is actually Java application: Running the .exe
I have a web application running in a GlassFish 3.1 service on Windows 7
I have inherited development of a Java/SWT application running on Windows only. One of
We have a small java application running on windows that needs to be able
I have a java application running on windows machines. Long story short, we have
I have a java application on Websphere that is using Apache Commons FTPClient to
I have a Java application that is running on Windows 7. When I look

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.