Topic
  • 5 replies
  • Latest Post - ‏2014-07-21T21:49:11Z by CPDK
CharlieCat
CharlieCat
2 Posts

Pinned topic FNRCA0024E: API_PROPERTY_NOT_IN_CACHE

‏2013-10-15T01:14:18Z |

I'm trying to run this sample code below, but I"m getting this error:

FNRCA0024E: API_PROPERTY_NOT_IN_CACHE: The Name property was not found in the properties collection

 

importjavax.security.auth.Subject;

importcom.filenet.api.core.Factory;

importcom.filenet.api.core.Connection;

importcom.filenet.api.core.Domain;

importcom.filenet.api.core.ObjectStore;

importcom.filenet.api.util.UserContext;

 

public classFNConnTest

{

       public static voidmain(String[] args)

       {

              String uri = "https://nr1twvecm001.rb.win.frb.org:9443/wsi/FNCEWS40MTOM/";

              String username = Toggles.strGetLoginName;

              String password = Toggles.strGetPassword;

              String osName = "Support";

 

              Connection conn = Factory.Connection.getConnection(uri);

              Subject subject = UserContext.createSubject(conn, username,  password,  null);   

              UserContext uc = UserContext.get();

              uc.pushSubject(subject);

 

              Domain domain = Factory.Domain.getInstance(conn, null);             

              System.out.println("Domain Name is:  "+ domain.get_Name());                                   

              ObjectStore store = Factory.ObjectStore.fetchInstance(domain, osName, null);

              System.out.println("ObjectStore is:  "+ store.get_Name());

       }

}

 

Any suggestions?

 

  • mattiasgreen
    mattiasgreen
    2 Posts

    Re: FNRCA0024E: API_PROPERTY_NOT_IN_CACHE

    ‏2013-10-15T05:06:39Z  

    Hi,

    If you check the documentation for the Factory.Domain.getInstance, it reads (emphasis mine):

    "This method does not verify the existence of the requested object on the server; it simply returns a local reference without making a round-trip to the server. The local reference is not affiliated with an object of this class type until you perform a function on the object (for example, fetch a property value) that causes a round-trip to the Content Engine server."

    http://pic.dhe.ibm.com/infocenter/p8docs/v5r1m0/topic/com.ibm.p8.ce.dev.java.doc/com/filenet/api/core/Factory.Domain.html

    Using getInstance is fine for other use cases, but you need to be careful with your choice of get vs. fetch and read up on the differences. Reading up on property filters (http://pic.dhe.ibm.com/infocenter/p8docs/v5r1m0/topic/com.ibm.p8.ce.dev.java.doc/com/filenet/api/property/PropertyFilter.html) is also wise.

    Try changing as follows. Note, however, that you could have chosen to get the domain and then instead fetch the name property, as an alternative.

    Domain domain = Factory.Domain.getInstance(conn, null);
    Domain domain = Factory.Domain.fetchInstance(conn, null);

    Good luck,

    Mattias

     
  • nicolas.leralle
    nicolas.leralle
    16 Posts

    Re: FNRCA0024E: API_PROPERTY_NOT_IN_CACHE

    ‏2013-10-15T11:44:58Z  

    Hi,

    If you check the documentation for the Factory.Domain.getInstance, it reads (emphasis mine):

    "This method does not verify the existence of the requested object on the server; it simply returns a local reference without making a round-trip to the server. The local reference is not affiliated with an object of this class type until you perform a function on the object (for example, fetch a property value) that causes a round-trip to the Content Engine server."

    http://pic.dhe.ibm.com/infocenter/p8docs/v5r1m0/topic/com.ibm.p8.ce.dev.java.doc/com/filenet/api/core/Factory.Domain.html

    Using getInstance is fine for other use cases, but you need to be careful with your choice of get vs. fetch and read up on the differences. Reading up on property filters (http://pic.dhe.ibm.com/infocenter/p8docs/v5r1m0/topic/com.ibm.p8.ce.dev.java.doc/com/filenet/api/property/PropertyFilter.html) is also wise.

    Try changing as follows. Note, however, that you could have chosen to get the domain and then instead fetch the name property, as an alternative.

    Domain domain = Factory.Domain.getInstance(conn, null);
    Domain domain = Factory.Domain.fetchInstance(conn, null);

    Good luck,

    Mattias

     

    Hi,

    When I migrate my subscriptions from 5.1 to 5.2, I had the same issue when getting my ObjectStore with eventObject.getObjectStore(); function.

     

    To solve this error, I did the following:

     

    ObjectStore objectStore = eventObject.getObjectStore();
    PropertyFilter pf = new PropertyFilter();
    pf.addIncludeProperty(new FilterElement(0, null, Boolean.TRUE, PropertyNames.ID, null));
    pf.addIncludeProperty(new FilterElement(0, null, Boolean.TRUE, PropertyNames.NAME, null));
     
    objectStore.fetchProperties(pf);

    And it works.

     

    Best regards,

     

    Nicolas

  • CharlieCat
    CharlieCat
    2 Posts

    Re: FNRCA0024E: API_PROPERTY_NOT_IN_CACHE

    ‏2013-10-16T14:31:04Z  

    Hi,

    When I migrate my subscriptions from 5.1 to 5.2, I had the same issue when getting my ObjectStore with eventObject.getObjectStore(); function.

     

    To solve this error, I did the following:

     

    ObjectStore objectStore = eventObject.getObjectStore();
    PropertyFilter pf = new PropertyFilter();
    pf.addIncludeProperty(new FilterElement(0, null, Boolean.TRUE, PropertyNames.ID, null));
    pf.addIncludeProperty(new FilterElement(0, null, Boolean.TRUE, PropertyNames.NAME, null));
     
    objectStore.fetchProperties(pf);

    And it works.

     

    Best regards,

     

    Nicolas

    Thanks.   It  turned out to be an access/security issue.

  • DeepThakkar
    DeepThakkar
    1 Post

    Re: FNRCA0024E: API_PROPERTY_NOT_IN_CACHE

    ‏2014-07-18T07:28:13Z  

    Use this piece of code instead:

    Domain domain = Factory.Domain.fetchInstance(conn, null, null);

  • CPDK
    CPDK
    8 Posts

    Re: FNRCA0024E: API_PROPERTY_NOT_IN_CACHE

    ‏2014-07-21T21:49:11Z  

    Thanks.   It  turned out to be an access/security issue.

    Hi, I know it's been a while since you had this issue, but do you know what the access/security issue was? Did you have to give full control to the object store for your user account?