Topic
  • 5 replies
  • Latest Post - ‏2013-11-22T12:52:13Z by Alasdair
SanthiRamala
SanthiRamala
3 Posts

Pinned topic Getting InvalidName: SecurityCurrent:org.omg.CORBA.OBJECT_NOT_EXIST Exception

‏2013-11-12T07:05:28Z |

 

Hi

When I am trying to get SecurityCurrent using ORB following API(code) I am getting InvalidName: SecurityCurrent:org.omg.CORBA.OBJECT_NOT_EXIST: LocateRequest 7....

//Code strats here
com.ibm.CORBA.iiop.ORB orb = com.ibm.ejs.oa.EJSORB.getORBInstance();
if (orb != null) {
securityCurrent = (org.omg.SecurityLevel2.Current)orb.resolve_initial_references("SecurityCurrent");
//Code ends here

 

But orb.resolve_initial_references("SecurityCurrent"); is throwing the following exception (SecurityCurrent:org.omg.CORBA.OBJECT_NOT_EXIST: LocateRequest 7)

[11/11/13 16:50:57:591 IST] 0000001d ORBRas 1 com.ibm.rmi.iiop.Connection doLocateRequestWork:2956 ORB.thread.pool : 0 The following exception was logged
org.omg.CORBA.OBJECT_NOT_EXIST: Couldn't find subcontract for key 0x536563757269747943757272656e74 vmcid: IBM minor code: B85 completed: No
at com.ibm.rmi.iiop.ORB.locate(ORB.java:514)
at com.ibm.CORBA.iiop.ORB.locate(ORB.java:1551)
at com.ibm.rmi.iiop.Connection.doLocateRequestWork(Connection.java:2937)
at com.ibm.rmi.iiop.Connection.respondTo(Connection.java:2840)
at com.ibm.rmi.iiop.Connection.doWork(Connection.java:2640)
at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:63)
at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:118)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1527)

 

 

What could be the possible reason for this exception and how can I resolve this.
I have logged in using administrator role to my application and trying to fetc SecurityCurrent to attach client credentials to server.
Request some help to resolve this exception and to get SecurityCurrent of the current thread. ( As quick as possible plz)

More information:
ORB Trace file attched,  WAS 7 is the version

Thanks in advance

Santhi

Attachments

  • kark
    kark
    26 Posts

    Re: Getting InvalidName: SecurityCurrent:org.omg.CORBA.OBJECT_NOT_EXIST Exception

    ‏2013-11-20T18:35:05Z  

    Hi,

     

    If you are still having this issue please open a problem report with the must gather information for ORB and security so we can debug more.

     

    --Ajay

  • SanthiRamala
    SanthiRamala
    3 Posts

    Re: Getting InvalidName: SecurityCurrent:org.omg.CORBA.OBJECT_NOT_EXIST Exception

    ‏2013-11-21T04:58:19Z  
    • kark
    • ‏2013-11-20T18:35:05Z

    Hi,

     

    If you are still having this issue please open a problem report with the must gather information for ORB and security so we can debug more.

     

    --Ajay

    Hello Ajay,

    Thank you for reply

    We are trying to extract the security current from current thread and save it.

    Later we start another thread to run some logic(invoking Custom Mbeans) and to this thread we are attaching previously extracted security current credentials.

    For this we have used ORB API as mentioned above, but that is not working with higher WAS versions.

    How ever I have tried JAAS API to achieve this successfully.

    // Extract security current from current thread to attach later to other thread which calls remote custom MBean
    Subject caller_subject = com.ibm.websphere.security.auth.WSSubject.getCallerSubject();

    //attach already extracted security current to current thread
    WSSubject.setRunAsSubject(caller_subject);

    I have also tried setting only credentials to the subject, but it seems we have read only access on that, so I had to replace entire subject object.
    At this moment this solution is working fine, however I would request you to suggest if this is feasible solution or is there any other API we can use to achieve this extracting Security Subject and attach its credentials to another threads security subject.

    Thank you
    Santhi

  • kark
    kark
    26 Posts

    Re: Getting InvalidName: SecurityCurrent:org.omg.CORBA.OBJECT_NOT_EXIST Exception

    ‏2013-11-21T14:53:52Z  

    Hello Ajay,

    Thank you for reply

    We are trying to extract the security current from current thread and save it.

    Later we start another thread to run some logic(invoking Custom Mbeans) and to this thread we are attaching previously extracted security current credentials.

    For this we have used ORB API as mentioned above, but that is not working with higher WAS versions.

    How ever I have tried JAAS API to achieve this successfully.

    // Extract security current from current thread to attach later to other thread which calls remote custom MBean
    Subject caller_subject = com.ibm.websphere.security.auth.WSSubject.getCallerSubject();

    //attach already extracted security current to current thread
    WSSubject.setRunAsSubject(caller_subject);

    I have also tried setting only credentials to the subject, but it seems we have read only access on that, so I had to replace entire subject object.
    At this moment this solution is working fine, however I would request you to suggest if this is feasible solution or is there any other API we can use to achieve this extracting Security Subject and attach its credentials to another threads security subject.

    Thank you
    Santhi

    Hi,

    You can first try to get the runAsSubject (WSSubject.getRunAsSubject) and if it is null get the caller subject and then either use the setRunAsSubject or the doAs method. The doAs method sets the subject for a particular action only.

    --Ajay

  • SanthiRamala
    SanthiRamala
    3 Posts

    Re: Getting InvalidName: SecurityCurrent:org.omg.CORBA.OBJECT_NOT_EXIST Exception

    ‏2013-11-22T11:19:21Z  
    • kark
    • ‏2013-11-21T14:53:52Z

    Hi,

    You can first try to get the runAsSubject (WSSubject.getRunAsSubject) and if it is null get the caller subject and then either use the setRunAsSubject or the doAs method. The doAs method sets the subject for a particular action only.

    --Ajay

    Hi Ajay, Thanks again for reply.

    What is the difference between getRunAsSubject  and getCallerSubject.  Is there any technical reason behind this, just trying to know this to clarify myself.

    Thanks
    Santhi

  • Alasdair
    Alasdair
    55 Posts

    Re: Getting InvalidName: SecurityCurrent:org.omg.CORBA.OBJECT_NOT_EXIST Exception

    ‏2013-11-22T12:52:13Z  

    Hi Ajay, Thanks again for reply.

    What is the difference between getRunAsSubject  and getCallerSubject.  Is there any technical reason behind this, just trying to know this to clarify myself.

    Thanks
    Santhi

    Hi,

    getCallerSubject gets the Subject representing the identity of the caller

    getRunAsSubject gets the Subject representing the identity you are currently running under. 

    Often these are the same, but if you set a Run As role then the caller id and the run as id will be different. The run as id is used for doing down stream calls to protected resources like EJBs.