Insufficient Privilege to Create Any Object With Agileuser Account in Scheduled Event PX (Doc ID 1516370.1)

Last updated on JULY 09, 2017

Applies to:

Oracle Agile PLM Framework - Version 9.3.1.2 and later
Information in this document applies to any platform.
***Checked for relevance on 23-Jul-2014***

Symptoms

When attempting to create any type of object in scheduled Event PX,
the following error occurs.

ERROR
-----------------------
Error code : 407
Error message : Insufficient privilege.
Root Cause exception : com.agile.util.exception.CMAppException: Insufficient privilege.
  at com.agile.api.pc.Session.createError(Session.java:1772)
  at com.agile.api.pc.Session$CreateObjectAction.doSdkAction(Session.java:1454)
  at com.agile.api.common.SDKAction.run(SDKAction.java:23)
  at com.agile.api.common.Security.doAs(Security.java:59)
  at com.agile.api.common.Security.doAs(Security.java:109)
  at com.agile.api.pc.Session.createObject(Session.java:387)
  at sr36595629681.SchedueldEventPX.doAction(SchedueldEventPX.java:27)
  at com.agile.px.Extensions2$PXEventActionNode.invoke(Extensions2.java:702)
  at com.agile.px.Extensions2.doCustomPXEvent(Extensions2.java:499)
  at com.agile.px.Extensions2.invokeAction(Extensions2.java:247)
  at com.agile.px.PxSessionBean.invokeAction(PxSessionBean.java:116)
  at com.agile.px.com_agile_px_PxSession_l8vd22_EOImpl.invokeAction(com_agile_px_PxSession_l8vd22_EOImpl.java:218)
  at com.agile.soa.event.handler.PXInitiator.invoke(PXInitiator.java:102)
  at com.agile.soa.event.listener.PXListener$1.run(PXListener.java:102)
  at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)


STEPS
-----------------------
The issue can be reproduced at will with the following steps:
1. Code Event PX like below.
public class SchedueldEventPX implements IEventAction {

public EventActionResult doAction(IAgileSession sess, INode arg1,
IEventInfo arg2) {
IAdmin admin;
String result;
try {
admin = sess.getAdminInstance();
IAgileClass cls = admin.getAgileClass(TransferOrderConstants.CLASS_CTO);

IAutoNumber[] autoNumbers = cls.getAutoNumberSources();
String nextAutoNumber = autoNumbers[0].getNextNumber();

// create a transfer order
ITransferOrder cto = (ITransferOrder) sess.createObject(
TransferOrderConstants.CLASS_CTO, nextAutoNumber);
result = "ok";
} catch (APIException e) {
// TODO Auto-generated catch block
e.printStackTrace();
result = e.getMessage();
}


return new EventActionResult(arg2, new ActionResult(ActionResult.STRING, result));
}

}


2. Setup Scheduled Event Subscriber in JavaClient

3. Leave Role blank in Event Handler

4. When the Event PX executes, error occurs in Server log and Event Handler Monitor shows: Insufficient privilege.


Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms