cancel
Showing results for 
Search instead for 
Did you mean: 

Runtime exception while using PCD API in NW 7.3 EHP1

soumalyanath
Explorer
0 Kudos

Hi,

I am trying to get the attribute values of a perticular pcd objects in the DC, using the PCD API. Though my DC is deployed successfully, I get an exception from my NWDI logs, which says

'Application can not be started. Reason: it has Hard reference to the following resources, which are currently not available on the system: hard to SAPPORTAL/com.sap.portal.pcm.admin (public) (f=true, cl=true);'

In my portalapp.xml, i have added the following sharing reference:

<property name="SharingReference" value=

"urlgenerator,com.sap.portal.htmlb,

com.sap.portal.navigation.service,

com.sap.portal.navigation.helperservice,

com.sap.portal.pcd.glservice,

com.sap.portal.pcm.admin"/>

Here is my code:

Hashtable ht_env = new Hashtable();

//Setting environment variables

ht_env.put(Context.INITIAL_CONTEXT_FACTORY,IPcdContext.PCD_INITIAL_CONTEXT_FACTORY);

ht_env.put(Context.SECURITY_PRINCIPAL, request.getUserPrincipal());

ht_env.put(Constants.REQUESTED_ASPECT, PcmConstants.ASPECT_SEMANTICS);

InitialContext iCtx = null;

IiView iView = null;

IPage ipage = null;

try {

             iCtx = new InitialContext(ht_env);

             Object currentObject = iCtx.lookup("portal_content/somepath/somepath");

           

             if (currentObject instanceof IiView) {

                         iView = (IiView) currentObject;

                         Enumeration enum1 = iView.getAttributeIds();

                      if(enum1!=null){

                                  while(enum1.hasMoreElements()){

                                              String str = (String)enum1.nextElement();

                                              //Displaying all the attributes of the iview

                                              response.write("Attribute : " + str + " : " +iView.getAttribute(str).toString() + "<BR>");

                                  }

                      }

             }else if (currentObject instanceof IPage) {

                         ipage = (IPage) currentObject;

                         Enumeration enum1 = iView.getAttributeIds();

                          pt ="";

                      if(enum1!=null){

                                  while(enum1.hasMoreElements()){

                                              String str = (String)enum1.nextElement();

                                             pt = pt+">>"+ipage.getAttribute(str);

                                              //Displaying all the attributes of the iview

                                              response.write("Attribute : " + str + " : " +ipage.getAttribute(str).toString() + "<BR>");

                                  }

                      }

             }

I am following the following thread as reference:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/508baf88-9335-2d10-efa6-c6ad61e5f...

Some pointers would be extremely helpful. thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

dror_last
Active Participant
0 Kudos

Hi,

In 7.3x versions PCD and PCM are exposed as J2EE libraries.

Please use the following sharing references:

SAPJ2EE::library:tc~epbc~pcd~gl~api

SAPJ2EE::library:tc~epbc~pcm~adminapi

As you use IPage you also need reference to:

com.sap.portal.ivs.api_iview

You should write your code in the src.core part of the application and use PrivateSharingReference in the portalapp.xml if you do not intend to expose your own APis.

Regards,

Dror.

Answers (0)