IBM Support

PK72189: API METHOD WORKSPACE.CONTENTSEARCH() THROWS NULLPOINTEREXCEPTIONS FOR ANONYMOUS WORKSPACE.

 

APAR status

  • Closed as program error.

Error description

  • API method Workspace.contentSearch() throws
    NullPointerExceptions for Anonymous workspace.
    
    The stacktrace shows following exceptions..
    
    Exception: java.lang.NullPointerException
                                     java.lang.NullPointerException
     at
    com.presence.connect.wmmcomms.PrincipalInformationManager.get(Pr
    incipalI
    nformationManager.java:88)
     at
    com.ibm.workplace.wcm.services.query.CoreQueries.buildXPathMenuQ
    uery(Cor
    eQueries.java:4253)
     at
    com.ibm.workplace.wcm.services.query.CoreQueries.performContentS
    earch(Co
    reQueries.java:4056)
     at
    com.ibm.workplace.wcm.api.WCM_APICoreQueries.performContentSearc
    h(WCM_AP
    ICoreQueries.java:1392)
     at
    com.ibm.workplace.wcm.api.WCM_Workspace.contentSearch(WCM_Worksp
    ace.java
    :2958)
    

Local fix

Problem summary

  • Contentsearch api function raises NullPointerException with
    anonymous user
    Use of the workspace.contentSearch() api method generates NPE
    with anonymous portal user.
    
    
    - - Create Site , SiteArea , Content , AT , PT and as JSP
    component and
    give anonymous access to all of the objects.
    
    - - Use following code in JSP point to above JSP component..
    
    <%@ page import="com.ibm.workplace.wcm.api.*"%>
    <%
    out.println (" <BR> Starting JSP ..<BR>");
    
    Workspace workspace = WCM_API.getRepository
    ().getAnonymousWorkspace();
    out.println (" Workspace .." + workspace);
    
    workspace.setCurrentDocumentLibrary
    (workspace.getDocumentLibrary("Test_Library"));
    
    DocumentId documentId = null;
    
    AuthoringTemplate AT = null;
    SiteArea SA = null;
    Document DOC = null;
    
    DocumentIdIterator AuthIt =
    workspace.findByName(DocumentTypes.AuthoringTemplate,"Test_AT");
    
    if (AuthIt.hasNext()){
    
    documentId = AuthIt.nextId();
    AT = (AuthoringTemplate) workspace.getById(documentId);
    out.println (" <BR> AuthoringTemplate ID .." + AT.getId());
    
    }
    
    DocumentIdIterator SiteAreaIt =
    
    workspace.findByName(DocumentTypes.SiteArea,"Test_SiteArea");
    if (SiteAreaIt.hasNext()){
    
    documentId = SiteAreaIt.nextId();
    SA = (SiteArea) workspace.getById(documentId);
    out.println (" <BR> SiteArea ID .." + SA.getId());
    
    }
    DocumentIdIterator contIt = workspace.contentSearch(AT.getId(),
    new
    DocumentId [] {SA.getId()}, new DocumentId [] {}, new String
    [0], true);
    while(contIt.hasNext())
    
    {
    documentId = contIt.nextId();
    DOC = (Document) workspace.getById(documentId);
    out.println (" <BR> Content title.." + DOC.getName());
    
    
    }
    
    %>
    
    - - Create anonymous page and LRP and configure above JSP
    component annd
    preview them.. It will gove list of the content and
    contentSearch API
    method seems to be working fine..
    
    
    install following IFixes:
    
    
    - - PK69894 and the 97 pre-req iFixes.
    PK67661
    PK67115
    PK70072 and all pre-req iFixes.
    
    - - Try to preview the above Page again , now the JSP does not
    work
    correctly and throws NPE in workspace.contentSearch Method.
    
    
    
    
    The following errors appear in SystemOut.log:
    Exception: java.lang.NullPointerException
    
    java.lang.NullPointerException
    at
    com.presence.connect.wmmcomms.PrincipalInformationManager.get(Pr
    incipalI
    nformationManager.java:88)
    at
    com.ibm.workplace.wcm.services.query.CoreQueries.buildXPathMenuQ
    uery(Cor
    eQueries.java:4253)
    at
    com.ibm.workplace.wcm.services.query.CoreQueries.performContentS
    earch(Co
    reQueries.java:4056)
    at
    com.ibm.workplace.wcm.api.WCM_APICoreQueries.performContentSearc
    h(WCM_AP
    ICoreQueries.java:1392)
    at
    com.ibm.workplace.wcm.api.WCM_Workspace.contentSearch(WCM_Worksp
    ace.java
    :2958)
    CoreQueries.buildXPathMenuQuery and
    CoreQueries.buildXPathMenuQueryForDraft get user principal info
    this way:
             PrincipalInformation principalInfo =
    PrincipalInformationManager.get(UserManagementUtils.getUser());
    
    but UserManagementUtils.getUser() returns null for anonymous
    user
    

Problem conclusion

Temporary fix

Comments

APAR Information

  • APAR number

    PK72189

  • Reported component name

    LOTUS WEB CONT

  • Reported component ID

    5724I2900

  • Reported release

    60G

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2008-09-17

  • Closed date

    2008-10-17

  • Last modified date

    2008-12-10

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    LOTUS WEB CONT

  • Fixed component ID

    5724I2900

Applicable component levels

  • R60G PSY

       UP

[{"Business Unit":{"code":"BU051","label":"N\/A"},"Product":{"code":"SUPPORT","label":"IBM Web Content Manager"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"6.0.1.3","Line of Business":{"code":"LOB33","label":"N\/A"}}]

Document Information

Modified date:
20 December 2021