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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:28:01+00:00 2026-05-18T23:28:01+00:00

I have a problem running a java process as a windows service due to

  • 0

I have a problem running a java process as a windows service due to NTFS permissions.
(http://community.jboss.org/wiki/RunJBossAsAServiceOnWindows).

The service installs successfully, but has problems starting due to file permissions.

  • If I change the windows-service “login” to my account (e.g. domain/login), the service runs fine.
  • If I change the filesystem permisisons from 755 to 777, the service runs fine.

Example log

08:58:02,250 ERROR [MainDeployer] Could not make local copy for file:/J:/projects/devtools/pe64-jboss-4.2.2.GA/server/solr/conf/jboss-service.xml
java.io.IOException: Access is denied
    at java.io.WinNTFileSystem.createFileExclusively(Native Method)

“Yo No Comprende”. I thought the “Local System” account was “root”. (“Local System” is the default account)

“chmod -R 777 <>” is not an option. (security hole)

So to summarize:

  • What is the deal with “Local System” and windows NTFS file permissions?
  • Can you add “Local System” to “My group”
  • Is my local build process doing something wrong? (e.g. the windows version of UMask is bad? )
  • Any other gotchas running java as a windows service?
  • After 15+ years of windows NT-based OS, why are services still such a pain?

Update/Solution

It turn out that in later Windows (Vista and Window 7), MSFT closed a security hole which allowed a service to get at anyone’s “temp” files.

“Local System” account just doesn’t have access to any common/pre-created “temp” directory.

The solution, in the java world:

  • create your own temp directory. Grant it adequate permisions)
  • pass “-Djava.io.tmpdir=/path/to/my/temp/dir” as a jvm argument.

thanks

will

  • 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-18T23:28:02+00:00Added an answer on May 18, 2026 at 11:28 pm

    I wouldn’t use Cygwin for this. Instead, I use a combination of cacls and ntrights (from the XP resource kit – still works in 2008 / win 7). The only issue is that you have to run Ant as an administrator. This means that you need to either make sure you start an admin level cmd prompt or your installer has to to elevate.

    In Ant, I do something like the following:

    <!-- give the service user full access to install dir -->
    <exec executable="cacls" failonerror="true" osfamily="winnt" output="NUL">
      <arg line="&quot;${dir.install}&quot; /e /p ${service.username}:f" />
    </exec>
    
    <!-- remove the Users group access from the install dir -->
    <exec executable="cacls" failonerror="true" osfamily="winnt" output="NUL">
      <arg line="&quot;${dir.install}&quot; /e /t /r Users" />
    </exec>
    
    <!-- give the service user the right to log on as a service,
         remove right to logon through the UI -->
    <exec executable="${dir.installer}/install/ntrights">
      <arg line="-u ${service.username} +r SeServiceLogonRight" />
    </exec>
    <exec executable="${dir.installer}/install/ntrights">
      <arg line="-u ${service.username} +r SeDenyInteractiveLogonRight" />
    </exec>
    

    Note that I couldn’t get cacls to work with individual args. I had to specify the whole line. Also note the quote escape to handle directories with spaces (e.g. Program Files).

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

Sidebar

Related Questions

1st phase I have a problem shutting down my running JBoss instance under Eclipse
I have an odd problem in VS2008 running unit tests. When I run the
Here's a problem I keep running into: I have a lot of situations where
Has anyone encountered the following problem: I have IIS7 running on my computer. On
Problem solved: Thanks guys, see my answer below. I have a website running in
I have been having some problems trying to get my PHP running. When I
I have a Swing Application running under Linux, that has problems to display accented
I have a .NET 2.0 server that seems to be running into scaling problems,
Looking for some direction here as I'm running into some migration problems. We have
I have problem in some JavaScript that I am writing where the Switch statement

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.