Windows Java Agent does not setup the Job Environment properly before the Job is submitted
search cancel

Windows Java Agent does not setup the Job Environment properly before the Job is submitted

book

Article ID: 407775

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine

Issue/Introduction

In v24.4.x, jobs would not run individually but rather as a single session.

How to reproduce this:

1) Create a windows job called JOBS.USE_NET_USE
2) in the process tab of the windows job, add the following:
if not exist f: net use f: \\<server>\temp
f:
dir
ping 127.0.0.1 -n 9 >nul
net use
dir
 @set retcode=%errorlevel%
 @if NOT %ERRORLEVEL% == 0 goto :retcode

3) Create a second windows job called JOBS.DELETE_NET_USE that simply has this in the process tab:
net use * /DELETE /Y

4) Run JOBS.USE_NET_USE and let it finish

5) Notice that it is able to create the f: drive, cd to it, run a dir, wait 9 seconds with the ping, who the mapped drives and still run a dir command of the f drive after

6) Now run JOBS.USE_NET_USE and immediately run JOBS.DELETE_NET_USE

Expected behavior (as it was with non-java based agents):
Same as step 5 above - JOBS.USE_NET_USE should create the f: drive, cd to it, run a dir, wait 9 seconds with the ping, who the mapped drives and still run a dir command of the f drive after

Actual behavior:
When the JOBS.DELETE_NET_USE is run before the ping is finished on the JOBS.USE_NET_USE job, it deletes the mapped drive.  When the USE_NET_USE job finishes the ping, the report shows:
F:\>net use
The current directory is invalid.
F:\>dir
The system cannot find the path specified.



Another possible symptom is that if the user of the login object has not an open session to the target Windows system the user environment variables are not available. 

In the C-based agents on 21.0, this works as expected; the actual behavior is a change from how it worked previously.

Environment

Agent Windows Java 21.x and 24.x

Cause

DE172969: This is a known issue where the Windows Agent did not setup the Job Environment properly before it was submitted. The user setting was not loaded from the registry for the new Job.

Resolution

Update to a fix version listed below or a newer version if available.

Fix version:
Component(s): Agent Windows (Java)
Automation.Engine 24.4.1 HF2 - Available
Automation.Engine 21.0.15 - Planned release October 2025

Additional Information

Public Description: 

An issue has been solved where the Windows Agent did not setup the Job Environment properly before it was submitted. The user setting was not loaded from the registry for the new Job.

This Job relied on changes made in the system after the Agent started, for example, if commands such as net use or cmdkey were issued.