Skip to Content
avatar image
Former Member

Accessing PortalRuntime at runtime?

Hi all,

I am currently trying to write a WebDynpro application, which should access the portal-UWL.

In this context I am trying to access a PortalRuntime-method.

I have read, that I have to add a shared reference to my project....PORTAL:sap.com/com.sapportals.portal.prt.runtime.PortalRuntime

But this reference does not work.

Does anybody have an idea how to solve this problem?

Thank you and kind regards, Patrick.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

6 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 17, 2008 at 08:59 AM

    Hi,

    use WDPortalUtils.getServiceReference instead of PortalRuntime.

    IUWLService uw = (IUWLService)WDPortalUtils.getServiceReference(IUWLService.ALIAS_KEY);

    Siddharth

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 16, 2008 at 08:15 AM

    Hi,

    Are you using UWL Portal service to Work with UWL ,in that case in your WD application you have to give shared reference of this service.

    Check the following thread:

    IUWLService throwing class cast exception.

    Also for Portal runtime Api you have to include prt.jar file either in your build path or through used dc if you are on NWDI.

    Siddharth

    Edited by: Siddharth Jain on Oct 16, 2008 10:15 AM

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      could you please post, what you have entered EXACTLY? (I am not having access to the portal server filesystem, but it is a standard installation)

      Thank you and kind regards, Patrick.

  • avatar image
    Former Member
    Oct 16, 2008 at 08:25 AM

    Please give me the jar file name for UWL service

    Siddharth

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      I just added to jar-files from my local nwds-installation to the build path at the moment:

      1. bc.uwl.service.api_api.jar

      2. bc.uwl.service.api_core.jar

      But I am not sure, if both are necessary.

      Thank you and kind regards, Patrick.

  • avatar image
    Former Member
    Oct 16, 2008 at 08:39 AM

    try giving this value:

    PORTAL:sap.com/tckmcbc.uwl~api

    and see if it works

    Siddharth

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 16, 2008 at 10:58 AM

    try putting tckmcbc.uwl~api value only in service reference Tab of WD Application.

    Siddharth

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi BalaKrishnan!

      I am currently working on NW7.0 SPS15.

      I tried to add the line in library references, which has been mentioned before. There is no deployment warning, if I do this, but

      still the same runtime error:

      java.lang.NoClassDefFoundError: com/sapportals/portal/prt/runtime/PortalRuntime

      It is caused by this line of code:

      IUWLService uwlService = (IUWLService) PortalRuntime.getRuntimeResources().getService(IUWLService.ALIAS_KEY);

      Regards, Patrick.

      Edited by: Patrick Lotter on Oct 17, 2008 9:35 AM

  • avatar image
    Former Member
    Oct 16, 2008 at 12:26 PM

    Hi,

    I tested this on my local server which is NW2004s Sp14

    i made this tckmcbc.uwl~api entry in library reference tab of WD DC

    And uw object is not null i didn't encounter any exception as well.

    you should try this also.

    try{

    IUWLService uw = (IUWLService)WDPortalUtils.getServiceReference(IUWLService.ALIAS_KEY);

    wdComponentAPI.getMessageManager().reportSuccess("UWL :--"+uw);

    wdComponentAPI.getMessageManager().reportSuccess("UWL :--"+uw.isTestMode());

    }

    catch(Exception e)

    {

    wdComponentAPI.getMessageManager().reportSuccess("UWL :--"+e.getMessage());

    }

    Add comment
    10|10000 characters needed characters exceeded