cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing PortalRuntime at runtime?

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

siddharth_jain
Active Contributor
0 Kudos

Hi,

use WDPortalUtils.getServiceReference instead of PortalRuntime.

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

Siddharth

Former Member
0 Kudos

This works! Thank you very much!

Answers (5)

Answers (5)

siddharth_jain
Active Contributor
0 Kudos

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());

}

siddharth_jain
Active Contributor
0 Kudos

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

Siddharth

Former Member
0 Kudos

Doesn't work too

I love non-existing SAP documentation...:-(

Former Member
0 Kudos

Which version are you in? If in CE, try to define the dependency at the DC level to the DC - tc\bi\bp\uwlsda.

If in older versions, try defining DC dependencies to suitbale UWL DCs.

Bala

Former Member
0 Kudos

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

siddharth_jain
Active Contributor
0 Kudos

try giving this value:

PORTAL:sap.com/tckmcbc.uwl~api

and see if it works

Siddharth

Former Member
0 Kudos

Unfortunately, doesn't work

siddharth_jain
Active Contributor
0 Kudos

Please give me the jar file name for UWL service

Siddharth

Former Member
0 Kudos

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.

siddharth_jain
Active Contributor
0 Kudos

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:

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

Former Member
0 Kudos

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.