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

  • Home
  • SEARCH
  • 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 7975673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:42:28+00:00 2026-06-04T08:42:28+00:00

I have my Batch Application Program, in which I am using ThreadPoolExecutor in my

  • 0

I have my Batch Application Program, in which I am using ThreadPoolExecutor in my Batch Application Program. So as soon as it hits the-

executorService.shutdown();

line in my Batch Application program, I always get this below error in my Batch Application Program. And I am not able to ShutDown my own Executor Service. Can anyone suggest me how should I overcome this error.

Batch Execution Failed!
TaskResponse[exitCode=
   <ExitCode 
       type="User"
       code="30"
       msg="Unexpected error encounted"/>,
    causedByException=java.security.AccessControlException : Access denied (java.lang.RuntimePermission modifyThread)
]

java.security.AccessControlException: Access denied (java.lang.RuntimePermission modifyThread)
   at java.security.AccessController.checkPermission(AccessController.java:108)
   at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
   at java.util.concurrent.ThreadPoolExecutor.shutdown(ThreadPoolExecutor.java:1104)
   at com.host.task.Testing.CommandExecutor.runNextCommand(CommandExecutor.java:185)
   at com.host.task.Testing.PDSBatchTask.execute(PDSBatchTask.java:66)
   at com.host.nel.batch.runtime.Task.start(Task.java:234)
   at com.host.nel.batch.runtime.rt.TaskManager.__executeTask(TaskManager.java:138)
   at com.host.nel.batch.runtime.rt.TaskManager.executeTask(TaskManager.java:73)
   at com.host.nel.batch.runtime.rt.BatchManager.__executeTask(BatchManager.java:302)
   at com.host.nel.batch.runtime.rt.BatchManager.executeBatchApplication(BatchManager.java:126)
   at com.host.nel.batch.driver.BatchMain.main(BatchMain.java:95)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
   at java.lang.reflect.Method.invoke(Method.java:599)
   at com.host.nel.batch.testutils.TestBatchMain$1.run(TestBatchMain.java:50)
   at java.security.AccessController.doPrivileged(AccessController.java:251)
   at com.host.nel.batch.testutils.TestBatchMain.driver(TestBatchMain.java:37)
   at com.host.nel.batch.testutils.TestBatchMain.driver(TestBatchMain.java:21)
   at test.com.host.task.Testing.Driver.main(Driver.java:21)

Update-
I tried doing this way, but still no luck-

// create thread pool with given size
            final ExecutorService service = Executors.newFixedThreadPool(10); 

            // queue some tasks
            for(int i = 0; i < 3 * 10; i++) {
                service.submit(new ThreadTask(i));
            }


            AccessController.doPrivileged(new PrivilegedAction() {
                public Object run() {
                    // privileged code goes here, for example:
                    service.shutdown();
                    try {
                        if (!service.awaitTermination(Long.MAX_VALUE, TimeUnit.DAYS)) {
                            service.shutdownNow();
                        }
                    } catch (final InterruptedException pCaught) {
                        service.shutdownNow();
                        Thread.currentThread().interrupt();
                    }

                    return null; // nothing to return
                }
            });
  • 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-04T08:42:29+00:00Added an answer on June 4, 2026 at 8:42 am

    Don’t run your batch test code with a SecurityManager. Or, grant your code the modifyThread RuntimePermission.

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

Sidebar

Related Questions

I have a standard procedure using batch which clears a data application folder, then
I have made a batch script which runs a Python application. This batch script
I have one spring batch application which can be run from command line. The
I have an application which get copied and run on client machines. The program
We have a weblogic batch application which processes multiple requests from consumers at the
We have an enterprise application (deployed as an ear) is a batch processor which
I have a batch file which starts multiple instances of simple console application (Hello
I have a Spring Batch application, which I start with the CommandLineJobRunner . But
I have this batch that needs to run that the user has to execute
I have a Batch file which will call a Powershell Script : BATCH FILE

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.