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 7990829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:07:23+00:00 2026-06-04T13:07:23+00:00

I installed a standard executable jar file as a Windows service by running the

  • 0

I installed a standard executable jar file as a Windows service by running the following command:

> prunsrv.exe //IS//"My Service" --Install="C:\path-to-prunsrv.exe" --Jvm=auto \
  --Startup=auto --StartMode=jvm --Classpath="C:\path-to-MyService.jar" \
  --StartClass=com.mydomain.MyService

I can now run my program fine in console mode by running the following command (I’m using Java 1.6):

> prunsrv.exe //TS//"My Service"

When I try to start the service through the standard Windows services interface, I get the following error message:

The MyService service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.

There is no output in my application’s log file when I attempt to start the service this way. There is also no output in the Window’s event log (Windows 7 64-bit). What can I do to try and figure out why this service will not run?

  • 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-06-04T13:07:25+00:00Added an answer on June 4, 2026 at 1:07 pm

    Don’t use any white-space in the service name!

    After many hours of testing and pulling apart Tomcat and duplicating it’s bootstrap process, the fix for my problem ended up being that Apache Commons Daemon (Procrun) does not work properly when there is white-space in the name of the Windows service.

    It seemingly correctly installs and registers a service with Windows when there are spaces in the service name. The Windows registry entries even look correct. The service even runs in debug (aka TS or console) mode just fine. When run, however, as an actual service launched by Windows it fails if the service was installed with a white-space in the service name.

    I sure wish Procrun had some type of log output when it fails! Good logging can make debugging issues like this a snap.

    I did need to have multiple words in my service name, so I named my service with one word and changed the name with the “DisplayName” parameter:

    > prunsrv.exe //IS//MyService --Install="C:\path-to-prunsrv.exe" --Jvm=auto \
      --Startup=auto --StartMode=jvm --Classpath="C:\path-to-MyService.jar" \
      --StartClass=com.mydomain.MyService --DisplayName="My Service"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Installed rubyinstaller-1.8.7-p358.exe, then tried to install jammit , but the config.gem command isn't being
System.Environment.OSVersion does not appear to indicate which Edition of Windows 2003 is installed (Standard,
I've just installed the Windows Mobile 6.5.3 DTK, both standard and professional. Before that
I have a stack of WCF services installed on a Windows 2008 R2 Standard
python version 2.4 # pip install psycopg2 Getting the following error: Downloading/unpacking psycopg2 Running
We have installed CollabNet Subversion Edge on a Windows 2008 R2 Standard server that
I downloaded Git source and installed it in a non-standard path. All the Git
I have a standard homebrew install inside of usr/local/ When I try: Larson-2:~ larson$
I've just finished re-installing my OS, and as always install and test standard tools
I'm trying to install mgo which is a mongo-driver written in golang. The standard

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.