We have an add-on opar which incorporates our war file. We are using EM version 220.127.116.11.0. There are a few Java classes within this war that spawn threads, and the threads attempt to execute OEM jobs using the emSDK JobManager service (as shown below). But the threads are unable to submit the job, they fail with a null exception in the getConnection() below. But the same code executes fine and the job gets submitted when we do not spawn a thread, and instead execute the code in the main (parent) thread.
Is there some additional code/configuration required to enable the spawned Java threads to get the EMExecutionContext and submit the job?
//// Code sample that runs in the thread to submit the job
JobManager instance_2 = JobManager.instance();