0 Replies Latest reply on Nov 16, 2012 12:45 AM by 974539

    Java thread within the AddOn opar unable to submit EM Job

      We have an add-on opar which incorporates our war file. We are using EM version 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();

      instance_2.submitJob(EMExecutionContext.getExecutionContext().getConnection(), job);