Showing results for 
Search instead for 
Did you mean: 

URL Generator not working

Former Member
0 Kudos

Hi people,

I need to get the URL of an already created iView in my PCD and I am using the following code (inside an AbstractPortalComponent) for that:

IUrlGeneratorService urlGeneratorService = null;

	urlGeneratorService = (IUrlGeneratorService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.URLGENERATOR_SERVICE);
} catch (Exception re){

IPortalUrlGenerator portalUrlGenerator = null;
ISpecializedUrlGenerator specializedUrlGenerator = urlGeneratorService.getSpecializedUrlGenerator(IPortalUrlGenerator.KEY);

if(specializedUrlGenerator != null && specializedUrlGenerator instanceof IPortalUrlGenerator){
	portalUrlGenerator = (IPortalUrlGenerator)specializedUrlGenerator;

	myNewParameter = portalUrlGenerator.generatePortalComponentUrl(request, myParameter);

My imports are:

import com.sapportals.portal.prt.service.urlgenerator.IUrlGeneratorService;
import com.sapportals.portal.prt.service.urlgenerator.specialized.IPortalUrlGenerator;
import com.sapportals.portal.prt.service.urlgenerator.specialized.ISpecializedUrlGenerator;
import com.sapportals.wcm.repository.ResourceFactory;
import com.sapportals.wcm.service.IServiceTypesConst;

I have also built the following portalapp.xml:

<?xml version="1.0" encoding="utf-8"?>
    <component name="ProxyiView">
        <property name="ClassName" value="com.mycompany.ProxyiView"/>
	<property name="SafetyLevel" value="low_safety"/>
	<property name="SharingReference" value="htmlb, usermanagement, knowledgemanagement"/>

However, it keeps generating an error when I run the iView:

Exception id: 02:30_06/04/06_0009_601745950
See the details for the exception ID in the log file

What could be the problem?

Thanks in advance,

Fernando Urzedo

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Fernando,

Try to add urlgenerator to SharingReference in portalapp.xml. Without it classloader don't load classes of this service.



Former Member
0 Kudos

Hi Sergei,

Still getting the same error...

Thanks anyway

Fernando Urzedo

Active Contributor
0 Kudos

Hi Fernando,

use the portal application name as SharingReference, that is the name of the portal application (name of the deployed par / directory name) in which the JAR with the class in question can be found. Of course one can use an alias, but using the plain name makes things more easy to track.

Hope it helps


Former Member
0 Kudos

Hi all,

Just to complement the solution, the property SharingReference should be located within the XML tag <application-config> and not <component-config>, as it was reproduced here

Answers (0)